ME_="${0##*/}"
+check_timeout=60
+
warn_() { printf >&2 '%s\n' "$*"; }
fail_() { warn_ "$ME_: failed test: $*"; exit 1; }
skip_() { warn_ "$ME_: skipped test: $*"; exit 77; }
check_strace
check_prog timeout
-timeout -s 9 9 \
+timeout -s 9 $check_timeout \
$STRACE -df -enone / 2>&1 |
grep -F -x 'ptrace_setoptions = 0xe' > /dev/null ||
fail_ 'strace -f failed to recognize proper kernel PTRACE_O_TRACECLONE support'
-timeout -s 9 9 \
+timeout -s 9 $check_timeout \
$STRACE -df -enone / 2>&1 |
grep -F -x 'ptrace_setoptions = 0x1f' > /dev/null ||
fail_ 'strace -f failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support'
-timeout -s 9 9 \
+timeout -s 9 $check_timeout \
$STRACE -d -enone / 2>&1 |
grep -F -x 'ptrace_setoptions = 0x11' > /dev/null ||
fail_ 'strace failed to recognize proper kernel PTRACE_O_TRACESYSGOOD support'
time=/usr/bin/time
check_prog $time
-timeout -s 9 9 \
+timeout -s 9 $check_timeout \
$STRACE -f $time /bin/ls > check.log 2>&1 ||
{ cat check.log; fail_ 'strace -f does not work'; }