Commit Graph

3759 Commits

Author SHA1 Message Date
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
27bff90e86 Add default values for SYNC_FILE_RANGE_* constants
* xlat/sync_file_range_flags.in: Add default values.
2016-04-05 23:30:05 +00:00
Elliott Hughes
6f072d5e87 Fix sync_file_range2 output
Before:

  sync_file_range2(3SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|
    SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0, )

After:

  sync_file_range2(3, SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|
    SYNC_FILE_RANGE_WAIT_AFTER|0xfffffff8, 0, 0)

* sync_file_range.c (SYS_FUNC(sync_file_range2)): Output the ", "
in the right place.
2016-04-05 19:10:16 +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
0de582907a tests: add hexdump_memdup function to libtests
* tests/hexdump_strdup.c (hexdump_memdup): New function.
(hexdump_strdup): Use it.
* tests/tests.h (hexdump_memdup): New prototype.
2016-04-02 18:24:36 +00:00
35e97a78c7 tests: add fchownat.test
* tests/fchownat.c: New file.
* tests/fchownat.test: New test.
* tests/.gitignore: Add fchownat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchownat.test.
2016-04-02 14:07:02 +00:00
baeff232ce tests: add fchmodat.test
* tests/fchmodat.c: New file.
* tests/fchmodat.test: New test.
* tests/.gitignore: Add fchmodat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fchmodat.test.
2016-04-02 13:13:16 +00:00
9f3a6af09a Fix printing of negative offsets in pread64 and pwrite64 syscalls
* io.c (SYS_FUNC(pread), SYS_FUNC(pwrite)): Print offset
using %lld format string.
* tests/pread64-pwrite64.c: New file.
* tests/pread64-pwrite64.test: New test.
* tests/.gitignore: Add pread64-pwrite64.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(pread64_pwrite64_CPPFLAGS): New variable.
(DECODER_TESTS): Add pread64-pwrite64.
2016-04-02 01:08:24 +00:00
69f1bf37fd tests/hexdump_strdup.c: add support for longer strings
* tests/hexdump_strdup.c (hexdump_strdup): Output extra space character
before hexdumping of the 9th symbol.
2016-04-02 01:05:25 +00:00
fe0d07a1bc tests/preadv-pwritev.c: fix typo in error diagnostics
* tests/preadv-pwritev.c (main): Fix typo in error message.
2016-04-02 01:04:57 +00:00
Fei Jie
d82b0d8ceb tests: add chroot.test
* tests/chroot.c: New file.
* tests/chroot.test: New test.
* tests/.gitignore: Add chroot.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add chroot.test.
2016-04-01 23:34:33 +00:00
Fei Jie
4c4ab0fe82 tests: add fdatasync.test
* tests/fdatasync.c: New file.
* tests/fdatasync.test: New test.
* tests/.gitignore: Add fdatasync.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fdatasync.test.
2016-04-01 23:34:33 +00:00
Fei Jie
16c078ea99 tests: add fsync.test
* tests/fsync.c: New file.
* tests/fsync.test: New test.
* tests/.gitignore: Add fsync.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add fsync.test.
2016-04-01 23:34:33 +00:00
Fei Jie
a067b8d3b0 tests: add sethostname.test
* tests/sethostname.c: New file.
* tests/sethostname.test: New test.
* tests/.gitignore: Add sethostname.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sethostname.test.
2016-04-01 23:34:33 +00:00
3ae8690d8e Consistently handle unsigned arguments of mmap* and remap_file_pages
Explicitly declare first 4 arguments of mmap* and all remap_file_pages
arguments as unsigned to avoid potential sign extension issues.

* mem.c (print_mmap, SYS_FUNC(remap_file_pages)): Assign syscall
arguments to local variables of appropriate types.
2016-04-01 15:31:23 +00:00
f40ea796ba Consistently handle 2nd and 3rd arguments of [gs]etsockopt as unsigned
The second (level) and third (optname) arguments of getsockopt and
setsockopt syscalls are enums, so treat them consistently as enums:
use "unsigned int" type to avoid potential sign extension issues.

* net.c (print_sockopt_fd_level_name, print_getsockopt,
print_setsockopt): Change type of "level" and "name" arguments
from "int" to "unsigned int".
2016-04-01 01:03:20 +00:00
b0d23cc2c0 Add sentinel attribute to printxvals
* gcc_compat.h (ATTRIBUTE_SENTINEL): New macro.
* defs.h (printxvals): Add ATTRIBUTE_SENTINEL.
2016-04-01 00:52:01 +00:00
ccdc82a57d Cleanup parser of ptrace syscall
* process.c (print_user_offset_addr): New function for printing offset
address in the tracee's USER area.
(SYS_FUNC(ptrace)): Assign syscall arguments to local variables with
appropriate types.  Print pid argument as int.  Use switch statement
in the code that handles address argument.  Use print_user_offset_addr
to print address in PTRACE_PEEKUSER and PTRACE_POKEUSER requests.
2016-04-01 00:28:33 +00:00
Jeff Mahoney
1f3482beda Define PRI__[uxs]64 macros to print __s64 and __u64 values
Rather than cast every __u64 or __s64 before printing,
define printing helpers for those types directly.

* defs.h (PRI__s64, PRI__u64, PRI__x64): New macros.
2016-03-31 04:34:17 +00:00
3f6ebceb50 Implement dumping of preadv and pwritev syscalls
* syscall.c (dumpio): Add SEN_preadv and SEN_pwritev.
* NEWS: Mention this.
* tests/preadv-pwritev.c: New file.
* tests/preadv-pwritev.test: New test.
* tests/.gitignore: Add preadv-pwritev.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(preadv_pwritev_CPPFLAGS): New variable.
(DECODER_TESTS): Add preadv-pwritev.
2016-03-31 00:01:58 +00:00
c98ab8805b Fix decoding of preadv syscall in case of short read
* io.c (SYS_FUNC(preadv)): Call tprint_iov_upto instead
of tprint_iov and specify syscall return value as a data size limit.
* NEWS: Mention it.
* tests/preadv.c (main): Add a test case for preadv short read.
2016-03-30 18:04:00 +00:00
d461151f23 Fix printing of negative offsets in preadv and pwritev syscalls
* io.c (print_llu_from_low_high_val): Rename to
print_lld_from_low_high_val, all callers changed.
Print value as a signed integer.
* tests/preadv.c: New file.
* tests/preadv.test: New test.
* tests/pwritev.c: New file.
* tests/pwritev.test: New test.
* tests/.gitignore: Add preadv and pwritev.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(preadv_CPPFLAGS, pwritev_CPPFLAGS): New variables.
(DECODER_TESTS): Add preadv.test and pwritev.test.
2016-03-30 03:54:21 +00:00
0a9d1947a7 Fix printing of unreadable struct iovec
* io.c (tprint_iov_upto): If the first element of iovec array is
unreadable, print its address without array markup.
* tests/readv.c (main): Check it.
2016-03-30 02:22:58 +00:00
5dde5671bd tests: factor out a part common to many simply organized test scripts
* tests/init.sh (run_strace_match_diff): New function.
* tests/acct.test: Rewrite using run_strace_match_diff.
* tests/aio.test: Likewise.
* tests/alarm.test: Likewise.
* tests/chmod.test: Likewise.
* tests/clock_nanosleep.test: Likewise.
* tests/clock_xettime.test: Likewise.
* tests/copy_file_range.test: Likewise.
* tests/creat.test: Likewise.
* tests/dup.test: Likewise.
* tests/dup2.test: Likewise.
* tests/dup3.test: Likewise.
* tests/epoll_create1.test: Likewise.
* tests/execveat-v.test: Likewise.
* tests/execveat.test: Likewise.
* tests/fchmod.test: Likewise.
* tests/fcntl.test: Likewise.
* tests/file_handle.test: Likewise.
* tests/flock.test: Likewise.
* tests/fork-f.test: Likewise.
* tests/ftruncate.test: Likewise.
* tests/ftruncate64.test: Likewise.
* tests/getcwd.test: Likewise.
* tests/getdents.test: Likewise.
* tests/getdents64.test: Likewise.
* tests/getrandom.test: Likewise.
* tests/getrusage.test: Likewise.
* tests/getxxid.test: Likewise.
* tests/inet-cmsg.test: Likewise.
* tests/init.sh: Likewise.
* tests/membarrier.test: Likewise.
* tests/mincore.test: Likewise.
* tests/mknod.test: Likewise.
* tests/mlock2.test: Likewise.
* tests/mmsg.test: Likewise.
* tests/nanosleep.test: Likewise.
* tests/open.test: Likewise.
* tests/openat.test: Likewise.
* tests/pselect6.test: Likewise.
* tests/readdir.test: Likewise.
* tests/readlink.test: Likewise.
* tests/readv.test: Likewise.
* tests/recvmsg.test: Likewise.
* tests/rename.test: Likewise.
* tests/renameat.test: Likewise.
* tests/rt_sigpending.test: Likewise.
* tests/rt_sigprocmask.test: Likewise.
* tests/rt_sigqueueinfo.test: Likewise.
* tests/rt_sigsuspend.test: Likewise.
* tests/rt_sigtimedwait.test: Likewise.
* tests/rt_tgsigqueueinfo.test: Likewise.
* tests/sched_get_priority_mxx.test: Likewise.
* tests/sched_xetaffinity.test: Likewise.
* tests/sched_xetparam.test: Likewise.
* tests/sched_xetscheduler.test: Likewise.
* tests/seccomp.test: Likewise.
* tests/select.test: Likewise.
* tests/sendfile.test: Likewise.
* tests/sendfile64.test: Likewise.
* tests/splice.test: Likewise.
* tests/statx.sh: Likewise.
* tests/sysinfo.test: Likewise.
* tests/syslog.test: Likewise.
* tests/tee.test: Likewise.
* tests/time.test: Likewise.
* tests/timer_create.test: Likewise.
* tests/timer_xettime.test: Likewise.
* tests/timerfd_xettime.test: Likewise.
* tests/times-fail.test: Likewise.
* tests/times.test: Likewise.
* tests/truncate.test: Likewise.
* tests/truncate64.test: Likewise.
* tests/umask.test: Likewise.
* tests/umount.test: Likewise.
* tests/umount2.test: Likewise.
* tests/userfaultfd.test: Likewise.
* tests/vmsplice.test: Likewise.
* tests/xet_robust_list.test: Likewise.
* tests/xetitimer.test: Likewise.
* tests/xetpgid.test: Likewise.
* tests/xetpriority.test: Likewise.
* tests/xettimeofday.test: Likewise.
2016-03-30 00:16:24 +00:00
579a4aae8a tests: introduce $NAME
* tests/init.sh (NAME): New variable, defined to ${ME_%.test}.
(run_prog, match_awk, match_diff, match_grep): Replace ${ME_%.test}
with $NAME.
* tests/fcntl.test: Likewise.
* tests/fstat.test: Likewise.
* tests/mmap.test: Likewise.
* tests/net-y-unix.test: Likewise.
* tests/net-yy-inet.test: Likewise.
* tests/net-yy-unix.test: Likewise.
* tests/open.test: Likewise.
* tests/openat.test: Likewise.
* tests/poll.test: Likewise.
* tests/ppoll.test: Likewise.
* tests/readlink.test: Likewise.
* tests/select.test: Likewise.
* tests/statx.sh: Likewise.
* tests/uname.test: Likewise.
2016-03-30 00:13:56 +00:00
2e8a7871ab tests: move definitions of $OUT and $ERR to init.sh
As virtually every test defines either one or both of OUT and ERR
variables and these definitions are exactly the same, move definitions
of these variables from individual tests to init.sh.

* tests/init.sh (OUT, ERR): New variables.
* tests/ipc.sh: Remove initialization of OUT variable.
* tests/statx.sh: Likewise.
* tests/*.test: Remove initialization of OUT and ERR variables.
2016-03-30 00:13:37 +00:00
a990e8c671 tests: simplify sendfile.test and sendfile64.test
Use the executable itself for input by default.

* tests/sendfile.c (main): Use av[0] instead of av[1] for input.
* tests/sendfile64.c (main): Likewise.
* tests/sendfile.test: Invoke run_prog without arguments.
* tests/sendfile64.test: Likewise.
2016-03-29 17:01:02 +00:00
1e7dfc38fd open.test, openat.test: lift /proc requirement
While -P option needs /proc to match descriptors, it does not use
/proc to match pathnames.  As these tests do not need descriptor
match, the /proc requirement can be safely lifted.

* tests/open.test: Lift /proc/self/fd/ requirement.
* tests/openat.test: Likewise.
2016-03-29 03:33:00 +00:00
cca2e53c4a quotactl: add decoding of Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA
* quota.c (if_nextdqblk): New structure.
(decode_cmd_data): Handle Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA.
2016-03-29 01:15:24 +00:00
4ce6b5e0e8 Update Q_* constants
* xlat/quotacmds.in: Add Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA introduced
by linux kernel commits v4.6-rc1~65^2~9^2~5 and v4.6-rc1~65^2~9^2~6.
2016-03-29 00:51:28 +00:00
c4d67d4141 Update CLONE_* constants
* xlat/clone_flags.in: Rename CLONE_STOPPED to CLONE_NEWCGROUP.
The former was removed by linux kernel commit v2.6.38-rc1~217.
The latter was introduced by linux kernel commit v4.6-rc1~67^2~8.
2016-03-29 00:51:28 +00:00
54cc3e1d21 Update BPF_MAP_TYPE_* constants
* xlat/bpf_map_types.in: Add BPF_MAP_TYPE_PERCPU_HASH,
BPF_MAP_TYPE_PERCPU_ARRAY, and BPF_MAP_TYPE_STACK_TRACE introduced by
linux kernel commits v4.6-rc1~91^2~326^2~5, v4.6-rc1~91^2~326^2~4, and
v4.6-rc1~91^2~212^2~1, respectively.
2016-03-29 00:28:11 +00:00
ce515ddda4 Update SO_* constants
* xlat/sockoptions.in: Add SO_CNX_ADVICE introduced by linux kernel
commit v4.6-rc1~91^2~176.
2016-03-29 00:20:37 +00:00
ebd1124bce Update SEGV_* constants
* xlat/sigsegv_codes.in: Add SEGV_PKUERR introduced by linux kernel
commit v4.6-rc1~68^2~23.
2016-03-29 00:17:19 +00:00
dbc68b7034 avr32: wire up copy_file_range syscall
* linux/avr32/syscallent.h [325]: Add copy_file_range entry.
2016-03-29 00:01:07 +00:00
JayRJoshi
d2029cc4a1 tests/uname.test: check abbreviated output, use print_quoted_string
* tests/uname.c (main): Use print_quoted_string to print
utsname members.  Add abbrev check.
* tests/uname.test: Add abbrev check.
2016-03-28 23:25:30 +00:00
90406df134 faccessat.test: robustify against libcs invoking faccessat syscall on their own
* tests/faccessat.c (TMP_FILE): Rename to sample, change its value
to "faccessat.sample".
* tests/faccessat.test: Rewrite using openat.test.
2016-03-28 00:16:17 +00:00
347a5d45ec openat.test: robustify against libcs invoking openat syscall on their own
* tests/openat.c (main): Rename fname to sample, change its value
to "openat.sample".
* tests/openat.test: Use -P option to filter out openat syscalls
made by libc and dynamic linker.
2016-03-28 00:16:02 +00:00
f09a474877 tests: add open.test
* tests/open.c: New file.
* tests/open.test: New test.
* tests/.gitignore: Add open.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add open.test.
2016-03-28 00:15:15 +00:00
e17f28dce0 Update generic ioctl entries from linux 4.5
* linux/64/ioctls_inc.h: Update from linux v4.5 using ioctls_gen.sh.
* linux/32/ioctls_inc_align32.h: Likewise.
* linux/32/ioctls_inc_align64.h: Likewise.
* NEWS: Mention this.
2016-03-27 00:03:27 +00:00
e7794ae36c maint: update for linux 4.5
* maint/ioctls_sym.sh: Update workarounds for drm/*_drm.h files.
Add workarounds for xen/gntdev.h and net/nfc/nci_core.h files.
Update path of saa6588.h and exynos-fimc.h files.
2016-03-26 23:37:18 +00:00
9d91928320 Fix decoding of device numbers in mknod and mknodat syscalls
* mknod.c (decode_mknod): Treat device number argument as unsigned int.
* tests/mknod.c: Include <sys/sysmacros.h> or <sys/mkdev.h>
for definition of makedev macro.
(main): Add a check for a character special file.
2016-03-25 23:48:48 +00:00
b0e507f39d sparc64: fix decoding of mknod and mknodat syscalls for sparc personality
Remove remnants of solaris personality support in mknod parser
that resulted to sparc personality being decoded as old solaris
personality.  This complements commit v4.10-45-gdf4dd8b and fixes
commit v4.10-46-g588a90f.

* mknod.c (decode_mknod) [SPARC || SPARC64]: Remove.
2016-03-25 23:48:48 +00:00
Katerina Koukiou
6598026d6a tests: add openat.test
* tests/openat.c: New file.
* tests/openat.test: New test.
* tests/.gitignore: Add openat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add openat.test.
2016-03-25 19:40:12 +00:00
Fei Jie
896479de76 tests: add renameat.test
* tests/renameat.c: New file.
* tests/renameat.test: New test.
* tests/.gitignore: Add renameat.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add renameat.test.
2016-03-25 09:47:16 +00:00