diff --git a/tests/execute/reboot/basic.sh b/tests/execute/reboot/basic.sh index 2c9a8b54b5..6d2358d655 100755 --- a/tests/execute/reboot/basic.sh +++ b/tests/execute/reboot/basic.sh @@ -11,11 +11,11 @@ rlJournalStart for interactive in "" "--interactive"; do rlPhaseStartTest "Simple reboot test (interactivity: $interactive)" rlRun -s "tmt run --scratch -i $run -dddvvva execute -h tmt $interactive" - rlAssertGrep "Reboot during test '/test' with reboot count 1" $rlRun_LOG + rlAssertGrep "Soft reboot during test '/test' with reboot count 1" $rlRun_LOG rlAssertGrep "After first reboot" $rlRun_LOG - rlAssertGrep "Reboot during test '/test' with reboot count 2" $rlRun_LOG + rlAssertGrep "Soft reboot during test '/test' with reboot count 2" $rlRun_LOG rlAssertGrep "After second reboot" $rlRun_LOG - rlAssertGrep "Reboot during test '/test' with reboot count 3" $rlRun_LOG + rlAssertGrep "Soft reboot during test '/test' with reboot count 3" $rlRun_LOG rlAssertGrep "After third reboot" $rlRun_LOG rlRun "rm $rlRun_LOG" diff --git a/tests/test/check/data/main.fmf b/tests/test/check/data/main.fmf index 32306e3ba3..9399a0aac4 100644 --- a/tests/test/check/data/main.fmf +++ b/tests/test/check/data/main.fmf @@ -52,7 +52,9 @@ check: - name: watchdog + interval: 5 + reboot: true ping: true ping-packets: 1 diff --git a/tests/test/check/main.fmf b/tests/test/check/main.fmf index 88f62de1d8..1a17ec6d7b 100644 --- a/tests/test/check/main.fmf +++ b/tests/test/check/main.fmf @@ -29,10 +29,10 @@ tier: 2 test: ./test-watchdog.sh environment: - PROVISION_METHODS: local virtual + PROVISION_METHODS: local adjust: - when: how == full environment: - PROVISION_METHODS: virtual + PROVISION_METHODS: local virtual tag+: [additional_coverage] diff --git a/tmt/checks/watchdog.py b/tmt/checks/watchdog.py index d849c91a4c..0bdfab0b42 100644 --- a/tmt/checks/watchdog.py +++ b/tmt/checks/watchdog.py @@ -87,6 +87,8 @@ class GuestContext: class WatchdogCheck(Check): interval: int = field(default=60) + reboot: bool = field(default=False) + ping: bool = field(default=False) ping_packets: int = field(default=1) ping_threshold: int = field(default=10) @@ -97,6 +99,9 @@ class WatchdogCheck(Check): def notify(self, invocation: 'TestInvocation') -> None: """ Notify invocation that hard reboot is required """ + if not self.reboot: + return + invocation.hard_reboot_requested = True invocation.terminate_process()