Skip to content

Commit 6c70ece

Browse files
committed
test: refactor: rename wait_for_up to wait_for_ssh_up
To indicate that we're really waiting until sshd is up and accepting connections, as a proxy for the actual boot process. Suggested during code review in #4798. Signed-off-by: Patrick Roy <[email protected]>
1 parent 6fee729 commit 6c70ece

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/framework/microvm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ def spawn(
654654
if "no-api" not in self.jailer.extra_args:
655655
self._wait_create()
656656
if "config-file" in self.jailer.extra_args and self.iface:
657-
self.wait_for_up()
657+
self.wait_for_ssh_up()
658658
if self.log_file and log_level in ("Trace", "Debug", "Info"):
659659
self.check_log_message("Running Firecracker")
660660

@@ -879,7 +879,7 @@ def start(self):
879879
assert self.state == "Running"
880880

881881
if self.iface:
882-
self.wait_for_up()
882+
self.wait_for_ssh_up()
883883

884884
def pause(self):
885885
"""Pauses the microVM"""
@@ -963,7 +963,7 @@ def restore_from_snapshot(
963963
)
964964
# This is not a "wait for boot", but rather a "VM still works after restoration"
965965
if snapshot.net_ifaces and resume:
966-
self.wait_for_up()
966+
self.wait_for_ssh_up()
967967
return jailed_snapshot
968968

969969
def enable_entropy_device(self):
@@ -1003,7 +1003,7 @@ def thread_backtraces(self):
10031003
)
10041004
return "\n".join(backtraces)
10051005

1006-
def wait_for_up(self, timeout=10):
1006+
def wait_for_ssh_up(self, timeout=10):
10071007
"""Wait for guest running inside the microVM to come up and respond.
10081008
10091009
:param timeout: seconds to wait.

tests/integration_tests/functional/test_pause_resume.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ def test_pause_resume(uvm_nano):
5050

5151
# Verify guest is no longer active.
5252
with pytest.raises(AssertionError):
53-
microvm.wait_for_up()
53+
microvm.wait_for_ssh_up()
5454

5555
# Verify emulation was indeed paused and no events from either
5656
# guest or host side were handled.
5757
verify_net_emulation_paused(microvm.flush_metrics())
5858

5959
# Verify guest is no longer active.
6060
with pytest.raises(AssertionError):
61-
microvm.wait_for_up()
61+
microvm.wait_for_ssh_up()
6262

6363
# Pausing the microVM when it is already `Paused` is allowed
6464
# (microVM remains in `Paused` state).

0 commit comments

Comments
 (0)