summaryrefslogtreecommitdiff
path: root/tests/pidns.c
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2021-10-11 15:24:45 +0200
committerEugene Syromyatnikov <evgsyr@gmail.com>2021-10-12 00:35:48 +0200
commitb9a308a6e921761756b2ba32a62ee413bd67dfcd (patch)
tree73819c2e6b4f663aa82df6a971ff293ac8e725b4 /tests/pidns.c
parentaab5c5a87e1c87ce23c3d76969d7a15228a3d6e0 (diff)
downloadstrace-b9a308a6e921761756b2ba32a62ee413bd67dfcd.tar.gz
tests/pidns.c: allow skipping tests inside the pidns harness
* tests/pidns.c (pidns_fork): Handle exit code 77 from the child.
Diffstat (limited to 'tests/pidns.c')
-rw-r--r--tests/pidns.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/pidns.c b/tests/pidns.c
index 1f00e5ed3..702415d19 100644
--- a/tests/pidns.c
+++ b/tests/pidns.c
@@ -140,8 +140,15 @@ pidns_fork(pid_t pgid, bool new_sid)
siginfo_t siginfo;
if (waitid(P_PID, pid, &siginfo, WEXITED | WNOWAIT) < 0)
perror_msg_and_fail("wait");
- if (siginfo.si_code != CLD_EXITED || siginfo.si_status)
- error_msg_and_fail("child terminated with nonzero exit status");
+ if (siginfo.si_code != CLD_EXITED || siginfo.si_status) {
+ if (siginfo.si_code == CLD_EXITED && siginfo.si_status == 77) {
+ error_msg_and_skip("child terminated with skip exit"
+ " status");
+ } else {
+ error_msg_and_fail("child terminated with nonzero exit"
+ " status");
+ }
+ }
return pid;
}