]> granicus.if.org Git - strace/blob - tests/ptrace_setoptions.test
Fix preadv/pwritev offset decoding on bigendian architectures
[strace] / tests / ptrace_setoptions.test
1 #!/bin/sh
2
3 # Ensure that strace tests kernel PTRACE_O_TRACECLONE
4 # and PTRACE_O_TRACESYSGOOD support properly.
5
6 . "${srcdir=.}/init.sh"
7
8 [ "$(uname -s)" = Linux ] ||
9         skip_ 'The kernel is not a Linux kernel'
10 case "$(uname -r)" in
11         2.[6-9]*|2.[1-5][0-9]*|[3-9].*|[12][0-9]*) ;;
12         *) skip_ 'The kernel is not Linux 2.6.* or newer' ;;
13 esac
14
15 $STRACE -df -enone / > /dev/null 2> $LOG
16 grep -F -x 'ptrace_setoptions = 0xe' $LOG > /dev/null || {
17         cat $LOG
18         fail_ 'strace -f failed to recognize proper kernel PTRACE_O_TRACECLONE support'
19 }
20
21 grep -F -x 'ptrace_setoptions = 0x1f' $LOG > /dev/null || {
22         cat $LOG
23         fail_ 'strace -f failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support'
24 }
25
26 $STRACE -d -enone / > /dev/null 2> $LOG
27 grep -F -x 'ptrace_setoptions = 0x11' $LOG > /dev/null || {
28         cat $LOG
29         fail_ 'strace failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support'
30 }