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 9c1a72cd3f3d52d573876ce474b620a5f141fb1b.
* 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