strace/tests/restart_syscall.test
Dmitry V. Levin 25c804ce42 tests: add a test for "resuming interrupted nanosleep"
* tests/restart_syscall.test: New test.
* tests/restart_syscall.expected: New file.
* tests/restart_syscall_unknown.expected: Likewise.
* tests/Makefile.am (TESTS): Add restart_syscall.test.
(EXTRA_DIST): Add restart_syscall.expected
(TEST_LOG_COMPILER): Change to "env".
(OS, ARCH, AM_TEST_LOG_FLAGS): Define.
and restart_syscall_unknown.expected.
2015-04-07 23:01:47 +00:00

26 lines
560 B
Bash
Executable File

#!/bin/sh
# Check how "resuming interrupted nanosleep" works.
. "${srcdir=.}/init.sh"
check_prog sleep
check_prog grep
run_strace -enanosleep sleep 1
grep nanosleep < "$LOG" > /dev/null ||
framework_skip_ 'sleep does not use nanosleep'
./set_ptracer_any sleep 2 &
sleep 1
run_strace -q -erestart_syscall -p $!
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