Skip to content

Commit a18cef0

Browse files
authored
verify_os_update - mark node dirty after OS update (#4509)
1 parent 6d60890 commit a18cef0

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

lisa/microsoft/testsuites/core/azure_image_standard.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,10 +719,18 @@ def verify_yum_conf(self, node: Node) -> None:
719719
)
720720
def verify_os_update(self, node: Node) -> None:
721721
if isinstance(node.os, Posix):
722-
node.os.update_packages("")
722+
# After OS update sometimes kernel version may change.
723+
# When LISA is used to validate a VM image with specific kernel version,
724+
# changing the kernel will result in running tests with undesired kernel
725+
# which is not expected.
726+
# Marking the node dirty after OS update to avoid such issues.
727+
try:
728+
node.os.update_packages("")
729+
finally:
730+
node.mark_dirty()
731+
node.reboot()
723732
else:
724733
raise SkippedException(f"Unsupported OS or distro type : {type(node.os)}")
725-
node.reboot()
726734

727735
@TestCaseMetadata(
728736
description="""

0 commit comments

Comments
 (0)