From dbd5660d7421292818fc230a8a064f277b3e03a5 Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Thu, 12 Sep 2024 15:10:20 +0100 Subject: [PATCH] tests: Call `wait_for_up` in `Microvm.restore_from_snapshot` After restoring a snapshot, we are not waiting for the VM to finish booting (it needs to have done that before we took a snapshot), but having a `wait_for_up` here is still a good sanity check for ensuring the VM is still responsive. So far our tests have been inconsistent on whether to put a `wait_for_up` here. This makes them consistent by always doing `wait_for_up` if a network device is available. Signed-off-by: Patrick Roy --- tests/framework/microvm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/framework/microvm.py b/tests/framework/microvm.py index bf7c50cf8c9..2b23f4baff0 100644 --- a/tests/framework/microvm.py +++ b/tests/framework/microvm.py @@ -961,6 +961,9 @@ def restore_from_snapshot( enable_diff_snapshots=snapshot.is_diff, resume_vm=resume, ) + # This is not a "wait for boot", but rather a "VM still works after restoration" + if snapshot.net_ifaces and resume: + self.wait_for_up() return jailed_snapshot def enable_entropy_device(self):