From 80bb99c1b21f2e509f0e07ca6b574cb85669b60b Mon Sep 17 00:00:00 2001 From: Babis Chalios Date: Thu, 7 Mar 2024 10:12:23 +0000 Subject: [PATCH] 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 --- tests/integration_tests/security/test_vulnerabilities.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/integration_tests/security/test_vulnerabilities.py b/tests/integration_tests/security/test_vulnerabilities.py index b22a76a2ab6..15445d7c1e8 100644 --- a/tests/integration_tests/security/test_vulnerabilities.py +++ b/tests/integration_tests/security/test_vulnerabilities.py @@ -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: