Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,52 @@ def before_case(self, log: Logger, **kwargs: Any) -> None:
node: Node = kwargs.pop("node")
check_waagent_version_supported(node=node)

@TestCaseMetadata(
description="""
Basic boot validation for the Custom Script VM extension.

Installs the extension with a single inline commandToExecute and no file
uris, so it needs no storage account or public blob access. Verifies that
provisioning succeeds, then removes the extension.

The extension publisher, type and version are read from runbook variables
(extension_publisher, extension_type, extension_version), defaulting to the
Custom Script extension. The deployed extension is named
'<publisher>_<extension_type>_boot_validation_test'.
""",
priority=1,
)
def microsoft_azure_extensions_customscript_boot_validation_test(
self, log: Logger, node: Node, variables: Dict[str, Any]
) -> None:
publisher: str = variables.get(
"extension_publisher", "Microsoft.Azure.Extensions"
).strip()
extension_type: str = variables.get("extension_type", "CustomScript").strip()
version: str = variables.get("extension_version", "2.1").strip()

extension_name = f"{publisher}_{extension_type}_boot_validation_test"
settings = {"commandToExecute": "echo 'CSE test success'"}

extension = node.features[AzureExtension]
extension.delete(name=extension_name, ignore_not_found=True)

log.info(f"Installing extension '{extension_name}'...")
result = extension.create_or_update(
name=extension_name,
publisher=publisher,
type_=extension_type,
type_handler_version=version,
auto_upgrade_minor_version=True,
settings=settings,
)

assert_that(result["provisioning_state"]).described_as(
"Expected the extension to succeed"
).is_equal_to("Succeeded")

extension.delete(name=extension_name, ignore_not_found=True)

@TestCaseMetadata(
description="""
Runs the Custom Script VM extension with a public Azure storage file uri.
Expand Down
Loading