Skip to content

Commit dc1308b

Browse files
zhijianli88shuahkh
authored andcommitted
selftests/watchdog-test: Fix system accidentally reset after watchdog-test
When running watchdog-test with 'make run_tests', the watchdog-test will be terminated by a timeout signal(SIGTERM) due to the test timemout. And then, a system reboot would happen due to watchdog not stop. see the dmesg as below: ``` [ 1367.185172] watchdog: watchdog0: watchdog did not stop! ``` Fix it by registering more signals(including SIGTERM) in watchdog-test, where its signal handler will stop the watchdog. After that # timeout 1 ./watchdog-test Watchdog Ticking Away! . Stopping watchdog ticks... Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Li Zhijian <[email protected]> Reviewed-by: Shuah Khan <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 722d89c commit dc1308b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/testing/selftests/watchdog/watchdog-test.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,13 @@ int main(int argc, char *argv[])
334334

335335
printf("Watchdog Ticking Away!\n");
336336

337+
/*
338+
* Register the signals
339+
*/
337340
signal(SIGINT, term);
341+
signal(SIGTERM, term);
342+
signal(SIGKILL, term);
343+
signal(SIGQUIT, term);
338344

339345
while (1) {
340346
keep_alive();

0 commit comments

Comments
 (0)