7555ffc390
tests: check decoding of struct msghdr ancillary data
...
* tests/msg_control.c: New file.
* tests/msg_control.test: New test.
* tests/.gitignore: Add msg_control.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add msg_control.test.
2016-07-01 20:13:37 +00:00
2a897372db
msghdr.c: fix representation of struct cmsghdr.cmsg_data integer arrays
...
* msghdr.c (print_cmsg_ip_opts): Print struct cmsghdr.cmsg_data
as an array of hexadecimal integers.
* tests/inet-cmsg.c (print_opts): Update expected output.
2016-06-30 22:10:31 +00:00
17e624cf96
msghdr.c: fix representation of integer struct cmsghdr.cmsg_data values
...
* msghdr.c (print_cmsg_ip_ttl, print_cmsg_ip_tos,
print_cmsg_ip_checksum): Print struct cmsghdr.cmsg_data value as an
array element.
* tests/inet-cmsg.c (print_ttl, print_tos): Update expected output.
2016-06-30 22:10:28 +00:00
08c0960ad5
msghdr.c: when printing struct struct cmsghdr.cmsg_data, also print its name
...
* msghdr.c (print_scm_rights, print_scm_creds, print_scm_security,
print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos,
print_cmsg_ip_checksum, print_cmsg_ip_opts, print_cmsg_ip_recverr,
print_cmsg_ip_origdstaddr): Print "cmsg_data=" before its contents.
* tests/inet-cmsg.c (print_pktinfo, print_ttl, print_tos, print_opts,
print_origdstaddr): Update expected output.
* tests/scm_rights-fd.test: Likewise.
2016-06-30 22:02:09 +00:00
a50ec34945
msghdr.c: print struct mmsghdr as a regular structure
...
* msghdr.c (decode_mmsghdr): Print names of msg_hdr and msg_len fields.
* tests/mmsg.c (main): Update expected output.
2016-06-27 00:14:34 +00:00
9a8216ea7b
Mpersify fetchers of struct msghdr and struct mmsghdr
...
* fetch_struct_msghdr.c: New file.
* fetch_struct_mmsghdr.c: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* net.c (struct msghdr32, struct mmsghdr32, copy_from_msghdr32,
fetch_msghdr, fetch_mmsghdr): Remove.
(decode_msghdr, dumpiov_in_msghdr): Use fetch_struct_msghdr instead
of fetch_msghdr.
(decode_mmsghdr): Change msg_len argument to use_msg_len.
Use fetch_struct_mmsghdr instead of fetch_mmsghdr.
Return fetch_struct_mmsghdr's return code.
(decode_mmsg): Rename to decode_mmsgvec. Take addr and len arguments.
Do not print vlen and flags. Check decode_mmsghdr's return code.
Print mmsghdr array using square brackets.
(dumpiov_in_mmsghdr): Use fetch_struct_mmsghdr instead of fetch_mmsghdr.
(SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg)): Use decode_mmsgvec instead
of decode_mmsg. Print vlen and flags.
* tests/mmsg.c (main): Update expected output.
2016-06-27 00:10:58 +00:00
4b38ce956c
net.c: move fallback definition of struct mmsghdr to a separate file.
...
* msghdr.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* net.c: Include it. Move fallback definition of struct mmsghdr there.
* tests/mmsg.c: Include "msghdr.h". Remove fallback definition
of struct mmsghdr.
2016-06-27 00:10:08 +00:00
26f90afc68
net.c: print struct msghdr as a regular structure
...
* net.c (print_msghdr): Print msg_name, msg_namelen, msg_iov,
and msg_iovlen fields like other regular fields.
* tests/inet-cmsg.c (main): Update expected output.
* tests/mmsg.c (main): Likewise.
* tests/recvmsg.c (main): Likewise.
* tests/scm_rights-fd.test: Likewise.
2016-06-26 23:57:39 +00:00
00ba20aae1
net.c: when printing struct msghdr.msg_control, also print its name
...
* net.c (printcmsghdr): Skip control messages of zero length.
Always print "msg_control=" before the control message.
(do_msghdr): Print control message before its length, not after.
* tests/inet-cmsg.c (main): Update expected output.
* tests/scm_rights-fd.test: Likewise.
2016-06-26 23:57:18 +00:00
96b04dc71d
tests: check decoding of sockaddr structures
...
* tests/net-sockaddr.c: New file.
* tests/net-sockaddr.test: New test.
* tests/.gitignore: Add net-sockaddr.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add net-sockaddr.test.
2016-06-25 01:11:18 +00:00
71e05be60a
net.c: fix printing field names of struct sockaddr_nl
...
* net.c (print_sockaddr_data_nl): Change "pid" to "nl_pid", "groups"
to "nl_groups". Print sockaddr_nl.nl_groups using %#08x format.
* tests/net-yy-netlink.c (main): Update.
2016-06-24 01:47:59 +00:00
f52753aad5
net.c: skip details of too short socket addresses
...
* net.c (print_sockaddr): Print socket address details only when
the address size is greater than sizeof(struct sockaddr.sa_family).
(print_sockaddr_data_un): Remove handling of addrlen == 2.
* tests/net-y-unix.c (main): Update expected pattern.
* tests/net-yy-unix.c (main): Likewise.
* tests/net.expected: Likewise.
2016-06-23 01:10:17 +00:00
b5f1fd926a
Assume that libc provides inet_ntop and inet_pton
...
* configure.ac (AC_CHECK_FUNCS): Remove inet_ntop and inet_pton.
* net.c (sockaddr_buf_t, print_sockaddr, print_mreq6): Remove
HAVE_INET_NTOP checks.
* tests/ip_mreq.c: Remove HAVE_INET_PTON check.
2016-06-21 16:44:50 +00:00
e139cbe969
Consistently use AF_UNIX over AF_LOCAL
...
As these constants have the same value 1, let's use and print only one
of them, e.g. AF_UNIX.
* xlat/addrfams.in (AF_LOCAL): Remove.
* tests/net-accept-connect.c (main): Replace AF_LOCAL with AF_UNIX.
* tests/net-y-unix.c: Likewise.
* tests/net-yy-unix.c: Likewise.
* tests/netlink_unix_diag.c: Likewise.
2016-06-20 22:52:49 +00:00
d4bdff69fc
btrfs: fix build with fresh linux/btrfs.h
...
Fix build with fresh <linux/btrfs.h> that provides a slightly different
definition of struct btrfs_ioctl_defrag_range_args.
* btrfs.c (btrfs_ioctl): Cast "len" member of
struct btrfs_ioctl_defrag_range_args to uint64_t.
* tests/btrfs.c (btrfs_print_defrag_range_args): Cast "start" and "len"
members of struct btrfs_ioctl_defrag_range_args to uint64_t.
2016-06-17 01:06:55 +00:00
fe7a451e5a
btrfs: provide fallback definitions for BTRFS_IOC_QUOTA_RESCAN*
...
<linux/btrfs.h> was introduced in linux v3.9-rc1 while some
of btrfs ioctls were added later, e.g. BTRFS_IOC_QUOTA_RESCAN
and BTRFS_IOC_QUOTA_RESCAN_STATUS in v3.10-rc2,
or BTRFS_IOC_QUOTA_RESCAN_WAIT in v3.11-rc1.
* btrfs.c [!BTRFS_IOC_QUOTA_RESCAN]
(struct btrfs_ioctl_quota_rescan_args): New structure.
(BTRFS_IOC_QUOTA_RESCAN, BTRFS_IOC_QUOTA_RESCAN_STATUS): New macros.
[!BTRFS_IOC_QUOTA_RESCAN_WAIT] (BTRFS_IOC_QUOTA_RESCAN_WAIT): New macro.
* tests/btrfs.c: Likewise.
Reported-by: Li Er <phoooyb@gmail.com>
2016-06-17 01:06:55 +00:00
Fei Jie
3fd419f9cd
tests: add signal_receive.test
...
* tests/signal_receive.c: New file.
* tests/signal_receive.test: New test.
* tests/.gitignore: Add signal_receive.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(MISC_TESTS): Add signal_receive.test.
2016-06-16 12:39:56 +00:00
Fei Jie
0d8eaa9c01
tests: add signal2name function to libtests
...
* tests/tests.h (signal2name): New prototype.
* tests/signal2name.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
2016-06-16 12:39:56 +00:00
21e3ff8d46
tests/attach-f-p.c: fix typo in comment
2016-06-14 16:11:09 +00:00
219dfda2a2
tests/ioctl_evdev.c: fix typo in comment
2016-06-14 15:48:32 +00:00
Elvira Khabirova
be06426625
tests/xgetrlimit.c: fix a warning reported by -Wtype-limits
...
* tests/xgetrlimit.c (sprint_rlim): Explicitly cast constants
to the type of argument.
2016-06-14 15:48:25 +00:00
484326dbd8
Consistently use printaddr for printing addresses
...
* bjm.c (SYS_FUNC(init_module)): Use printaddr.
* clone.c (SYS_FUNC(clone)): Likewise.
* evdev.c (ff_effect_ioctl): Likewise.
* mtd.c (decode_mtd_oob_buf): Likewise.
* net.c (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg), SYS_FUNC(getsockopt)):
Likewise.
* print_sigevent.c (print_sigevent): Likewise.
* printsiginfo.c (printsigval, print_si_info): Likewise.
* signal.c (decode_new_sigaction): Likewise.
* sysmips.c (SYS_FUNC(sysmips)): Likewise.
* util.c (printpathn, printstr, umoven_or_printaddr): Likewise.
* v4l2.c (print_v4l2_buffer, print_v4l2_framebuffer,
umoven_or_printaddr_ignore_syserror): Likewise.
* tests/net-icmp_filter.c (main): Update.
Based on patch by Eugene Syromyatnikov <evgsyr@gmail.com>.
2016-06-11 09:26:49 +00:00
87baaec12e
tests/attach-p-cmd-p.c: cleanup
...
* attach-p-cmd-p.c (handler): Move code ...
(main): ... here. Unblock SIGALRM only.
Use alarm() instead of setitimer().
Replace endless loop with a pause() call.
Check that chdir() returns ENOENT.
2016-06-10 14:34:32 +00:00
056e304d04
tests: enhance test coverage of SIGCHLD siginfo_t
...
* tests/siginfo.c: New file.
* tests/siginfo.test: New test.
* tests/wait.c: Remove.
* tests/wait.expected: Remove.
* tests/wait.test: Remove.
* tests/.gitignore: Add siginfo, remove wait.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add siginfo.test, remove wait.test.
(EXTRA_DIST): Remove wait.expected.
2016-06-10 09:56:53 +00:00
176c568a6a
tests: extend test coverage of waitid syscall
...
* tests/waitid.c: New file.
* tests/waitid-v.c: Likewise.
* tests/waitid.test: New test.
* tests/waitid-v.test: Likewise.
* tests/.gitignore: Add waitid and waitid-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add waitid.test and waitid-v.test.
2016-06-10 09:16:10 +00:00
1f68abfed3
tests: extend test coverage of wait4 syscall
...
* tests/wait4.c: New file.
* tests/wait4-v.c: Likewise.
* tests/wait4.test: New test.
* tests/wait4-v.test: Likewise.
* tests/.gitignore: Add wait4 and wait4-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add wait4.test and wait4-v.test.
2016-06-10 09:15:59 +00:00
af0d066dc2
tests: add widen_to_ull macro to tests.h
...
* tests.h (widen_to_ull): New macro, copied from defs.h
2016-06-10 09:14:20 +00:00
e9c1ee9c63
tests: check decoding of waitpid syscall
...
* tests/waitpid.c: New file.
* tests/waitpid.test: New test.
* tests/.gitignore: Add waitpid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add waitpid.test.
2016-06-09 01:29:45 +00:00
Fei Jie
ef9900e7c1
tests: add strace-E.test
...
* tests/strace-E.expected: New file.
* tests/strace-E.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.
(EXTRA_DIST): Add strace-E.expected.
2016-06-09 01:28:33 +00:00
07d9cf589c
tests: remove obsolete strace-f.test
...
strace-f.test is too inexact while fork-f.test does the right thing.
* tests/strace-f.test: Remove.
* tests/Makefile.am (MISC_TESTS): Remove it.
* strace.spec (BuildRequires): Remove time.
2016-06-07 18:16:26 +00:00
b1dbd9e291
tests: always distribute strace-k.test
...
Fix distribution of tests/strace-k.test file when configured
without libunwind.
* tests/Makefile.am (EXTRA_DIST): Add strace-k.test.
2016-06-07 09:32:17 +00:00
4e085d0b46
tests: check decoding of setrlimit, getrlimit, and ugetrlimit syscalls
...
* tests/getrlimit.c: New file.
* tests/setrlimit.c: Likewise.
* tests/ugetrlimit.c: Likewise.
* tests/xgetrlimit.c: Likewise.
* tests/getrlimit.test: New test.
* tests/setrlimit.test: Likewise.
* tests/ugetrlimit.test: Likewise.
* tests/.gitignore: Add getrlimit, setrlimit, and ugetrlimit.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getrlimit.test, setrlimit.test,
and ugetrlimit.test.
(EXTRA_DIST): Add xgetrlimit.c.
2016-06-06 22:06:46 +00:00
b017c09ab3
tests: check decoding of prlimit64 syscall
...
* tests/prlimit64.c: New file.
* tests/prlimit64.test: New test.
* tests/.gitignore: Add prlimit64.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add prlimit64.test.
2016-06-06 21:25:54 +00:00
Elvira Khabirova
f6be7ae12c
tests/ptrace.c: fix fork() return value check
...
* tests/ptrace.c (test_peeksiginfo): Explicitly cast fork() return value
to pid_t.
2016-06-06 18:07:04 +00:00
f56323f1cc
tests/strace-S.test: fix testing 64-bit strace using a 32-bit userspace
...
* tests/strace-S.test: Measure wall clock time instead of system time.
Use local "./readv" instead of system "date" as a sample executable.
Reported-by: Steve McIntyre <steve@einval.com>
2016-06-06 18:07:04 +00:00
53128b6746
tests/strace-S.test: enhance error diagnostics
...
* tests/strace-S.test: If strace output does not meet expectations,
print the output.
2016-06-06 18:07:04 +00:00
124c17ad3c
tests/ioctl_evdev.c: check EVIOCGUNIQ decoding
...
* tests/ioctl_evdev.c (main): Check EVIOCGUNIQ(0) decoding.
2016-05-28 22:13:27 +00:00
bd090efc40
tests/ioctl_mtd.c: fix build with musl
...
* tests/ioctl_mtd.c: Include <linux/ioctl.h>.
2016-05-28 19:55:01 +00:00
129b304c95
tests: check decoding of 'M' type ioctls
...
* tests/ioctl_mtd.c: New file.
* tests/ioctl_mtd.test: New test.
* tests/.gitignore: Add ioctl_mtd.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_mtd.test.
2016-05-28 19:31:50 +00:00
fc0a38612f
tests: check decoding of EVIOC* ioctls
...
* tests/ioctl_evdev.c: New file.
* tests/ioctl_evdev-v.c: Likewise.
* tests/ioctl_evdev.test: New test.
* tests/ioctl_evdev-v.test: Likewise.
* tests/.gitignore: Add ioctl_evdev and ioctl_evdev-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_evdev.test and ioctl_evdev-v.test.
2016-05-28 00:56:47 +00:00
Jeff Mahoney
eb36e38523
file_ioctl.c: print first two extents for FIDEDUPERANGE in abbrev mode
...
* file_ioctl.c (file_ioctl, print_file_dedupe_range_info): Print first
two elements of info array in abbrev mode.
* tests/btrfs.c (btrfs_test_extent_same_ioctl): Handle newly
printed elements.
2016-05-28 00:37:02 +00:00
Jeff Mahoney
826b7978ec
tests: check decoding of btrfs RDWR ioctls returned data
...
* tests/btrfs-vw.test: New file.
* tests/btrfs-w.test: New file.
* tests/Makefile.am (DECODER_TESTS): Add them.
2016-05-27 08:54:32 +00:00
Jeff Mahoney
fd70b501f6
tests/btrfs.c: fix live btrfs_test_search_ioctls output
...
* tests/btrfs.c (btrfs_test_search_ioctls): Use print_tree_search_buf
for BTRFS_IOC_TREE_SEARCH and fix missing whitespace.
2016-05-27 08:54:18 +00:00
Jeff Mahoney
563a758994
tests/btrfs.c: fix btrfs-v for BTRFS_IOC_TREE_SEARCH
...
* tests/btrfs.c (btrfs_test_send_ioctl): Assign key_reference
to search_args for BTRFS_IOC_TREE_SEARCH ioctl tests.
2016-05-26 20:54:46 +00:00
59b140a096
tests/ioctl_block.c: tweak magic constants to make the test more reliable
...
* tests/ioctl_block.c (main): Change bad pointer to make
its lower 32-bit part closer to -1U.
2016-05-26 15:16:31 +00:00
b356ad8abf
tests/btrfs.c: check basic decoding of read-only ioctls
...
* tests/btrfs.c (btrfs_test_read_ioctls): New function.
(main): Use it.
2016-05-26 14:46:37 +00:00
799b22a27d
tests: check decoding of BLK* ioctls
...
* configure.ac (AC_CHECK_TYPES): Add struct blk_user_trace_setup.
* tests/ioctl_block.c: New file.
* tests/ioctl_block.test: New test.
* tests/.gitignore: Add ioctl_block.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_block.test.
2016-05-26 14:44:13 +00:00
ba35137246
tests: check decoding of RTC_* ioctls
...
* configure.ac (AC_CHECK_FUNCS): Add ioctl_rtc.
* tests/ioctl_rtc.c: New file.
* tests/ioctl_rtc-v.c: Likewise.
* tests/ioctl_rtc.test: New test.
* tests/ioctl_rtc-v.test: Likewise.
* tests/.gitignore: Add ioctl_rtc and ioctl_rtc-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_rtc.test and ioctl_rtc-v.test.
2016-05-25 17:58:57 +00:00
f8da0f3e78
tests: check decoding of mount syscall
...
* tests/mount.c: New file.
* tests/mount.test: New test.
* tests/.gitignore: Add mount.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mount.
2016-05-25 00:11:37 +00:00
1ba55355c6
tests/vhangup.c: diassociate from the controlling terminal first
...
* tests/vhangup.c (main): Call setsid before vhangup.
2016-05-24 20:12:25 +00:00