Skip to content

Commit

Permalink
Wait for guest connection before test restart
Browse files Browse the repository at this point in the history
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
  • Loading branch information
happz committed Oct 18, 2024
1 parent 2f2c4b4 commit 7ba95f2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tmt/steps/execute/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,15 @@ def handle_restart(self) -> bool:
else:
self._restart_count += 1

# Even though the reboot was not requested, it might have
# still happened! Imagine a test configuring autoreboot on
# kernel panic plus a test restart. The reboot would happen
# beyond tmt's control, and tmt would try to restart the
# test, but the guest may be still booting. Make sure it's
# alive.
if not self.guest.reconnect():
return False

self.logger.debug(
f"Test restart during test '{self.test}'"
f" with reboot count {self._reboot_count}"
Expand Down

0 comments on commit 7ba95f2

Please sign in to comment.