Commit Graph

12 Commits

Author SHA1 Message Date
c6782f144a tests: change the license to GPL-2.0-or-later
strace test suite is now provided under the terms of the GNU General
Public License version 2 or later, see tests/COPYING for more details.
2018-12-10 00:00:00 +00:00
1dc2a5313c Stop using SIG_0
Number 0 is not a valid signal number, and SIG_0 is not a valid
description for a signal.

* linux/signalent.h: Replace SIG_0 with 0.
* linux/alpha/signalent.h: Likewise.
* linux/hppa/signalent.h: Likewise.
* linux/mips/signalent.h: Likewise.
* linux/sparc/signalent.h: Likewise.
* filter_qualify.c (sigstr_to_uint): Start iterations with number 1.
* tests/fcntl-common.c (test_fcntl_others): Update expected output.
* tests/kill.c (main): Likewise.
* tests/ptrace.c (test_peeksiginfo): Likewise.
* tests/s390_runtime_instr.c (main): Likewise.
2018-11-27 01:13:40 +00:00
Zhibin Li
fd5765aad8 tests: extend coverage for other fcntl flags
* tests/fcntl-common.c: Include <assert.h>.
(struct fcntl_cmd_check): New structure.
(print_retval_flags, test_other_set_cmd, test_other_get_cmd,
print_flags_getfd, print_flags_getsig, print_flags_getlease,
test_fcntl_others): New functions.
(main): Use test_fcntl_others.
2018-07-12 08:51:04 +00:00
2b6e074846 Update copyright headers
Headers updated automatically using maint/update_copyright_years.sh
script.
2018-06-14 11:00:00 +00:00
Zhibin Li
08b2c1b82d tests: check short read of struct flock/flock64
* tests/fcntl-common.c (test_flock_einval): Check short read
of struct flock.
(test_flock64_einval): Check short read of struct flock64.
2018-06-01 01:46:06 +00:00
dbbe61067c tests: extend struct flock/flock64 decoding checks
* tests/fcntl-common.c (test_flock_einval, test_flock): Create
struct_kernel_flock object using tail_alloc.
(test_flock64_einval): Create struct_kernel_flock64 object using
tail_alloc.
* tests/fcntl64.c (test_flock64_lk64): Likewise.
2018-06-01 01:46:06 +00:00
d476d264de tests: extend F_OFD_* decoding checks
Check that non-faulty F_OFD_* fcntl operations are decoded properly.

* tests/fcntl-common.c: Include <string.h>.
(test_flock64_ofd): New function.
(test_flock64): Invoke it, remove [F_OFD_SETLK].
2018-06-01 01:46:06 +00:00
b6542c5068 tests/fcntl-common.c: define and initialize errstr
Initialize errstr inside invoke_test_syscall so that its users
won't have to go into trouble of caring about clobbering errno.

* tests/fcntl-common.c (errstr): New variable.
(invoke_test_syscall): Initialize it.
(test_flock_einval, test_flock64_einval, test_flock,
test_f_owner_ex_type_pid): Use it.
* tests/fcntl.c (test_flock64_undecoded): Likewise.
* tests/fcntl64.c (test_flock64_lk64): Likewise.
2018-06-01 01:46:06 +00:00
419da8e231 tests/fcntl-common.c: add fd argument to invoke_test_syscall
Extend invoke_test_syscall for later use with different file
descriptors.

* tests/fcntl-common.c (invoke_test_syscall): Add fd argument, pass it
to TEST_SYSCALL_NR syscall.  All users updated.
2018-06-01 01:46:06 +00:00
9c7052f403 tests: move F_OFD_SETLK* checks from fcntl64.c to fcntl-common.c
This change enables F_OFD_SETLK* tests for fcntl as well.

* tests/fcntl64.c (test_flock64): Rename to test_flock64_lk64.
[F_OFD_SETLK]: Remove.
(test_flock64_einval): Move ...
* tests/fcntl-common.c: ... here.
(test_flock64_lk64): New protype.
(test_flock64_einval, test_flock64): New functions.
* tests/fcntl.c (test_flock64_einval): Rename to test_flock64_undecoded.
(TEST_FLOCK64_UNDECODED): New macro.
(test_flock64): Rename to test_flock64_lk64, replace TEST_FLOCK64_EINVAL
with TEST_FLOCK64_UNDECODED.
2018-06-01 01:46:06 +00:00
3160ea8999 tests: move F_OWNER_* tests to fcntl-common.c
This change enables F_OWNER_* tests for fcntl64 as well.

* tests/fcntl.c: Move main, [TEST_FLOCK64_EINVAL],
and [TEST_F_OWNER_EX] ...
* tests/fcntl-common.c: ... here.
(test_flock64): New prototype.
* tests/fcntl64.c (main): Remove.
2018-06-01 01:46:06 +00:00
da78779d37 tests: rename struct_flock.c to fcntl-common.c
It is not limited to struct flock, more fcntl tests are going to land
in this file.

* tests/struct_flock.c: Rename to fcntl-common.c.
* tests/Makefile.am (EXTRA_DIST): Rename struct_flock.c
to fcntl-common.c.
* tests/fcntl.c: Likewise.
* tests/fcntl64.c: Likewise.
2018-06-01 01:46:06 +00:00