Skip to content

Commit

Permalink
tests: Call wait_for_up in Microvm.restore_from_snapshot
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
roypat authored and kalyazin committed Oct 7, 2024
1 parent fce73f6 commit dbd5660
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/framework/microvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit dbd5660

Please sign in to comment.