aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--selftest/process_test.ok9
-rwxr-xr-xselftest/process_test/foo.py6
2 files changed, 9 insertions, 6 deletions
diff --git a/selftest/process_test.ok b/selftest/process_test.ok
index f168ee3..e40a461 100644
--- a/selftest/process_test.ok
+++ b/selftest/process_test.ok
@@ -13,21 +13,18 @@ foo stderr
run foo(pid=[PID]): Terminating (SIGINT)
run foo(pid=[PID]): DBG: Cleanup
-run foo(pid=[PID]): Terminated {rc=1}
-result: 1
+run foo(pid=[PID]): Terminated {rc=42}
+result: 42
stdout:
(launched: [DATETIME])
foo stdout
[[$0], 'arg1', 'arg2']
+SIGINT received
Exiting (stdout)
stderr:
(launched: [DATETIME])
foo stderr
-Traceback (most recent call last):
- File [$0], line [LINE], in <module>
- time.sleep(1)
-KeyboardInterrupt
Exiting (stderr)
done.
diff --git a/selftest/process_test/foo.py b/selftest/process_test/foo.py
index 4abe887..0931c9b 100755
--- a/selftest/process_test/foo.py
+++ b/selftest/process_test/foo.py
@@ -3,7 +3,13 @@
import sys
import atexit
import time
+import signal
+def signal_handler(sig, frame):
+ print('SIGINT received')
+ sys.exit(42)
+
+signal.signal(signal.SIGINT, signal_handler)
sys.stdout.write('foo stdout\n')
sys.stderr.write('foo stderr\n')