Skip to content

Commit

Permalink
fix(test): wait for microVM to boot before snapshotting
Browse files Browse the repository at this point in the history
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 <bchalios@amazon.es>
  • Loading branch information
bchalios committed Apr 9, 2024
1 parent 9a71fba commit 80bb99c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/integration_tests/security/test_vulnerabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ def with_restore(factory, microvm_factory):

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

if firecracker:
Expand Down

0 comments on commit 80bb99c

Please sign in to comment.