summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAge
* Rewrite signal mask decoding without sigset_tDmitry V. Levin2014-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sigset_t provided by libc is not quite convenient. In glibc, sigset_t is an array with space for 1024 bits, which is much more than required: all architectures supported by Linux have only 64 signals except MIPS, which has 128. In bionic libc, LP32 sigset_t is only 4 bytes long, which is less than necessary. With this change, signal mask is decoded without use of intermediate sigset_t structure, which saves us some cpu cycles in case of glibc with its inflated sigset_t, and enables build with libcs where sigset_t is broken. Old implementation used to check each signal number in the given signal mask twice using sigismember(). New implementation is based on popcount and next_set_bit() so it's noticeably faster. * configure.ac: Check for __builtin_popcount. * signal.c: Ensure that NSIG >= 32. (sprintsigmask, sprintsigmask_long, printsigmask): Remove. (popcount32, sprintsigmask_n): New functions. (tprintsigmask_addr, sprintsigmask_val, tprintsigmask_val): New macros. (print_sigset_addr_len, sys_sigsetmask, sys_sigreturn, sys_siggetmask, sys_sigsuspend, sys_sigprocmask, decode_new_sigaction): Update to use new signal mask decoding interface. * tests/sigaction.c (main): Add a test with almost filled signal mask. * tests/sigaction.awk: Update.
* tests: tighten sigaction checkDmitry V. Levin2014-02-08
| | | | * tests/sigaction.awk: Check that input conatins all expected lines.
* Add decoding of sockets descriptor 'paths' for network callsPhilippe Ombredanne2014-02-02
| | | | | | | | | | | | | | | * net.c (sys_bind, sys_listen, do_accept, sys_send, sys_sendto, sys_sendmsg, sys_sendmmsg, sys_recv, sys_recvfrom, sys_recvmsg, sys_recvmmsg, sys_shutdown, sys_getsockopt, sys_setsockopt): Decode socket descriptor arguments using printfd. * pathtrace.c (pathtrace_match): Also check TRACE_NETWORK syscalls that take socket descriptor arguments. * tests/net-fd.test: New test for socket descriptor arguments decoding. * tests/Makefile.am (TESTS): Add net-fd.test. (net-fd.log): New dependency on net.log. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* tests: rename all tests so that their names end in .test suffixDmitry V. Levin2014-02-02
| | | | | | | | | | | | | | | | | Due to automake limitations, some features work only for tests that end in one of the suffixes listed in TEST_EXTENSIONS. * tests/detach-running: Rename to detach-running.test. * tests/detach-sleeping: Rename to detach-sleeping.test. * tests/detach-stopped: Rename to detach-stopped.test. * tests/net: Rename to net.test. * tests/ptrace_setoptions: Rename to ptrace_setoptions.test. * tests/qual_syscall: Rename to qual_syscall.test. * tests/sigaction.sh: Rename to sigaction.test. * tests/stat: Rename to stat.test. * tests/strace-f: Rename to strace-f.test. * tests/Makefile.am (TESTS): Update. (LOG_COMPILER): Rename to TEST_LOG_COMPILER.
* tests: add a test for rt_sigaction outputDmitry V. Levin2014-01-08
| | | | | | | | | | | | | | | | Since "struct sigaction" varies between architectures, rt_sigaction decoding sometimes produces incorrect output. This test is expected to catch basic rt_sigaction decoding bugs. Based on a patch proposed by Chris Dearman. * tests/sigaction.c: New file. * tests/sigaction.awk: Likewise. * tests/sigaction.sh: New test. * tests/Makefile.am (check_PROGRAMS): Add sigaction. (TESTS): Add sigaction.sh. (EXTRA_DIST): Add sigaction.awk. * tests/.gitignore: Add sigaction.
* tests: disable /proc based checks when /proc is not mountedDmitry V. Levin2013-06-19
| | | | | | | * tests/detach-running: Disable /proc based checks when /proc/self/status is not available. * tests/detach-sleeping: Likewise. * tests/detach-stopped: Likewise.
* tests/detach-{running,sleeping,stopped}: check post-detach stateDenys Vlasenko2013-06-19
| | | | | | | Check that traced process still exists and is in a right state after strace detached from it. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* tests: ensure that strace can detach from running processesDmitry V. Levin2013-06-19
| | | | | * tests/detach-running: New test. * tests/Makefile.am (TESTS): Add it.
* tests: ensure that strace does not leave sleeping processes stoppedDmitry V. Levin2013-06-19
| | | | * tests/detach-sleeping: Do not send SIGCONT to the sleeping process.
* tests: fix parallel-tests support in detach-* testsDmitry V. Levin2013-06-18
| | | | | * tests/detach-sleeping: Use $LOG file for set_ptracer_any output. * tests/detach-stopped: Likewise.
* tests: parametrize "sleep 1"Dmitry V. Levin2013-06-18
| | | | | | * tests/init.sh (SLEEP_A_BIT): New variable. * tests/detach-sleeping: Use it. * tests/detach-stopped: Likewise.
* tests: ensure that strace can detach from sleeping and stopped processesDmitry V. Levin2013-06-18
| | | | | | | | | * tests/set_ptracer_any.c: New file. * tests/detach-sleeping: New test. * tests/detach-stopped: Likewise. * tests/Makefile.am (check_PROGRAMS): Add set_ptracer_any. (TESTS): Add detach-sleeping and detach-stopped. * tests/.gitignore: Add set_ptracer_any.
* tests: enhance timeout checksDmitry V. Levin2013-06-18
| | | | | | | | | | | | | | Run each test using a wrapper that does all necessary timeout checks. * tests/run.sh: New file. * tests/Makefile.am (EXTRA_DIST, LOG_COMPILER): Add it. * tests/init.sh (check_strace, check_timeout): Remove. * tests/detach-stopped: Update callers. * tests/net: Likewise. * tests/ptrace_setoptions: Likewise. * tests/qual_syscall: Likewise. * tests/stat: Likewise. * tests/strace-f: Likewise.
* tests: prepare for parallel-tests supportDmitry V. Levin2013-06-18
| | | | | | | | | | * tests/Makefile.am (CLEANFILES): Calculate dynamically from TESTS. * tests/init.sh (LOG): New variable. * tests/detach-stopped: Use it. * tests/net: Likewise. * tests/qual_syscall: Likewise. * tests/stat: Likewise. * tests/strace-f: Likewise.
* tests/net: fix portability issuesDmitry V. Levin2013-05-08
| | | | | | * tests/net-accept-connect.c: Fix address length passed to bind() and connect(). * tests/net: Update regexps.
* tests: add a test for basic network syscallsDmitry V. Levin2013-05-08
| | | | | | | | | * tests/.gitignore: Add net-accept-connect, *.o and *.log.*. * tests/Makefile.am (AM_CFLAGS): New variable. (check_PROGRAMS): Add net-accept-connect. (TESTS): Add net. * tests/net-accept-connect.c: New file. * tests/net: New file.
* tests: do not skip tests when timeout utility is not availableDmitry V. Levin2013-05-08
| | | | | | | | * tests/init.sh (check_timeout): New function. * tests/ptrace_setoptions: Use it. * tests/qual_syscall: Likewise. * tests/stat: Likewise. * tests/strace-f: Likewise.
* tests/stat: enhance regexpsDmitry V. Levin2013-05-06
| | | | | * tests/stat: Enhance regexps that check tracing of stat/stat64 and fstatat/fstatat64 syscalls.
* tests/stat: support fstatat syscall for stat()Chris Metcalf2013-05-06
| | | | | | | | | | | | | | | Newer Linux architectures don't support the stat/stat64 syscalls. Instead they use fstatat() with AT_FDCWD and an extra flags argument. Support seeing this output in the 'strace -efile' test. As part of this change, use "grep -E -x" syntax consistently for all stat tests, since the number of \(foo\)\? expressions was becoming pretty unwieldy. * tests/stat: Update stat/stat64 check regexp to handle architectures that use fstatat instead. Use "grep -E -x" syntax consistently. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
* tests: stat: fix clean up of sample fileMike Frysinger2013-05-02
| | | | * tests/stat: Also rm the sample file at the end of the test.
* Ignore more filesMike Frysinger2013-05-02
| | | | | * .gitignore: Add gdb related files. * tests/.gitignore: Ignore test logs.
* tests: add basic test for ftruncate, lseek and stat family syscallsDmitry V. Levin2013-05-02
| | | | | * tests/stat: New test. * tests/Makefile.am (TESTS): Add stat.
* tests: relax check_prog to allow timeout command provided by busyboxMaxin B. John2013-03-18
| | | | | | | | | | Busybox version of timeout doesn't have --version option. Relax check_prog to handle those cases. * tests/init.sh (check_prog): Use type builtin to check program availability. Signed-off-by: Maxin B. John <maxin.john@enea.com>
* Fix trace=set regression introduced by commit v4.7-111-g9cbc15bDmitry V. Levin2013-03-01
| | | | | | | * syscall.c (qual_syscall, qualify): Pass personality down to qualify_one. * tests/qual_syscall: New test. * tests/Makefile.am (TESTS): Add qual_syscall.
* tests: raise strace check timeout to 60 secondsDmitry V. Levin2012-05-01
| | | | | | | | * tests/init.sh (check_timeout): New variable. * tests/ptrace_setoptions: Use it. * tests/strace-f: Likewise. Reported-by: Mike Frysinger <vapier@gentoo.org>
* tests: robustify again buggy shellsDmitry V. Levin2012-03-15
| | | | | | | * tests/init.sh (check_strace): Use "${parameter:-word}" shell syntax instead of "${parameter-word}". Reported-by: Mike Frysinger <vapier@gentoo.org>
* tests: finish ptrace_setoptions_* mergeDmitry V. Levin2011-06-21
| | | | | * tests/Makefile.am (TESTS): Merge ptrace_setoptions_*. * tests/ptrace_setoptions: Check for Linux kernel > 2.6.
* Fix tests/ptrace_setoptions_* to match last fix in ptrace options codeDenys Vlasenko2011-06-21
| | | | Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Add test for PTRACE_O_TRACESYSGOODDmitry V. Levin2011-06-09
| | | | | * tests/ptrace_setoptions_for_all: New file. * tests/Makefile.am (TESTS): Add ptrace_setoptions_for_all.
* tests: update test for linux kernel versionDmitry V. Levin2011-06-09
| | | | * tests/ptrace_setoptions_followfork: Check for Linux kernel > 2.6.
* Update ptrace_setoptions testDmitry V. Levin2011-06-09
| | | | | | | | | The test have to be adjusted after commit v4.6-5-g3454e4b. * ptrace_setoptions: Update grep pattern, rename to ptrace_setoptions_followfork. * tests/Makefile.am (TESTS): Rename ptrace_setoptions to ptrace_setoptions_followfork.
* tests: avoid SIGPIPEDmitry V. Levin2011-03-03
| | | | | | | * tests/ptrace_setoptions: Replace "grep -q" with "grep > /dev/null". The former may result to strace being killed by SIGPIPE, which in certain configuratons may lead to generation of a core file. Suggested by Mike Frysinger.
* tests: do not make missing /usr/bin/time a failureMike Frysinger2011-03-01
| | | | | | | * tests/init.sh (framework_skip_): New function. (check_prog): Use it instead of framework_failure_. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Implement two basic "strace -f" testsDmitry V. Levin2011-02-27
* Makefile.am (SUBDIRS): Add tests. * configure.ac (AC_CONFIG_FILES): Add tests/Makefile. * tests/.gitignore: New file. * tests/Makefile.am: Likewise. * tests/init.sh: Likewise. * tests/ptrace_setoptions: Likewise. * tests/strace-f: Likewise.