diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2015-04-07 21:18:23 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2015-04-07 23:01:47 +0000 |
commit | 25c804ce42261b24b19d35c637bf2745c237ee07 (patch) | |
tree | 89f8fc26237869f87833eea1997be11c6aa95175 /tests/restart_syscall.test | |
parent | dfd4e3f338a3f08bca8a0c90673b9292dc036f44 (diff) | |
download | strace-25c804ce42261b24b19d35c637bf2745c237ee07.tar.gz |
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.
Diffstat (limited to 'tests/restart_syscall.test')
-rwxr-xr-x | tests/restart_syscall.test | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/restart_syscall.test b/tests/restart_syscall.test new file mode 100755 index 000000000..5ae3a1d58 --- /dev/null +++ b/tests/restart_syscall.test @@ -0,0 +1,25 @@ +#!/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 |