Skip to content

Commit 96b27f9

Browse files
committed
Wait for guest connection before test restart
Even without a reboot, tmt still needs to verify the guest is up and running. The reboot might be triggered beyond the control of tmt, and that is fine, we just need to be sure we restart the test on guest that's alive. Related to #3284
1 parent 931fade commit 96b27f9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tmt/steps/execute/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,15 @@ def handle_restart(self) -> bool:
331331
else:
332332
self._restart_count += 1
333333

334+
# Even though the reboot was not requested, it might have
335+
# still happened! Imagine a test configuring autoreboot on
336+
# kernel panic plus a test restart. The reboot would happen
337+
# beyond tmt's control, and tmt would try to restart the
338+
# test, but the guest may be still booting. Make sure it's
339+
# alive.
340+
if not self.guest.reconnect():
341+
return False
342+
334343
self.logger.debug(
335344
f"Test restart during test '{self.test}'"
336345
f" with reboot count {self._reboot_count}"

0 commit comments

Comments
 (0)