aboutsummaryrefslogtreecommitdiffstats
path: root/selftest/process_test.ok
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-05-06 17:57:33 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-05-06 17:57:36 +0200
commitfa653e4136d08e83d4f1d7dc4f415057920c8e33 (patch)
treea4f290a6ec4845ecba18a71b7960df7dd53d1329 /selftest/process_test.ok
parentafa2fc3aa669912637c6f402b01ebf486a5e44fa (diff)
selftest/process_test: Fix output changing in new python version
On older versions apparently upon child termination due to SIGINT subprocess.poll() returned 1. On new python versions (such as 3.8.2), -2 is returned, according to documentation: A negative value -N indicates that the child was terminated by signal N (Unix only). Let's catch the SIGINT in the child process and exit with a known 42 value to fix different behavior. Change-Id: I7949ff2b435e91e890061e6840b0f411f8b0a817
Diffstat (limited to 'selftest/process_test.ok')
-rw-r--r--selftest/process_test.ok9
1 files changed, 3 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.