Skip to content

Commit d9f1430

Browse files
authored
Wait for guest connection before test restart (#3291)
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 7b4c37b commit d9f1430

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
@@ -443,6 +443,15 @@ def handle_restart(self) -> bool:
443443
else:
444444
self._restart_count += 1
445445

446+
# Even though the reboot was not requested, it might have
447+
# still happened! Imagine a test configuring autoreboot on
448+
# kernel panic plus a test restart. The reboot would happen
449+
# beyond tmt's control, and tmt would try to restart the
450+
# test, but the guest may be still booting. Make sure it's
451+
# alive.
452+
if not self.guest.reconnect():
453+
return False
454+
446455
self.logger.debug(
447456
f"Test restart during test '{self.test}'"
448457
f" with reboot count {self._reboot_count}"

0 commit comments

Comments
 (0)