Add test for PTRACE_O_TRACESYSGOOD

* tests/ptrace_setoptions_for_all: New file.
* tests/Makefile.am (TESTS): Add ptrace_setoptions_for_all.
This commit is contained in:
Дмитрий Левин 2011-06-09 18:28:02 +00:00
parent 30ecdcc121
commit 2ea2ab0590
2 changed files with 21 additions and 1 deletions

View File

@ -1,6 +1,6 @@
# Automake input for strace tests.
TESTS = ptrace_setoptions_followfork strace-f
TESTS = ptrace_setoptions_followfork ptrace_setoptions_for_all strace-f
EXTRA_DIST = init.sh $(TESTS)

20
tests/ptrace_setoptions_for_all Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
# Ensure that strace tests kernel PTRACE_O_TRACESYSGOOD support properly.
. "${srcdir=.}/init.sh"
[ "$(uname -s)" = Linux ] ||
skip_ 'The kernel is not a Linux kernel'
case "$(uname -r)" in
2.[6-9]*|2.[1-5][0-9]*|[3-9].*|[12][0-9]*) ;;
*) skip_ 'The kernel is not Linux 2.6.* or newer' ;;
esac
check_strace
check_prog timeout
timeout -s 9 9 \
$STRACE -d -enone / 2>&1 |
grep -F -x 'ptrace_setoptions_for_all = 0x11' > /dev/null ||
fail_ 'strace failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support'