Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,10 @@ def reboot(self, verify=False):
if "closed by remote host" not in e.stdout:
raise
if verify:
wait_for_not(self.is_enabled, "Wait for host down")
# FIXME for more robustness we should make sure that 0%
# pings of a given number actually get a response
wait_for_not(lambda: not os.system(f"ping -c1 {self.hostname_or_ip} > /dev/null 2>&1"),
"Wait for host down", timeout_secs=10 * 60, retry_delay_secs=10)
wait_for(lambda: not os.system(f"ping -c1 {self.hostname_or_ip} > /dev/null 2>&1"),
"Wait for host up", timeout_secs=10 * 60, retry_delay_secs=10)
wait_for(lambda: not os.system(f"nc -zw5 {self.hostname_or_ip} 22"),
Expand Down
Loading