strace/tests/prctl-seccomp-strict.test
Dmitry V. Levin e8a8f6d6e8 tests: workaround kernel bugs in seccomp-strict.test and prctl-seccomp-strict.test
If kernel implementation of strict seccomp mode is buggy, test programs
will be killed by SIGKILL.  This is a known problem at least on
x32 and mips.  Skip affected tests if this is the case.

This change partially revert commit 9c1a72cd3f.

* tests/seccomp-strict.c (main): Remove workaround for x32.
* tests/prctl-seccomp-strict.c: Likewise.
* tests/seccomp-strict.test: Skip the test if the test program
has been killed by SIGKILL.
* tests/prctl-seccomp-strict.test: Likewise.
2016-04-20 14:30:43 +00:00

20 lines
433 B
Bash
Executable File

#!/bin/sh
# Check how prctl PR_SET_SECCOMP SECCOMP_MODE_STRICT is decoded.
. "${srcdir=.}/init.sh"
check_prog grep
set -- "./$NAME"
"$@" > /dev/null || {
case $? in
77) skip_ "$* exited with code 77" ;;
137) framework_skip_ "$* killed by SIGKILL, fix your kernel" ;;
*) fail_ "$args failed" ;;
esac
}
run_strace -eprctl "$@" > "$EXP"
grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT"
match_diff "$OUT" "$EXP"
rm -f "$EXP" "$OUT"