Skip to content
Open
Changes from all commits
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
9 changes: 9 additions & 0 deletions lisa/microsoft/testsuites/core/azure_image_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
Ubuntu,
)
from lisa.sut_orchestrator import AZURE, HYPERV, QEMU, READY
from lisa.sut_orchestrator.azure.common import is_cloud_init_enabled
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing is_cloud_init_enabled from the Azure orchestrator layer couples this test suite logic to orchestrator internals. If this check is OS/tool-level (cloud-init presence/config), consider exposing it via a tool (e.g., node.tools[CloudInit]) or a testsuite-local helper to reduce cross-layer dependencies and make the check reusable outside Azure-orchestrator contexts.

Copilot uses AI. Check for mistakes.
from lisa.sut_orchestrator.azure.features import AzureDiskOptionSettings
from lisa.sut_orchestrator.azure.tools import Waagent
from lisa.tools import (
Expand Down Expand Up @@ -1463,8 +1464,16 @@ def verify_resource_disk_readme_file(self, node: RemoteNode) -> None:
assert_that(folder_exists, f"{fold_path} should be present").is_true()

# verify DATALOSS_WARNING_README.txt file exists
# This file is created by waagent, not cloud-init. When cloud-init
# manages the resource disk, the file will not be present.
file_path = f"{resource_disk_mount_point}/DATALOSS_WARNING_README.txt"
file_exists = node.tools[Ls].path_exists(file_path, sudo=True)
if not file_exists and is_cloud_init_enabled(node):
raise SkippedException(
f"{file_path} is not present. DATALOSS_WARNING_README.txt is"
" created by waagent, not cloud-init. Skipping on cloud-init"
" managed resource disk."
)
assert_that(file_exists, f"{file_path} should be present").is_true()
Comment on lines 1470 to 1477
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_cloud_init_enabled(node) is likely broader than "cloud-init manages the resource disk" (cloud-init can be enabled while waagent still manages/initializes the resource disk). This can cause false skips and hide regressions where the README should exist. Suggest tightening the condition to specifically detect resource-disk management (e.g., check waagent config/state that resource disk handling is delegated/disabled, or a cloud-init setting indicating it owns the resource disk) and only skip in that case.

Copilot uses AI. Check for mistakes.

# verify 'WARNING: THIS IS A TEMPORARY DISK' contained in
Expand Down
Loading