Unverified Commit 421a8ad6 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13806 [OLK-6.6][Backport] selftests/watchdog-test: Fix system accidentally...

!13806 [OLK-6.6][Backport] selftests/watchdog-test: Fix system accidentally reset after watchdog-test

Merge Pull Request from: @lazy2528 
 
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...

#IB6TLK  
 
Link:https://gitee.com/openeuler/kernel/pulls/13806

 

Reviewed-by: default avatarZhang Peng <zhangpeng362@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 7b5c07ef b4d777a1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -334,7 +334,13 @@ int main(int argc, char *argv[])

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

	/*
	 * Register the signals
	 */
	signal(SIGINT, term);
	signal(SIGTERM, term);
	signal(SIGKILL, term);
	signal(SIGQUIT, term);

	while (1) {
		keep_alive();