Commit Graph

942 Commits

Author SHA1 Message Date
Gleb Fotengauer-Malinovskiy
e79f038dd9 tests/btrfs.c: fix build on x32
* tests/btrfs.c (btrfs_test_ino_path_ioctls): Fix printing of st_ino.
2016-05-24 15:10:41 +00:00
6697d15f0a tests/btrfs.c: fix build with u64 based BTRFS_IOC_DEFAULT_SUBVOL
* tests/btrfs.c: Fix build on systems where BTRFS_IOC_DEFAULT_SUBVOL
is defined using unexported type "u64".
2016-05-24 14:52:27 +00:00
ea516df85e btrfs.c: fix build on systems without BTRFS_IOC_FILE_EXTENT_SAME
* btrfs.c (btrfs_ioctl): Skip BTRFS_IOC_FILE_EXTENT_SAME case
if this constant is not defined.
* tests/btrfs.c (btrfs_test_extent_same_ioctl): Skip this part
of the test if BTRFS_IOC_FILE_EXTENT_SAME is not defined.
2016-05-24 14:52:27 +00:00
3f36611e98 tests/btrfs.c: fix printing struct btrfs_ioctl_clone_range_args
* tests/btrfs.c (btrfs_test_clone_ioctls): Print __u64 members
of struct btrfs_ioctl_clone_range_args using PRI__u64 format.
2016-05-24 14:52:27 +00:00
57888fa5f9 tests/btrfs.c: tweak magic constants to make the test more reliable
* tests/btrfs.c (btrfs_test_sync_ioctls): Change u64val
to 0xdeadbeefbadc0ded.
(btrfs_test_subvol_ioctls): Likewise.  Change bad_pointer
to make their lower 32-bit parts closer to -1U.
2016-05-24 14:52:27 +00:00
6ce6d3be10 btrfs.c: print file descriptors using printfd
* btrfs.c (btrfs_ioctl): Print struct btrfs_ioctl_send_args.send_fd,
struct btrfs_ioctl_vol_args.fd, and struct btrfs_ioctl_vol_args_v2.fd
using printfd.
* tests/btrfs.c (btrfs_print_vol_args_v2, btrfs_test_subvol_ioctls,
btrfs_test_device_ioctls, btrfs_test_clone_ioctls,
btrfs_test_send_ioctl): Update.
2016-05-24 14:52:27 +00:00
9298c66dc0 tests/btrfs.c: do not print errno in case of fs type mismatch
* tests/btrfs.c (main): Use error_msg_and_fail instead of
perror_msg_and_fail when the fs type of the given directory
is not BTRFS_SUPER_MAGIC.
2016-05-24 14:52:27 +00:00
2447de4ca1 tests/btrfs.c: fix indentation
* tests/btrfs.c: Fix indentation of preprocessor directives
and function prototypes.
2016-05-24 14:52:27 +00:00
28a5f66e2e tests/btrfs.c: sort included headers
* tests/btrfs.c: Sort included headers.
2016-05-24 14:52:27 +00:00
45fcc0c853 tests/btrfs.c: do not use alloca
* tests/btrfs.c: Don't include <alloca.h>.
(btrfs_test_subvol_ioctls): Allocate
struct btrfs_ioctl_vol_args_v2.qgroup_inherit using tail_alloc.
2016-05-24 14:52:27 +00:00
2212918aa2 tests/btrfs.c: fix build on systems without <linux/btrfs.h> or <linux/fiemap.h>
* tests/btrfs.c: Include "tests.h" first.
Skip the test if [!HAVE_LINUX_BTRFS_H].  Skip parts of the test
that use struct fiemap if [!HAVE_LINUX_FIEMAP_H].
2016-05-24 14:52:27 +00:00
Jeff Mahoney
3586679f7a tests: add testing for btrfs ioctls
* tests/btrfs.c: New file.
* tests/btrfs.test: New test.
* tests/btrfs-v.test: Likewise.
* tests/.gitignore: Add btrfs.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add btrfs.test and btrfs-v.test.
2016-05-24 14:52:27 +00:00
aab00c2023 tests/file_ioctl.c: use tail_alloc
* tests/file_ioctl.c (main): Allocate struct fiemap using tail_alloc.
2016-05-24 14:52:27 +00:00
3b730d4a0f tests/file_ioctl.c: fix build on systems without <linux/fiemap.h>
* tests/file_ioctl.c: Include "tests.h" first.
Skip the test if [!HAVE_LINUX_FIEMAP_H].
2016-05-24 14:52:27 +00:00
Jeff Mahoney
c05c24cc51 tests: add testing for FS_IOC_FIEMAP
This is limited to FIEMAP.  FICLONE* and FIDEDUPERANGE originated in
btrfs and will be tested there.

* tests/file_ioctl.c: New file.
* tests/file_ioctl.test: New test.
* tests/.gitignore: Add file_ioctl.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add file_ioctl.test.
2016-05-24 14:52:27 +00:00
9b49af1871 tests/attach-f-p.c: sleep a bit more to let the tracer catch up
On noticeably lagging systems, the parent process may invoke its chdir
call before the tracer gets notified about completion of its last child
process.  Add extra sleep in the parent process to win the race.

* tests/attach-f-p.c (main): Change timerid into a static array.
Arm a timer in the parent process and wait for it.
2016-05-24 12:14:33 +00:00
475d2b5da6 tests/attach-p-cmd-cmd.c: fix potential errno clobbering
* tests/attach-p-cmd-cmd.c (main): Call getpid before chdir.
2016-05-23 16:39:23 +00:00
4ea65fb549 tests/net-yy-netlink.c: robustify against libc specific issues
* tests/net-yy-netlink.c (main): Use getsockname instead of recvmsg
as the latter has notible implementation differences that make
the test unreliable.
2016-05-23 10:26:46 +00:00
29df0351a9 tests/net-yy-netlink.c: robustify against os specific issues
* tests/net-yy-netlink.c (main): Pass a pointer to a real struct msghdr
as NULL doesn't work well on some systems.
2016-05-23 10:26:46 +00:00
1e9dabee66 tests/net-yy-{inet,netlink}.test: cleanup
* tests/net-yy-inet.test: Do not pass arguments to net-yy-inet
as the latter does not accept them.
* tests/net-yy-netlink.test: Do not pass arguments to net-yy-netlink
as the latter does not accept them.
2016-05-23 10:14:39 +00:00
Jeff Mahoney
f21a2f4119 tests: define PRI__[dux]64 macros to print __s64 and __u64 values
Rather than cast every __u64 or __s64 before printing,
define printing helpers for those types directly.

This complements commit 1f3482beda.

* tests/tests.h (PRI__d64, PRI__u64, PRI__x64): New macros.
2016-05-22 22:54:23 +00:00
62a35fa572 tests: remove manual creation of memory mapping holes
We used to call tail_alloc(1) to create memory mapping holes around
regular tail_alloc allocations.  This is no longer needed since regular
tail_alloc allocations create additional memory mapping holes.

* tests/clock_adjtime.c (main): Remove creation of memory mapping holes
using tail_alloc(1).
* tests/futimesat.c (main): Likewise.
* tests/get_mempolicy.c (print_nodes, main): Likewise.
* tests/getgroups.c (main): Likewise.
* tests/getresugid.c (main): Likewise.
* tests/ioctl_uffdio.c (main): Likewise.
* tests/ioctl_v4l2.c (main): Likewise.
* tests/move_pages.c (main): Likewise.
* tests/net-icmp_filter.c (main): Likewise.
* tests/ptrace.c (test_peeksiginfo, main): Likewise.
* tests/pwritev.c (main): Likewise.
* tests/set_mempolicy.c (print_nodes): Likewise.
* tests/setgroups.c (main): Likewise.
* tests/umovestr3.c (main): Likewise.
* tests/utimes.c (main): Likewise.
* tests/xattr.c (main): Likewise.
2016-05-22 22:29:33 +00:00
0f303f99c6 tests: make tail_alloc create additional memory mapping holes
* tests/tail_alloc.c (tail_alloc): Create additional memory mapping
holes before and after the allocated memory.
2016-05-22 22:21:48 +00:00
7b6979701b Fix one more code pattern that might break gcc strict aliasing rules
* socketutils.c (receive_responses): Turn static buffer into a union
to avoid breaking of gcc strict aliasing rules.
* tests/netlink_inet_diag.c (check_responses): Likewise.
* tests/netlink_netlink_diag.c (check_responses): Likewise.
* tests/netlink_unix_diag.c (check_responses): Likewise.
2016-05-21 09:33:12 +00:00
Fabien Siron
28e955d747 tests: add check for netlink protocol decoding with -yy option
* tests/netlink_netlink_diag.c: New file.
* tests/net-yy-netlink.c: New file.
* tests/net-yy-netlink.test: New test.
* tests/.gitignore: Add net-yy-netlink and netlink_netlink_diag
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Add net-yy-netlink.test.
2016-05-21 09:32:52 +00:00
ff2b853e7f tests/pread64-pwrite64.c: robustify against os specific issues
Do not assume that pwrite64 syscall fails when only part of the
specified memory buffer is accessible.  With some kernels, one
accessible byte at the end of page is enough for pwrite64 syscall
to return 1.

* tests/pread64-pwrite64.c (main): Tweak the test that can lead
to a partial write.
2016-05-18 09:26:01 +00:00
a8e820586e tests/read-write.c: robustify against os specific issues
Do not assume that write syscall fails when only part of the specified
memory buffer is accessible.  With some kernels, one accessible byte
at the end of page is enough for write syscall to return 1.

* tests/read-write.c (main): Tweak the test that can lead to a partial
write.
2016-05-18 09:26:01 +00:00
af09d4f4fa umovestr3.test: extend test coverage
* tests/umovestr3.c: Include <sys/param.h>.
(main): Test with each number between PATH_MAX-1 and 0.
2016-05-18 09:26:01 +00:00
81f1b1689a tests/timer_create.c: robustify against os specific issues
* tests/timer_create.c (main): Do not assume any specific error code
returned by timer_create, print whatever it is.
2016-05-18 09:26:01 +00:00
e0ba92016b Fix some compilation warnings on older systems
* print_statfs.c (print_statfs_flags): Define only
for [HAVE_STRUCT_STATFS_F_FLAGS || HAVE_STRUCT_STATFS64_F_FLAGS].
* tests/inet-cmsg.c (print_origdstaddr): Define only
for [IP_ORIGDSTADDR].
2016-05-18 09:26:01 +00:00
Fei Jie
854a25930c tests: add brk.test
* tests/brk.c: New file.
* tests/brk.test: New test.
* tests/.gitignore: Add brk.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add brk.test.
2016-05-17 10:53:03 +00:00
c5f6863a18 Fix printing of invalid arguments of prctl syscall
* prctl.c (SYS_FUNC(prctl)): Print 2nd syscall argument
of PR_CAPBSET_DROP, PR_CAPBSET_READ, PR_CAP_AMBIENT, PR_MCE_KILL,
and PR_SET_SECCOMP using printxval_long.
Print 2nd syscall argument of PR_SET_SECUREBITS using printflags_long.
Print 3rd syscall argument of PR_CAP_AMBIENT and PR_MCE_KILL using
printxval_long.
* tests/prctl-seccomp-strict.c (main): Update.
2016-05-16 23:50:59 +00:00
3a0fa5c619 Fix printing of invalid mode argument of mbind syscall
* numa.c (SYS_FUNC(mbind)): Print 3rd argument of syscall
using printxval_long.
* tests/mbind.c (main): Update.
2016-05-16 23:48:05 +00:00
1168114879 Fix printing of invalid arguments of memory mapping related syscalls
* mem.c (print_mmap): Print 3rd and 4th arguments of syscall
using printflags_long.
(SYS_FUNC(mprotect)): Print 3rd argument of syscall using
printflags_long.
(SYS_FUNC(mremap)): Print 4th argument of syscall using printflags_long.
(SYS_FUNC(remap_file_pages)): Print 3rd and 4th arguments of syscall
using printflags_long.
* tests/remap_file_pages.c (main): Update.
2016-05-16 23:47:34 +00:00
55044d9670 Fix decoding of epoll_ctl operation argument
Consistently treat operation argument of epoll_ctl syscall as int
to match the kernel behaviour.

* epoll.c (SYS_FUNC(epoll_ctl)): Assign 2nd argument of syscall
to a variable of type unsigned int and use it in all subsequent
checks and lookups.
* tests/epoll_ctl.c (invoke_syscall): New function.
(main): Use it.
2016-05-16 21:47:09 +00:00
77086594ce Fix decoding of fcntl/fcntl64 operation argument
Consistently treat operation argument of fcntl/fcntl64 syscalls as int
to match the kernel behaviour.

* fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Assign
2nd argument of syscall to a variable of type unsigned int
and use it in all subsequent checks and lookups.
* tests/struct_flock.c (invoke_test_syscall): New function.
(test_flock_einval, test_flock): Use it.
* tests/fcntl.c (test_flock64_einval): Use it.
* tests/fcntl64.c (test_flock64_einval, test_flock64): Use it.
2016-05-16 21:46:48 +00:00
602998be62 tests/ptrace.c: tweak magic constants to make the test more reliable
* tests/ptrace.c (main): Change bad_request and bad_data to make they
lower 32-bit parts closer to -1U.
2016-05-13 09:37:10 +00:00
98f632a14c tests/ioctl_v4l2.c: fix build on older systems
Fix build on systems without HAVE_DECL_V4L2_CTRL_TYPE_STRING or
V4L2_CTRL_CLASS_CAMERA.

* tests/ioctl_v4l2.c (main) [VIDIOC_S_EXT_CTRLS]: Disable part of the
test if [!HAVE_DECL_V4L2_CTRL_TYPE_STRING].
Replace V4L2_CTRL_CLASS_CAMERA with V4L2_CTRL_CLASS_USER.
2016-05-13 05:18:42 +00:00
f2f162e89c Do not use htole32 function
htole32 function is not portable enough.

* v4l2.c (print_pixelformat): Rewrite initialization of pixel format
union without using of htole32.
* tests/ioctl_v4l2.c (main): Likewise.
2016-05-13 05:18:42 +00:00
09de43b39d tests/ioctl_v4l2.c: fix typo
* tests/ioctl_v4l2.c (main)
[!HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE]: Fix typo in expected
output string.
2016-05-13 05:18:42 +00:00
632efff900 tests: check decoding of ptrace syscall
* tests/ptrace.c: New file.
* tests/ptrace.test: New test.
* tests/.gitignore: Add ptrace.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ptrace.
2016-05-13 05:18:41 +00:00
Fei Jie
01d16ccb96 tests: add munlockall.test
* tests/munlockall.c: New file.
* tests/munlockall.test: New test.
* tests/.gitignore: Add munlockall.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add munlockall.test.
2016-05-11 12:26:00 +00:00
Fei Jie
0684c35c25 tests: add link.test
* tests/link.c: New file.
* tests/link.test: New test.
* tests/.gitignore: Add link.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add link.test.
2016-05-11 12:26:00 +00:00
d81b58f650 tests: check decoding and dumping of preadv2 and pwritev2 syscalls
* tests/preadv2-pwritev2.c: New file.
* tests/preadv2-pwritev2.test: New test.
* tests/.gitignore: Add preadv2-pwritev2.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add preadv2-pwritev2.
2016-05-11 01:54:12 +00:00
ea7b9dbcbd tests: extend test coverage of xattr family syscalls
* tests/xattr.c: Check decoding of all xattr family syscalls.
* tests/xattr.test: Use run_strace_match_diff.
* tests/xattr.expected: Remove.
* tests/Makefile.am (EXTRA_DIST): Remove it.
2016-05-10 22:25:23 +00:00
72cb81151f tests: add print_quoted_memory function to libtests
* tests/print_quoted_string.c (print_quoted_memory): New function.
(print_quoted_string): Use it.
* tests/tests.h (print_quoted_memory): New prototype.
2016-05-10 22:12:01 +00:00
Dr. David Alan Gilbert
0efd888e22 userfaultfd: Add ioctl tests
* tests/ioctl_uffdio.c: New file.
* tests/ioctl_uffdio.test: New test.
* tests/.gitignore: Add ioctl_uffdio.
* tests/Makefile.am (check_PROGRAMS):  Likewise.
(DECODER_TESTS): Add ioctl_uffdio.test.
2016-05-10 11:00:12 +00:00
26b2cfeb6b strace-ff.test: fix race condition
* tests/strace-ff.test: Wait for completion of PR_SET_PTRACER command.
2016-05-10 09:51:04 +00:00
d12c44bcac tests/epoll_pwait.c: fix for x32
* tests/epoll_pwait.c (main): Explicitly cast last syscall argument
to kernel_ulong_t.
2016-05-10 01:37:46 +00:00
a44c5184f9 strace-S.test: check "-S name"
* tests/strace-S.test: Add a check for "-c -S name" output.
2016-05-10 00:39:17 +00:00
804bb8797b strace-S.test: cleanup
* tests/strace-S.test: Rewrite using sed.
2016-05-10 00:38:52 +00:00
Fei Jie
6781111857 tests: add strace-S.test
* tests/strace-S.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.
2016-05-09 23:33:32 +00:00
58ab8b49e0 strace-ff.test: check that -ff does not create unexpected output files
* tests/strace-ff.expected: New file.
* tests/Makefile.am (EXTRA_DIST): Add it.
* tests/strace-ff.test: Use it.  Check that no other output files
have been created.
2016-05-09 23:21:30 +00:00
Fei Jie
c259f4fd5d tests: add strace-ff.test
* tests/strace-ff.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.
2016-05-09 23:21:20 +00:00
a30d02e902 strace-V.test: cleanup
* tests/strace-V.test: Move config.h parser to a function.
Rename $OUT to $EXP, swap arguments passed to match_diff.
2016-05-09 23:19:37 +00:00
Fei Jie
c4bb57745a tests: add strace-V.test
* tests/strace-V.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.
2016-05-09 23:18:40 +00:00
e3086cbc4d tests: check decoding of epoll_pwait syscall
* tests/epoll_pwait.c: New file.
* tests/epoll_pwait.test: New test.
* tests/.gitignore: Add epoll_pwait.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add epoll_pwait.test.
2016-05-09 22:12:57 +00:00
6d44012cb5 Assume that sys/epoll.h exists
This header file was added in glibc-2.3.2,
so it's safe to assume its availability.

* configure.ac (AC_CHECK_HEADERS): Remove sys/epoll.h.
* epoll.c: Include <sys/epoll.h> unconditionally.
Compile [HAVE_SYS_EPOLL_H] code unconditionally.
* tests/epoll_ctl.c: Do not check for HAVE_SYS_EPOLL_H.
* tests/epoll_wait.c: Likewise.
2016-05-09 21:46:17 +00:00
b6d4b1167b tests: relax timings
Allow nanosleep(2) to spend 10% more time to make the test suite
more reliable on slow systems.

* tests/count.test: Treat 1.1 seconds as valid output.
* tests/strace-T.expected: Likewise.
* tests/strace-r.expected: Likewise.
2016-05-08 00:00:18 +00:00
88fc4c23d4 tests/attach-f-p.c: increase timeouts
Increase timeouts to make the test more reliable on slow systems.

* tests/attach-f-p.c (its): Increase timeouts to 1, 2, and 3 seconds,
respectively.
2016-05-07 23:51:47 +00:00
f82dcd980d seccomp.c: use print_array function
* seccomp.c (decode_filter, decode_seccomp_fprog): Remove.
(print_bpf_filter): New function.
(print_seccomp_fprog): Use it via print_array.
* tests/seccomp-filter-v.c (main): Update.
2016-05-07 23:37:53 +00:00
fd2d6a7f52 poll.c: use print_array function
* poll.c (print_pollfd): Change for use as print_array callback.
(decode_poll_entering): Use print_array.
* tests/poll.c: Update.
* tests/poll.test: Update.
2016-05-07 23:37:53 +00:00
636b8c161c numa.c: use print_array function
* numa.c (print_node): New function.
(print_nodemask): Use it via print_array.
(print_page_array, print_int_array): Remove.
(print_addr): New function.
(print_status, print_int): Change for use as print_array callback.
(SYS_FUNC(move_pages)): Use print_addr, print_int, and print_status
via print_array.
* tests/move_pages.c: Update.
* tests/set_mempolicy.c: Likewise.
* tests/set_mempolicy.test: Likewise.
2016-05-07 23:37:52 +00:00
4ce3054340 io.c: use print_array function
* io.c (print_iovec_config): New structure.
(print_iovec): New function.
(tprint_iov_upto): Use print_array.
* tests/preadv.c (main): Update.
* tests/pwritev.c (print_iovec, main): Likewise.
2016-05-07 23:32:29 +00:00
2868e2b941 aio.c: use print_array function
* aio.c (print_iocbp): New function.
(SYS_FUNC(io_submit)): Use it via print_array.  Use widen_to_long
to process long int argument.
(print_io_event): Change to print struct io_event fetched elsewhere.
(SYS_FUNC(io_cancel)): Update use of print_io_event.
(SYS_FUNC(io_getevents)): Use print_io_event via print_array.
Use widen_to_long to print long int arguments.
* tests/aio.c (main): Check decoding of io_submit with negative "nr".
2016-05-07 22:40:06 +00:00
eb5c233d99 Fix corner cases of ICMP_FILTER decoding
* net.c (print_icmp_filter): Print icmp_filter for any positive length.
* tests/net-icmp_filter.c: New file.
* tests/net-icmp_filter.test: New test.
* tests/.gitignore: Add net-icmp_filter.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add net-icmp_filter.test.
2016-05-06 00:22:52 +00:00
1d17ac7c32 xlat: do not strip "1<<" prefix from xlat strings
* xlat/gen.sh (cond_xlat, gen_header): Do not strip "1<<" prefix
from xlat strings to fix incorrect output.
* tests/caps.awk: Update.

Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2016-05-05 22:20:40 +00:00
dcb18a6fd5 tests/xstatfsx.c: fix mips o32 support
mips o32 differs from all other 32-bit architectures by defining
__kernel_fsid_t structure as an array of long ints.

* tests/xstatfsx.c (print_statfs): Explicitly cast elements
of PRINT_F_FSID array to unsigned int.
2016-05-05 21:20:58 +00:00
1e56814f77 Mpersify VIDIOC_* ioctl parser
* v4l2.c: Mpersify arch-specific structures.
(v4l2_ioctl): Mpersify.
* tests/ioctl_v4l2.c: New file.
* tests/ioctl_v4l2.test: New test.
* tests/.gitignore: Add ioctl_v4l2.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_v4l2.test.
2016-05-05 21:20:56 +00:00
0a47ff79ca Fix decoding of VIDIOC_* ioctls
* v4l2.c: Fix numerous bugs in decoding of VIDIOC_* ioctls.
* tests/ioctl.c (main): Update.
2016-05-05 21:20:45 +00:00
6331fd4b32 nsyscalls.test: add mips o32 support
Out-of-range syscalls looks differently on mips o32.

* tests/nsyscalls.c (main): Handle LINUX_MIPSO32.
* tests/nsyscalls.test: Trace syscall called "syscall" on mips.
2016-05-05 18:04:33 +00:00
e212a15955 Fix decoding of move_pages syscall
* numa.c (print_page_array, print_status, print_int, print_int_array):
New functions.
(SYS_FUNC(move_pages)): Rewrite using these functions.
* tests/move_pages.c: New file.
* tests/move_pages.test: New test.
* tests/.gitignore: Add move_pages.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add move_pages.test.
2016-04-29 18:21:02 +00:00
900a282d36 tests: check decoding of mbind syscall
* tests/mbind.c: New file.
* tests/mbind.test: New test.
* tests/.gitignore: Add mbind.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mbind.test.
2016-04-29 18:21:01 +00:00
909e664a2e tests/remap_file_pages.c: fix for the upcoming change of xlat.val type
The "flags" argument of remap_file_page syscall has type "unsigned
long", so it is not correct to load most significant bits with garbage
ans assume they are going to be ignored.

* tests/remap_file_pages.c (main): Remove artificial garbage from flags.
2016-04-28 21:14:54 +00:00
38ed916d1b tests: check decoding of migrate_pages syscall
* tests/migrate_pages.c: New file.
* tests/migrate_pages.test: New test.
* tests/.gitignore: Add migrate_pages.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add migrate_pages.test.
2016-04-28 01:20:19 +00:00
d10a95548c tests: check decoding of set_mempolicy syscall
* tests/set_mempolicy.c: New file.
* tests/set_mempolicy.test: New test.
* tests/.gitignore: Add set_mempolicy.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add set_mempolicy.test.
2016-04-28 01:17:39 +00:00
aa1ed760c8 tests: check decoding of get_mempolicy syscall
* tests/get_mempolicy.c: New file.
* tests/get_mempolicy.test: New test.
* tests/.gitignore: Add get_mempolicy.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add get_mempolicy.test.
2016-04-28 01:17:39 +00:00
a182d8c6c1 tests: add printxval function to libtests
* tests/tests.h (printxval): New prototype.
* tests/printxval.c: New file.
* tests/Makefile.am  (libtests_a_SOURCES): Add it.
2016-04-27 20:31:34 +00:00
d6c76f3a37 tests: check decoding of remap_file_pages syscall
* tests/remap_file_pages.c: New file.
* tests/remap_file_pages.test: New test.
* tests/.gitignore: Add remap_file_pages.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add remap_file_pages.test.
2016-04-27 16:04:01 +00:00
Fei Jie
649ee4b370 tests: add pause.test
* tests/pause.c: New file.
* tests/pause.test: New test.
* tests/.gitignore: Add pause.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add pause.test.
2016-04-27 14:22:22 +00:00
Fei Jie
7585ccdcab tests: add kill.test
* tests/kill.c: New file.
* tests/kill.test: New test.
* tests/.gitignore: Add kill.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add kill.test.
2016-04-27 14:22:02 +00:00
Fei Jie
b45a1e78e3 tests: add mlock.test
* tests/mlock.c: New file.
* tests/mlock.test: New test.
* tests/.gitignore: Add mlock.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mlock.test.
2016-04-27 11:11:12 +00:00
db34e195bb tests/umovestr3.c: robustify against os specific issues
* tests/umovestr3.c (main): Create extra gap before unreadable page.
2016-04-27 03:18:44 +00:00
12890ffda1 tests: extend test coverage of umovestr short read condition
* tests/umovestr3.c: New file.
* tests/umovestr3.test: New test.
* tests/.gitignore: Add umovestr3.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add umovestr3.test.
2016-04-27 01:32:21 +00:00
1c61f829e4 tests: check decoding of out-of-range syscalls
* tests/nsyscalls.c: New file.
* tests/nsyscalls.test: New test.
* tests/.gitignore: Add nsyscalls.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add nsyscalls.test.
2016-04-27 01:32:20 +00:00
f443fd40cb Fix decoding of 3rd argument of getdents/getdents64 syscalls
* dirent.c (SYS_FUNC(getdents)): Always print 3rd syscall argument
as unsigned int.
* dirent64.c (SYS_FUNC(getdents64)): Likewise.
* tests/getdents.c (main): Check it.
* tests/getdents64.c (main): Likewise.
2016-04-26 22:38:10 +00:00
f41eaebddf tests: check decoding of renameat2 syscall
* tests/renameat2.c: New file.
* tests/renameat2.test: New test.
* tests/.gitignore: Add renameat2.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add renameat2.test.
2016-04-26 16:30:43 +00:00
33fc2e4757 tests: check decoding of utimes syscall
* tests/utimes.c: New file.
* tests/utimes.test: New test.
* tests/.gitignore: Add utimes.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add utimes.test.
2016-04-26 16:13:17 +00:00
4e9269aebc tests: check decoding of futimesat syscall
* tests/futimesat.c: New file.
* tests/futimesat.test: New test.
* tests/.gitignore: Add futimesat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add futimesat.test.
2016-04-26 16:13:15 +00:00
7dad3f3edd tests: extend test coverage of mknod syscall
* mknod.c (main): Check more corner cases of mode_t parser.
* mknod.test: Update.
2016-04-26 11:00:51 +00:00
Fei Jie
68b1d24e59 tests: add sched_yield.test
* tests/sched_yield.c: New file.
* tests/sched_yield.test: New test.
* tests/.gitignore: Add sched_yield.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sched_yield.test.
2016-04-26 10:31:11 +00:00
Fei Jie
86ff93e527 tests: add sync.test
* tests/sync.c: New file.
* tests/sync.test: New test.
* tests/.gitignore: Add sync.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sync.test.
2016-04-26 10:29:58 +00:00
Fei Jie
63be9e318c tests: add mknodat.test
* tests/mknodat.c: New file.
* tests/mknodat.test: New test.
* tests/.gitignore: Add mknodat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mknodat.test.
2016-04-26 10:11:41 +00:00
Fei Jie
363b71d281 tests: add unlink.test
* tests/unlink.c: New file.
* tests/unlink.test: New test.
* tests/.gitignore: Add unlink.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add unlink.test.
2016-04-26 10:11:41 +00:00
Fei Jie
68d171d133 tests: add reboot.test
* tests/reboot.c: New file.
* tests/reboot.test: New test.
* tests/.gitignore: Add reboot.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add reboot.test.
2016-04-26 10:11:41 +00:00
67c2f67410 Fix decoding of statfs family syscalls
Fix decoders of fstatfs, fstatfs64, statfs, and statfs64 syscalls
by rewriting them using mpers infrastructure.

* fetch_struct_statfs.c: New file.
* fstatfs.c: Likewise.
* fstatfs64.c: Likewise.
* print_statfs.c: Likewise.
* statfs.h: Likewise.
* statfs64.c: Likewise.
* statfs.c: Remove everything except SYS_FUNC(statfs).
* configure.ac: Remove the check for struct statfs64 in <sys/vfs.h>.
Add checks for struct statfs and struct statfs64 in <asm/statfs.h>.
Add checks for f_frsize and f_flags members of these structures.
* defs.h (struct strace_statfs): New forward declaration.
(print_struct_statfs, print_struct_statfs64): New prototypes.
* Makefile.am (libstrace_a_SOURCES): Add fstatfs.c, fstatfs64.c,
statfs.c, and statfs64.c.
(strace_SOURCES): Add fetch_struct_statfs.c, print_statfs.c,
and statfs.h.
* NEWS: Mention this fix.
* tests/fstatfs.c: New file.
* tests/fstatfs64.c: Likewise.
* tests/statfs64.c: Likewise.
* tests/xstatfs.c: Likewise.
* tests/xstatfs64.c: Likewise.
* tests/xstatfsx.c: Likewise.
* tests/fstatfs.test: New test.
* tests/fstatfs64.test: Likewise.
* tests/statfs64.test: Likewise.
* tests/statfs.c: Rewrite using xstatfs.c.
* tests/statfs.test: Update.
* tests/.gitignore: Add fstatfs, fstatfs64, and statfs64.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add  fstatfs.test, fstatfs64.test, and statfs64.test.
(EXTRA_DIST): Add xstatfs.c, xstatfs64.c, and xstatfsx.c.
2016-04-26 01:35:31 +00:00
121e1961d7 tests: add printflags function to libtests
* tests/printflags.c: New file.
* tests/tests.h (printflags): New prototype.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
2016-04-26 00:13:47 +00:00
f3ac12990d statfs: print f_flags field only when ST_VALID flag is set
* statfs.c (print_statfs_flags): New function.
(printstatfs, printstatfs64, printcompat_statfs64): Use it.
* xlat/statfs_flags.in (ST_VALID): Move to the head of the list.
* tests/statfs.expected: Update.
2016-04-25 10:30:03 +00:00
Fei Jie
13c1d0899d tests: add symlink.test
* tests/symlink.c: New file.
* tests/symlink.test: New test.
* tests/.gitignore: Add symlink.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add symlink.test.
2016-04-25 10:24:48 +00:00
Fei Jie
506a42f8c3 tests: add rmdir.test
* tests/rmdir.c: New file.
* tests/rmdir.test: New test.
* tests/.gitignore: Add rmdir.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add rmdir.test.
2016-04-25 10:24:12 +00:00
Fei Jie
7f05113624 tests: add setdomainname.test
* tests/setdomainname.c: New file.
* tests/setdomainname.test: New test.
* tests/.gitignore: Add setdomainname.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setdomainname.test.
2016-04-25 10:24:12 +00:00
Fei Jie
cd61c9f3e4 tests: add sched_rr_get_interval.test
* tests/sched_rr_get_interval.c: New file.
* tests/sched_rr_get_interval.test: New test.
* tests/.gitignore: Add sched_rr_get_interval.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sched_rr_get_interval.test.
2016-04-25 10:24:12 +00:00
b4a478dbfa statfs: decode f_flags field of struct statfs
* xlat/statfs_flags.in: New file.
* statfs.c: Include "xlat/statfs_flags.h".
(printstatfs) [_STATFS_F_FLAGS]: Print statbuf.f_flags as flags.
(printstatfs64) [_STATFS_F_FLAGS]: Likewise.
(printcompat_statfs64): Likewise.
* tests/statfs.expected: Update.
2016-04-25 01:58:25 +00:00
Zev Weiss
b587a5a1be statfs: don't quote f_type macro names
* statfs.c (sprintfstype): Don't add double-quotes to fs magic macros.
* tests/statfs.expected: Remove double-quotes.
2016-04-25 01:54:05 +00:00
6c69ed7ac5 tests/shmxt.c: robustify against arch specific issues
Do not treat failed shmat(SHM_RND) as a test failure.
This change partially reverts commit
bea707377d.

* tests/shmxt.c (main): Use SHM_RND in the second shmat call,
do not treat its potential error as a test failure.
2016-04-25 01:54:05 +00:00
3db07f11c8 Fix old_mmap output when mmap arguments are unfetchable
* mem.c (SYS_FUNC(old_mmap)): Use umove_or_printaddr instead of umoven
to fetch mmap arguments, return RVAL_DECODED when umove_or_printaddr
fails.
* tests/old_mmap.c (main): Check it.
2016-04-23 00:07:14 +00:00
3797d10e82 tests: extend test coverage of mmap syscall
Check decoding of "old mmap" edition of mmap syscall
on those architectures that define it.

* tests/old_mmap.c: New file.
* tests/old_mmap.test: New test.
* tests/.gitignore: Add old_mmap.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add old_mmap.test.
2016-04-22 23:28:23 +00:00
0e6cb1740a tests: extend test coverage of mincore syscall
* tests/mincore.c (print_mincore): New function.
(test_mincore): Use it.  Check mincore with invalid vec address.
Check mincore with length argument not a multiple of the page size.
(main): Check with DEFAULT_STRLEN pages.
2016-04-22 14:14:39 +00:00
a9540e72c7 tests: check decoding of clock_adjtime syscall
* tests/clock_adjtime.c: New file.
* tests/clock_adjtime.test: New test.
* tests/.gitignore: Add clock_adjtime.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add clock_adjtime.test.
2016-04-22 01:13:27 +00:00
fa5e5d9854 tests: do not include <assert.h> unnecessarily
Automatically change tests/*.c files using the following script:

for f in tests/*.c; do
	grep -q '\<assert(' "$f" ||
		sed -i '/# *include *<assert\.h>/d' "$f"
done
2016-04-21 22:05:57 +00:00
96a9ff5746 tests: do not include <errno.h> unnecessarily
Automatically change tests/*.c files using the following script:

for f in tests/*.c; do
	grep -Fv errno.h "$f" |
	grep -Ewq '(si_)?errno|SOCK_FILTER_DENY_SYSCALL' ||
		sed -i '/# *include *<errno\.h>/d' "$f"
done
2016-04-21 22:05:57 +00:00
e5297aeb13 tests/xetpriority.c: print syscall() result using %ld format 2016-04-21 22:05:57 +00:00
8141093cd0 tests/xetpgid.c: print syscall() result using %ld format 2016-04-21 22:05:57 +00:00
556179345b tests/xchownx.c: use errno2name 2016-04-21 22:05:57 +00:00
92288b2ba3 tests/userfaultfd.c: stop using assert 2016-04-21 22:05:56 +00:00
5d8c235110 tests/unlinkat.c: print syscall() result using %ld format 2016-04-21 22:05:56 +00:00
0df647673a tests/umount.c: use errno2name 2016-04-21 22:05:56 +00:00
ae4ba89702 tests/truncate64.c: cleanup
* tests/truncate64.c (main): Use errno2name, stop using assert.
2016-04-21 22:05:56 +00:00
2eec1ce820 tests/truncate.c: cleanup
* tests/truncate.c (main): Use errno2name, stop using assert.
2016-04-21 22:05:56 +00:00
7456b6420b tests/tee.c: stop using assert 2016-04-21 22:05:56 +00:00
86a090120a tests/syslog.c: use errno2name 2016-04-21 22:05:56 +00:00
82dd238b84 tests/sync_file_range2.c: stop using assert 2016-04-21 22:05:56 +00:00
3694b0c5bd tests/sync_file_range.c: stop using assert 2016-04-21 22:05:56 +00:00
5bc585ecc8 tests/symlinkat.c: cleanup 2016-04-21 22:05:56 +00:00
f75e034c84 tests/swap.c: cleanup
* tests/swap.c (error_msg): Remove.
(main): Use errno2name.
2016-04-21 22:05:56 +00:00
f5748b006f tests/splice.c: stop using assert 2016-04-21 22:05:56 +00:00
0b52ac3134 tests/setugid.c: cleanup 2016-04-21 22:05:56 +00:00
60b9187a7c tests/sethostname.c: use errno2name 2016-04-21 22:05:56 +00:00
b255f6e186 tests/setgroups.c: use errno2name
* tests/setgroups.c (errno2str): Remove.
(main): Use errno2name.
2016-04-21 22:05:56 +00:00
4483f628ab tests/seccomp-strict.c: cleanup
* tests/seccomp-strict.c (main): Use errno2name, stop using assert.
2016-04-21 22:05:56 +00:00
14fa74f9aa tests/seccomp-filter.c: cleanup
* tests/seccomp-filter.c (main): Use errno2name, stop using assert.
2016-04-21 22:05:56 +00:00
06c2828ee1 tests/sched_xetscheduler.c: print syscall() result using %ld format 2016-04-21 22:05:56 +00:00
61042d491b tests/sched_xetparam.c: print syscall() result using %ld format 2016-04-21 22:05:56 +00:00
3f470d83de tests/renameat.c: print syscall() result using %ld format 2016-04-21 22:05:56 +00:00
f224909546 tests/rename.c: print syscall() result using %ld format 2016-04-21 22:05:56 +00:00
92e3cca998 tests/readv.c: cleanup 2016-04-21 22:05:56 +00:00
304689e4ec tests/pwritev.c: use errno2name 2016-04-21 22:05:56 +00:00
cf1cfe13be tests/preadv-pwritev.c: cleanup 2016-04-21 22:05:56 +00:00
abde241e68 tests/prctl-seccomp-strict.c: cleanup
* tests/prctl-seccomp-strict.c (main): Use errno2name,
stop using assert.
2016-04-21 22:05:55 +00:00
037ab86e9a tests/openat.c: use errno2name 2016-04-21 22:05:55 +00:00
1e2f5f7733 tests/open.c: use errno2name 2016-04-21 22:05:55 +00:00
84aeea7e29 tests/mlockall.c: cleanup 2016-04-21 22:05:55 +00:00
c0b1d6f37c tests/mlock2.c: stop using assert 2016-04-21 22:05:55 +00:00
d0652a40eb tests/mknod.c: print syscall() result using %ld format 2016-04-21 22:05:55 +00:00
a175bfe445 tests/mkdirat.c: print syscall() result using %ld format 2016-04-21 22:05:55 +00:00
1b511d0fea tests/lseek.c: cleanup
* tests/lseek.c (main): Use errno2name, stop using assert.
2016-04-21 22:05:55 +00:00
cd157776bd tests/llseek.c: cleanup
* tests/llseek.c (main): Use errno2name, stop using assert.
2016-04-21 22:05:55 +00:00
5c62af0753 tests/linkat.c: print syscall() result using %ld format 2016-04-21 22:05:55 +00:00
33e0df7074 tests/iopl.c: use errno2name 2016-04-21 22:05:55 +00:00
c1dbe052f1 tests/ioperm.c: use errno2name 2016-04-21 22:05:55 +00:00
7f68f80f42 tests/getgroups.c: use errno2name
* tests/getgroups.c (errno2str): Remove.
(main): Use errno2name.
2016-04-21 22:05:55 +00:00
337f66e7c7 tests/ftruncate64.c: cleanup
* tests/ftruncate64.c (main): Use errno2name, stop using assert.
2016-04-21 22:05:55 +00:00
a57bc5be7f tests/ftruncate.c: cleanup
* tests/ftruncate.c (main): Use errno2name, stop using assert.
2016-04-21 22:05:55 +00:00
1717c8c06d tests/fsync.c: print syscall() result using %ld format 2016-04-21 22:05:55 +00:00
ca24b94652 tests/flock.c: print syscall() result using %ld format 2016-04-21 22:05:55 +00:00
884471bc9f tests/file_handle.c: use errno2name 2016-04-21 22:05:53 +00:00
02269e5da0 tests/fdatasync.c: print syscall() result using %ld format 2016-04-21 20:52:42 +00:00
3fc6bd96d8 tests/fchownat.c: use errno2name 2016-04-21 20:52:42 +00:00
bf563a9ea3 tests/fchmodat.c: use errno2name 2016-04-21 20:52:42 +00:00
ba93e7b886 tests/fchmod.c: use errno2name 2016-04-21 20:52:42 +00:00
a2633101da tests/faccessat.c: print syscall() result using %ld format 2016-04-21 20:52:42 +00:00
33568cf1be tests/epoll_wait.c: print syscall() result using %ld format 2016-04-21 20:52:42 +00:00
becfc0eb0a tests/epoll_ctl.c: print syscall() result using %ld format 2016-04-21 20:52:42 +00:00
7529683349 tests/epoll_create1.c: cleanup
* tests/epoll_create1.c (main): Use errno2name, stop using assert.
2016-04-21 20:52:42 +00:00
8243175721 tests/epoll_create.c: print syscall() result using %ld format 2016-04-21 20:52:41 +00:00
22f9fa7fd9 tests/dup3.c: print syscall() result using %ld format 2016-04-21 20:52:41 +00:00
65dea4b1e4 tests/dup2.c: print syscall() result using %ld format 2016-04-21 20:52:41 +00:00
89b575d3c5 tests/dup.c: cleanup 2016-04-21 20:52:41 +00:00
b0a647f4d4 tests/creat.c: stop using sys/stat.h 2016-04-21 20:52:41 +00:00
0d8361fc80 tests/copy_file_range.c: stop using assert 2016-04-21 20:52:41 +00:00
adbbc2d288 tests/chroot.c: use errno2name 2016-04-21 20:52:41 +00:00
5327e9c179 tests/aio.c: use errno2name 2016-04-21 20:52:41 +00:00
dd02f09f4b tests: cleanup acct.test
* tests/acct.c (main): Use errno2name, stop using assert,
change sample file name.
* tests/acct.test: Update.
2016-04-21 20:20:42 +00:00
9f6611bb31 tests: use errno2name()
Automatically change tests/*.c files using the following sed regexp:
sed -i 's/errno == E[[:alnum:]]\+ ? "E[[:alnum:]]\+" : "E[[:alnum:]]\+"/errno2name()/g'
2016-04-21 18:16:50 +00:00
57b5f55a2a tests/dup.c: include "tests.h"
This is going to be necessary for the following commit.
2016-04-21 18:16:10 +00:00
Fei Jie
ef6b4262bb tests: add getpgrp.test
* tests/getpgrp.c: New file.
* tests/getpgrp.test: New test.
* tests/.gitignore: Add getpgrp.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getpgrp.test.
2016-04-21 17:37:44 +00:00
Fei Jie
f914194fc3 tests: add access.test
* tests/access.c: New file.
* tests/access.test: New test.
* tests/.gitignore: Add access.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add access.test.
2016-04-21 17:37:43 +00:00
Fei Jie
e0057a578f tests: add fchdir.test
* tests/fchdir.c: New file.
* tests/fchdir.test: New test.
* tests/.gitignore: Add fchdir.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchdir.test.
2016-04-21 17:35:39 +00:00
Fei Jie
5c1776fe00 tests: add mkdir.test
* tests/mkdir.c: New file.
* tests/mkdir.test: New test.
* tests/.gitignore: Add mkdir.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mkdir.test.
2016-04-21 17:34:38 +00:00
Fei Jie
8bfe0d5e22 tests: add getsid.test
* tests/getsid.c: New file.
* tests/getsid.test: New test.
* tests/.gitignore: Add getsid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getsid.test.
2016-04-21 17:31:05 +00:00
2b69fd4c43 tests: add errno2name function to libtests
Add a simple translator of errno to its name, so one could
simply use errno2name() instead of complex expressions like
errno == EINVAL ? "EINVAL" : "EFAULT".

* tests.h (errno2name): New prototype.
* errno2name.c: New file.
* Makefile.am (libtests_a_SOURCES): Add it.
2016-04-21 04:08:55 +03:00
e8a8f6d6e8 tests: workaround kernel bugs in seccomp-strict.test and prctl-seccomp-strict.test
If kernel implementation of strict seccomp mode is buggy, test programs
will be killed by SIGKILL.  This is a known problem at least on
x32 and mips.  Skip affected tests if this is the case.

This change partially revert commit 9c1a72cd3f.

* tests/seccomp-strict.c (main): Remove workaround for x32.
* tests/prctl-seccomp-strict.c: Likewise.
* tests/seccomp-strict.test: Skip the test if the test program
has been killed by SIGKILL.
* tests/prctl-seccomp-strict.test: Likewise.
2016-04-20 14:30:43 +00:00
bea707377d tests/shmxt.c: do not use SHM_RND, it is unreliable
* tests/shmxt.c (main): Do not set SHM_RND flag.
2016-04-20 05:40:58 +00:00
c8cc0f2a87 tests/rt_sigpending.c: fix for systems where _NSIG > 16 * sizeof(long)
* tests/rt_sigsuspend.c (iterate): Do not assume that size will be less
than sizeof(long) on the second iteration.
2016-04-20 04:35:25 +00:00
d424c765f7 prctl-seccomp-strict.test: robustify against unrelated prctl invocations
* tests/prctl-seccomp-strict.test: Filter out PR_GET_* prctl calls.
2016-04-20 01:08:13 +00:00
fdb2a1867e tests: adjust rt_sigpending to older kernels
With linux kernels older than v3.9-rc1, compat rt_sigpending syscall
could fail with EFAULT in cases where on later kernels it succeeds.
Adjust the test to handle both cases properly.

* tests/rt_sigpending.c (iterate): Stop iterations if rt_sigpending
failed with EFAULT.
2016-04-20 01:08:13 +00:00
f73a3a44dd tests: adjust readv/writev and preadv/pwritev tests to older kernels
With linux kernels older than v3.16-rc1, iovec based compat syscalls may
return EINVAL in some cases where on later kernels they return EFAULT.
Adjust tests to handle both cases properly.

* tests/preadv-pwritev.c: Include <errno.h>.
(main): Print either "EINVAL" or "EFAULT" depending on errno.
* tests/pwritev.c: Likewise.
* tests/readv.c: Likewise.
2016-04-20 01:08:13 +00:00
87c0b56a77 tests: remove obsolete non-strict uid tests
Recently added strict tests for uid/gid related syscalls
made old uid tests obsolete.

* tests/uid.awk: Remove.
* tests/uid.c: Remove.
* tests/uid.test: Remove.
* tests/uid16.c: Remove.
* tests/uid16.test: Remove.
* tests/uid32.c: Remove.
* tests/uid32.test: Remove.
* tests/.gitignore: Remove uid, uid16, and uid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Remove uid.test, uid16.test, and uid32.test.
(EXTRA_DIST): Remove uid.awk.
2016-04-20 01:08:13 +00:00
f096422882 tests: extend test coverage of getuid/getgid family syscalls
Add strict tests for getuid, getuid32, getgid, getgid32, geteuid,
geteuid32, getegid, and getegid32 syscalls.

* tests/getegid.c: New file.
* tests/getegid.test: New test.
* tests/getegid32.c: New file.
* tests/getegid32.test: New test.
* tests/geteuid.c: New file.
* tests/geteuid.test: New test.
* tests/geteuid32.c: New file.
* tests/geteuid32.test: New test.
* tests/getgid.c: New file.
* tests/getgid.test: New test.
* tests/getgid32.c: New file.
* tests/getgid32.test: New test.
* tests/getuid.c: New file.
* tests/getuid.test: New test.
* tests/getuid32.c: New file.
* tests/getuid32.test: New test.
* tests/.gitignore: Add getuid, getuid32, getgid, getgid32, geteuid,
* geteuid32, getegid, and getegid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getegid.test, getegid32.test, geteuid.test,
geteuid32.test, getgid.test, getgid32.test, getuid.test,
and getuid32.test.
2016-04-20 01:08:13 +00:00
7f3da2ff4c tests: extend test coverage of getresgid32 syscall
* tests/getresgid32.c: New file.
* tests/getresgid32.test: New test.
* tests/.gitignore: Add getresgid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getresgid32.test.
2016-04-20 01:08:13 +00:00
91119e5306 tests: extend test coverage of getresgid syscall
* tests/getresgid.c: New file.
* tests/getresgid.test: New test.
* tests/.gitignore: Add getresgid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getresgid.test.
2016-04-20 01:08:13 +00:00
dcc6660256 tests: extend test coverage of getresuid32 syscall
* tests/getresuid32.c: New file.
* tests/getresuid32.test: New test.
* tests/.gitignore: Add getresuid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getresuid32.test.
2016-04-20 01:08:13 +00:00
fbe1a9ec6e tests: extend test coverage of getresuid syscall
* tests/getresugid.c: New file.
* tests/getresuid.c: New file.
* tests/getresuid.test: New test.
* tests/.gitignore: Add getresuid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getresuid.test.
(EXTRA_DIST): Add getresugid.c.
2016-04-20 01:08:13 +00:00
Fei Jie
bff70d4311 tests: add symlinkat.test
* tests/symlinkat.c: New file.
* tests/symlinkat.test: New test.
* tests/.gitignore: Add symlinkat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add symlinkat.test.
2016-04-20 01:08:13 +00:00
Fei Jie
1eb0051663 tests: add iopl.test
* tests/iopl.c: New file.
* tests/iopl.test: New test.
* tests/.gitignore: Add iopl.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add iopl.test.
2016-04-20 01:08:13 +00:00
Fei Jie
2e069fcc0d tests: add ioperm.test
* tests/ioperm.c: New file.
* tests/ioperm.test: New test.
* tests/.gitignore: Add ioperm.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioperm.test.
2016-04-20 01:08:13 +00:00
5e9944df2c Fix corner cases of getgroups and setgroups syscall decoders
* uid.c (print_groups): New function.
(SYS_FUNC(setgroups), SYS_FUNC(getgroups)): Use it.
Print first syscall argument using %u format.
* tests/getgroups.c: New file.
* tests/getgroups.test: New test.
* tests/getgroups32.c: New file.
* tests/getgroups32.test: New test.
* tests/setgroups.c: New file.
* tests/setgroups.test: New test.
* tests/setgroups32.c: New file.
* tests/setgroups32.test: New test.
* tests/.gitignore: Add getgroups, getgroups32, setgroups,
and setgroups32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getgroups.test, getgroups32.test,
setgroups.test, and setgroups32.test.
2016-04-20 01:08:13 +00:00
f184989593 tests: check decoding of setfsgid32 syscall
* tests/setfsgid32.c: New file.
* tests/setfsgid32.test: New test.
* tests/.gitignore: Add setfsgid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setfsgid32.test.
2016-04-20 01:08:13 +00:00
fba762db71 tests: check decoding of setfsgid syscall
* tests/setfsugid.c: New file.
* tests/setfsgid.c: New file.
* tests/setfsgid.test: New test.
* tests/.gitignore: Add setfsgid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setfsgid.test.
(EXTRA_DIST): Add setfsugid.c.
2016-04-20 01:08:13 +00:00
2def3d4a04 tests: check decoding of setfsuid32 syscall
* tests/setfsuid32.c: New file.
* tests/setfsuid32.test: New test.
* tests/.gitignore: Add setfsuid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setfsuid32.test.
2016-04-20 01:08:13 +00:00
281e4578dd tests: check decoding of setfsuid syscall
* tests/setfsugid.c: New file.
* tests/setfsuid.c: New file.
* tests/setfsuid.test: New test.
* tests/.gitignore: Add setfsuid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setfsuid.test.
(EXTRA_DIST): Add setfsugid.c.
2016-04-20 01:08:13 +00:00
fa7c988bd9 tests: extend test coverage of setresgid32 syscall
* tests/setresgid32.c: New file.
* tests/setresgid32.test: New test.
* tests/.gitignore: Add setresgid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setresgid32.test.
2016-04-20 01:08:13 +00:00
4f6d95dd58 tests: extend test coverage of setresgid syscall
* tests/setresgid.c: New file.
* tests/setresgid.test: New test.
* tests/.gitignore: Add setresgid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setresgid.test.
2016-04-20 01:08:12 +00:00
2b42d8e32f tests: extend test coverage of setresuid32 syscall
* tests/setresuid32.c: New file.
* tests/setresuid32.test: New test.
* tests/.gitignore: Add setresuid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setresuid32.test.
2016-04-20 01:08:12 +00:00
0eac88a00a tests: extend test coverage of setresuid syscall
* tests/setresugid.c: New file.
* tests/setresuid.c: New file.
* tests/setresuid.test: New test.
* tests/.gitignore: Add setresuid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setresuid.test.
(EXTRA_DIST): Add setresugid.c.
2016-04-20 01:08:12 +00:00
7d7dfbede8 tests: extend test coverage of setregid32 syscall
* tests/setregid32.c: New file.
* tests/setregid32.test: New test.
* tests/.gitignore: Add setregid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setregid32.test.
2016-04-20 01:08:12 +00:00
28d02ea6f3 tests: extend test coverage of setregid syscall
* tests/setregid.c: New file.
* tests/setregid.test: New test.
* tests/.gitignore: Add setregid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setregid.test.
2016-04-20 01:08:12 +00:00
619a96a295 tests: extend test coverage of setreuid32 syscall
* tests/setreuid32.c: New file.
* tests/setreuid32.test: New test.
* tests/.gitignore: Add setreuid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setreuid32.test.
2016-04-20 01:08:12 +00:00
e6d8473850 tests: extend test coverage of setreuid syscall
* tests/setreugid.c: New file.
* tests/setreuid.c: New file.
* tests/setreuid.test: New test.
* tests/.gitignore: Add setreuid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setreuid.test.
(EXTRA_DIST): Add setreugid.c.
2016-04-20 01:08:12 +00:00
6511b2df01 tests: extend test coverage of setgid32 syscall
* tests/setgid32.c: New file.
* tests/setgid32.test: New test.
* tests/.gitignore: Add setgid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setgid32.test.
2016-04-20 01:08:12 +00:00
cf273016fe tests: extend test coverage of setgid syscall
* tests/setgid.c: New file.
* tests/setgid.test: New test.
* tests/.gitignore: Add setgid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setgid.test.
2016-04-20 01:08:12 +00:00
8f0e41afb7 tests: extend test coverage of setuid32 syscall
* tests/setuid32.c: New file.
* tests/setuid32.test: New test.
* tests/.gitignore: Add setuid32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setuid32.test.
2016-04-20 01:08:12 +00:00
aa399261ac tests: extend test coverage of setuid syscall
* tests/setugid.c: New file.
* tests/setuid.c: New file.
* tests/setuid.test: New test.
* tests/.gitignore: Add setuid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add setuid.test.
(EXTRA_DIST): Add setugid.c.
2016-04-20 01:08:12 +00:00
Fei Jie
39a33b171b tests: add shmxt.test
* tests/shmxt.c: New file.
* tests/shmxt.test: New test.
* tests/.gitignore: Add shmxt.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add shmxt.test.
2016-04-20 01:08:12 +00:00
Fei Jie
f22db4e753 tests: add semop.test
* tests/semop.c: New file.
* tests/semop.test: New test.
* tests/.gitignore: Add semop.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add semop.test.
2016-04-20 00:11:27 +00:00
7d23d33933 prctl-seccomp-filter-v.test: robustify against unrelated prctl invocations
* tests/prctl-seccomp-filter-v.test: Filter out PR_GET_* prctl calls.

Reported-by: Steve McIntyre <steve@einval.com>
2016-04-18 01:10:44 +00:00
bcdd2041fa tests/pselect6.c: fix potential output mismatch
* tests/pselect6.c (main): In the last case of printing pselect6
syscall, print the last argument the same way as in other cases.

Reported-by: Steve McIntyre <steve@einval.com>
2016-04-18 01:10:44 +00:00
96492b2acd tests: check decoding of fchown32 syscall
* tests/fchown32.c: New file.
* tests/fchown32.test: New test.
* tests/.gitignore: Add fchown32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchown32.test.
2016-04-18 01:10:44 +00:00
e6828b1102 tests: check decoding of fchown syscall
* tests/fchown.c: New file.
* tests/fchown.test: New test.
* tests/.gitignore: Add fchown.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchown.test.
2016-04-18 01:10:44 +00:00
11f98f21b7 tests: check decoding of lchown32 syscall
* tests/lchown32.c: New file.
* tests/lchown32.test: New test.
* tests/.gitignore: Add lchown32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add lchown32.test.
2016-04-18 01:10:44 +00:00
408420f51f tests: check decoding of lchown syscall
* tests/lchown.c: New file.
* tests/lchown.test: New test.
* tests/.gitignore: Add lchown.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add lchown.test.
2016-04-18 01:10:43 +00:00
f559a876f8 tests: check decoding of chown32 syscall
* tests/chown32.c: New file.
* tests/chown32.test: New test.
* tests/.gitignore: Add chown32.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add chown32.test.
2016-04-18 01:10:43 +00:00
4ccdbd698e tests: check decoding of chown syscall
* tests/chown.c: New file.
* tests/chown.test: New test.
* tests/xchownx.c: New file.
* tests/.gitignore: Add chown.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add chown.test.
(EXTRA_DIST): Add xchownx.c.
2016-04-18 01:10:43 +00:00
c1f1cc1b4c tests: move kernel uid overflow check to libtests
This code used in two different places, so move it to the library.

* tests/overflowuid.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
* tests/tests.h (check_overflowuid, check_overflowgid): New prototypes.
* tests/uid.c (main): Use check_overflowuid.
* tests/uid16.c (main): Likewise.
2016-04-18 01:10:41 +00:00
9c1a72cd3f tests: skip seccomp-strict.test and prctl-seccomp-strict.test on x32
As x86_64 kernel does not support x32 syscall numbers in
SECCOMP_MODE_STRICT, skip affected tests on x32.

* tests/seccomp-strict.c (main) [__x86_64__ && __ILP32__]: Bail out
using error_msg_and_skip.
* tests/prctl-seccomp-strict.c: Likewise.
2016-04-12 04:39:25 +00:00
c2523e0d9c tests: add seccomp-filter.test
* tests/seccomp-filter.c: New file.
* tests/seccomp-filter.test: New test.
* tests/.gitignore: Add seccomp-filter.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add seccomp-filter.test.
2016-04-12 00:20:03 +00:00
6ba947f36e seccomp: fix decoding of sock_fprog and sock_filter structures
Always print struct sock_fprog.len.
Fix printing of unfetchable elements in sock_filter array.
Fix printing of large sock_filter arrays.

* seccomp.c (decode_fprog): Rewrite into decode_seccomp_fprog and
print_seccomp_fprog.
(print_seccomp_filter): Replace decode_fprog with print_seccomp_fprog.
* tests/prctl-seccomp-filter-v.c (main): Update.
* tests/seccomp-filter-v.c: New file.
* tests/seccomp-filter-v.test: New test.
* tests/.gitignore: Add seccomp-filter-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add seccomp-filter-v.test.
2016-04-12 00:05:43 +00:00
3ea6a59802 seccomp: print SECCOMP_* and BPF_* constants in a more compact way
* seccomp.c (decode_bpf_code, decode_bpf_stmt): Replace " | " with "|".
* tests/prctl-seccomp-filter-v.c: Update.
2016-04-11 20:25:01 +00:00
181806136e tests: rename seccomp.test to prctl-seccomp-filter-v.test
* tests/.gitignore: Replace seccomp with prctl-seccomp-filter-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Replace seccomp.test with prctl-seccomp-filter-v.test.
* tests/seccomp.c: Rename to tests/prctl-seccomp-filter-v.c.
* tests/seccomp.test: Rename to tests/prctl-seccomp-filter-v.test.
2016-04-11 15:16:30 +00:00
b19945bebc tests: add seccomp-strict.test
* tests/seccomp-strict.c: New file.
* tests/seccomp-strict.test: New test.
* tests/.gitignore: Add seccomp-strict.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add seccomp-strict.test.
2016-04-11 15:09:09 +00:00
c1aa737325 tests: add prctl-seccomp-strict.test
* tests/prctl-seccomp-strict.c: New file.
* tests/prctl-seccomp-strict.test: New test.
* tests/.gitignore: Add prctl-seccomp-strict.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add prctl-seccomp-strict.test.
2016-04-11 15:06:28 +00:00
d9e4ff7fb3 tests: bring lists back to the sorted order 2016-04-11 15:04:08 +00:00
7a06960ff4 tests/epoll_create1.c: extend for the case of ENOSYS
* epoll_create1.c: Make the test work in case of epoll_create1
returning ENOSYS.
2016-04-10 23:05:18 +00:00
2399a6031c tests/epoll_ctl.c: extend epoll_ctl coverage
* tests/epoll_ctl.c (main): Check EPOLL_CTL_DEL decoding.  Check
decoding of long int descriptors and NULL struct epoll_event pointer.
2016-04-10 22:38:00 +00:00
cb6f997114 tests: add mlockall.test
* tests/mlockall.c: New file.
* tests/mlockall.test: New test.
* tests/.gitignore: Add mlockall.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mlockall.test.
2016-04-09 23:34:18 +00:00
Fei Jie
c75e2c2e42 tests: add epoll_wait.test
* tests/epoll_wait.c: New file.
* tests/epoll_wait.test: New test.
* tests/.gitignore: Add epoll_wait.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add epoll_wait.test.
2016-04-08 07:59:16 +00:00
Fei Jie
258a22519f tests: add epoll_ctl.test
* tests/epoll_ctl.c: New file.
* tests/epoll_ctl.test: New test.
* tests/.gitignore: Add epoll_ctl.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add epoll_ctl.test.
2016-04-08 07:59:15 +00:00
Fei Jie
bbdd23c8ed tests: add epoll_create.test
* tests/epoll_create.c: New file.
* tests/epoll_create.test: New test.
* tests/.gitignore: Add epoll_create.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add epoll_create.test.
2016-04-08 07:59:14 +00:00
17f4b45164 tests/pread64-pwrite64.c: minor cleanup
* tests/pread64-pwrite64.c: Do not include <sys/uio.h>.
2016-04-08 02:16:28 +00:00
fcb94cded0 Fix decoding of swapon flags
* swapon.c (SYS_FUNC(swapon)): Print priority regardless
of SWAP_FLAG_PREFER flag being set.
* tests/swap.c (error_msg): Handle EINVAL.
(main): Check decoding of swapon flags.
2016-04-07 01:15:58 +00:00
f2f91c0933 tests/unlinkat.c: check AT_* decoding
* tests/unlinkat.c (main): Check decoding of AT_* constants.
2016-04-07 00:39:18 +00:00
867c1cdf19 tests/linkat.c: check AT_* decoding
* tests/linkat.c (main): Check decoding of AT_* constants.
2016-04-07 00:31:44 +00:00
Fei Jie
c4a30f15ef tests: add mkdirat.test
* tests/mkdirat.c: New file.
* tests/mkdirat.test: New test.
* tests/.gitignore: Add mkdirat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add mkdirat.test.
2016-04-06 06:18:51 +00:00
Fei Jie
93faa4cc88 tests: add swap.test
* tests/swap.c: New file.
* tests/swap.test: New test.
* tests/.gitignore: Add swap.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add swap.test.
2016-04-06 06:18:50 +00:00
Fei Jie
41cd657930 tests: add unlinkat.test
* tests/unlinkat.c: New file.
* tests/unlinkat.test: New test.
* tests/.gitignore: Add unlinkat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add unlinkat.test.
2016-04-06 06:18:49 +00:00
Fei Jie
7a158a18f8 tests: add linkat.test
* tests/linkat.c: New file.
* tests/linkat.test: New test.
* tests/.gitignore: Add linkat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add linkat.test.
2016-04-06 06:18:48 +00:00
5b2d257839 tests: add sync_file_range.test and sync_file_range2.test
* configure.ac (AC_CHECK_FUNCS): Add sync_file_range.
* tests/sync_file_range.c: New file.
* tests/sync_file_range2.c: Likewise.
* tests/sync_file_range.test: New test.
* tests/sync_file_range2.test: Likewise.
* tests/.gitignore: Add sync_file_range and sync_file_range2.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sync_file_range.test and sync_file_range2.test.
2016-04-06 00:02:08 +00:00
71fe62e6b7 Replace PF_* constants with AF_*
AF_* constants appear to be more standardized, and in practice there's
always a one to one relationship between AF_* and PF_*, so let's
use AF_* instead of PF_*.

* xlat/domains.in: Remove.
* net.c: Do not define PF_UNSPEC.  Stop including "xlat/domains.h".
Replace PF_* with AF_*.  Replace domains with addrfams.
* tests/inet-cmsg.c: Replace PF_INET with AF_INET.
* tests/net-yy-inet.c: Likewise.
* tests/netlink_inet_diag.c: Likewise.
* tests/net-accept-connect.c: Replace PF_LOCAL with AF_LOCAL.
* tests/net-y-unix.c: Likewise.
* tests/net-yy-unix.c: Likewise.
* tests/netlink_unix_diag.c: Likewise.
* tests/net.expected: Replace PF_ with AF_.
2016-04-04 01:35:28 +00:00
2aa9b32d81 tests: add read-write.test
* tests/read-write.c: New file.
* tests/read-write.test: New test.
* tests/.gitignore: Add read-write.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add read-write.test.
2016-04-03 16:37:43 +00:00
7b5d8f98fc tests/pread64-pwrite64.test: extend dumpio coverage
* tests/pread64-pwrite64.c (dump_str, print_hex, test_dump):
New functions.
(main): Use them to test dumping of various data.
* tests/pread64-pwrite64.test: Update.
2016-04-02 18:27:44 +00:00