Skip to content

Commit bfac67b

Browse files
committed
fix(test): wait for microVM to boot before snapshotting
In test_vulnerabilities.py we have various tests that check whether a condition holds after resuming from a snapshot. These checks seem to consistently fail if we take a snapshot before letting the guest kernel boot. Introduce an ssh command to ensure that the guest has booted before taking the snapshot so that we avoid the issue. Signed-off-by: Babis Chalios <[email protected]>
1 parent 5349927 commit bfac67b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/integration_tests/security/test_vulnerabilities.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def with_restore(factory, microvm_factory):
122122

123123
def restore(firecracker=None, jailer=None):
124124
microvm = factory(firecracker, jailer)
125+
# Ensure that we have booted before getting the snapshot.
126+
rc, _, stderr = microvm.ssh.run("true")
127+
assert rc == 0, stderr
125128
snapshot = microvm.snapshot_full()
126129

127130
if firecracker:

0 commit comments

Comments
 (0)