-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signal handler is added for the graceful exit of the test framework. Fixes: #208 Signed-off-by: Nishith Vihar Sakinala <nsakinal@redhat.com>
- Loading branch information
1 parent
ca587b0
commit 0a9d462
Showing
2 changed files
with
27 additions
and
1 deletion.
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
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,20 @@ | ||
""" | ||
This file consists of functions for handling | ||
signals. Signal handling is required for the | ||
graceful exit of the test framework | ||
""" | ||
|
||
import signal | ||
|
||
def signal_handler(signalNumber, frame): | ||
""" | ||
Function for handling signal and raising the | ||
SystemExit call for graceful exit of the test | ||
framework | ||
Args: | ||
signalNumber (int): The signal number of the signal caught | ||
frame: current stack frame, None or stack frame object. | ||
""" | ||
print("Signal Received",signalNumber) | ||
raise SystemExit('Exiting...') | ||
return |