-
Notifications
You must be signed in to change notification settings - Fork 232
[AI Generated] BugFix: Skip resource disk readme check when cloud-init manages the disk #4417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| from lisa.sut_orchestrator.azure.features import AzureDiskOptionSettings | ||
| from lisa.sut_orchestrator.azure.tools import Waagent | ||
| from lisa.tools import ( | ||
|
|
@@ -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
|
||
|
|
||
| # verify 'WARNING: THIS IS A TEMPORARY DISK' contained in | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importing
is_cloud_init_enabledfrom 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.