]> granicus.if.org Git - strace/blobdiff - tests/restart_syscall.test
tests: extend TEST_NETLINK_OBJECT macro
[strace] / tests / restart_syscall.test
index 1daa31651162be596492314554b3edd71d07daff..f7dfa04fd63ad4720ac44b99633dd65009b784cb 100755 (executable)
@@ -4,27 +4,7 @@
 
 . "${srcdir=.}/init.sh"
 
-check_prog sleep
-check_prog grep
-run_strace -enanosleep sleep 1
-LC_ALL=C grep ^nanosleep < "$LOG" > /dev/null ||
-       framework_skip_ 'sleep does not use nanosleep'
-
-./set_ptracer_any sleep 2 &
-sleep 1
-run_strace -q -erestart_syscall,nanosleep -p $!
-
-LC_ALL=C grep ^restart_syscall < "$LOG" > /dev/null ||
-if LC_ALL=C grep -x 'nanosleep({2, 0}, NULL) \+= 0' < "$LOG" > /dev/null; then
-       skip_ 'no restart_syscall, uninterrupted nanosleep'
-fi
-
-case "$STRACE_ARCH" in
-       alpha|mips|or1k|s390|s390x)
-               # These architectures use the same register
-               # both for syscall number and syscall return code.
-               match_diff "$LOG" "$srcdir/restart_syscall_unknown.expected"
-               ;;
-       *) match_diff
-               ;;
-esac
+run_prog > /dev/null
+syscalls=nanosleep,restart_syscall
+run_strace -a20 -e trace=$syscalls $args > "$EXP"
+match_grep "$LOG" "$EXP"