forked from gluster/redant
-
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.
Signal handler function is added for graceful exiting of the test framework. Fixes: gluster#208 Signed-off-by: Nishith Vihar Sakinala <[email protected]>
- Loading branch information
1 parent
ca587b0
commit db98800
Showing
9 changed files
with
74 additions
and
3 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
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
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
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 |
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
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,21 @@ | ||
""" | ||
This file contains a class named SignalHandler | ||
which contains different signal handler methods | ||
for different signals. Signal Handling is required | ||
for the graceful exiting of the test framework. | ||
""" | ||
|
||
import signal | ||
|
||
def signal_handler(signalNumber, frame): | ||
""" | ||
Function catches the signal given and raises SystemExit | ||
call to exit the framework gracefully | ||
Args: | ||
signalNumber: The signal number of the signal caught according | ||
to POSIX standard | ||
frame: current stack frame, either None or frame object | ||
""" | ||
print("Signal Received",signalNumber) | ||
raise SystemExit('Exiting...') | ||
return |