forked from sonic-net/sonic-mgmt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add watchdog timeout event test (sonic-net#13468)
### Description of PR Summary: Fixes # (issue)26636373 ### Approach #### What is the motivation for this PR? Add event for watchdog timeout #### How did you do it? Create mock test service that will sleep and therefore not send watchdog signal. This will generate watchdog timeout event #### How did you verify/test it? Manual test/Pipeline
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/telemetry/events/events_data/test-watchdog-timeout.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Test Watchdog Timeout | ||
|
||
[Service] | ||
Type=simple | ||
# This service will sleep for 2 minutes therefore not sending the signal to watchdog within the specified 1 min requirement | ||
# Since SIGABRT will be sent after watchdog times out due to no signal, it will crash the bash process and dump core | ||
# Added logic to trap the SIGABRT so that no core dump is dropped. | ||
ExecStart=/bin/bash -c 'trap "" SIGABRT; sleep 120' | ||
WatchdogSec=60s | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters