Commit Graph

323 Commits

Author SHA1 Message Date
Max Kellermann babcca7c79 test/lfs-openat: open dfd with O_PATH
This triggers a bug present until at least Linux 5.6.11, causing
EBADF, see https://lkml.org/lkml/2020/5/7/1287

Signed-off-by: Max Kellermann <mk@cm4all.com>
2020-06-22 23:06:01 +02:00
Jens Axboe 6bcd306fa2 test/timeout-overflow: use #X for the timeout number
'th doesn't really work for 1/2/3 timeouts, just use # to make it
clear we're dealing with the timeout number.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-22 10:25:17 -06:00
Jens Axboe 5c63fc08da test/runtests.sh: make default timeout be 60 seconds
30 seconds is just a bit too short if the tests are run with
KASAN and PROVE_LOCKING enabled, make it 60 seconds instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-21 20:59:01 -06:00
Bart Van Assche 45ed6e8a4a Makefiles: Enable -Wextra
Enable -Wextra and disable the unused parameter and different signedness
in comparison warnings.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-21 20:49:50 -06:00
Pavel Begunkov fc3dc5b19d test/stdout: fix strcmp non-\0 string
After copying len(str) bytes of a string, the copy won't necessary have
\0 terminator, that makes test_pipe_io_fixed() to fail. Use memcmp().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-16 13:47:13 -06:00
Jens Axboe a81c0849f9 test/runtests.sh: add dmesg check
Lifted this from blktests, basically it just checks for known patterns
of kernel complaints. If we trigger one while running a test, we fail
the test case.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-15 10:49:27 -06:00
Jens Axboe 021025b6ec test/send_recv: add SQPOLL test case
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-10 19:01:56 -06:00
Jens Axboe bc765b01ff Add test/close-opath.c
This tests whether we can close an O_PATH opened fd. Test program
is an edited version of one from Clay Harris <bugs@claycon.org>, found
here:

https://claycon.org/software/io_uring/tests/close_opath.c

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-09 19:50:30 -06:00
Jens Axboe 10d2ffc8d1 test/runtests.sh: improve failed list
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-01 14:19:24 -06:00
Jens Axboe b00ca4081e test/iopoll: skip test if file/device/fs doesn't supported polled IO
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-29 11:35:33 -06:00
Jens Axboe 93e13bc25a test/file-register: ensure write vs read is ordered
We submit both the read and write at the same time, there's no guarantee
the write is even started by the time the read is issued. Play it safe
and wait for the write before starting the read.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-23 16:52:43 -06:00
Jens Axboe f824a63713 test/runtests.sh: include argument for failed test concatenation
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-23 16:38:59 -06:00
Jens Axboe 5d27b05ec9 test/eventfd-disable: ignore test when an argument is given
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-20 11:13:25 -06:00
Stefano Garzarella 87d2753fde Add test/eventfd-disable.c test case
This new test checks if the mechanism to enable/disable notifications
through eventfd when a request is completed works correctly.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-20 11:09:04 -06:00
Jens Axboe 4f18c82de3 test: use config.local for runtests.sh
Add it to .gitignore as well. This makes it easier to have a local
configuration that isn't overwritten by resetting the git tree, or
pulling changes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-20 09:32:11 -06:00
Jens Axboe 0845b537a3 Add test case for SQPOLL -EBUSY bug
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-20 07:36:21 -06:00
Jens Axboe 3827276e9f test/runtests.sh: check if configured test files exist
Helps to catch early if you're missing a module load or filesystem
mount.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 22:04:33 -06:00
Jens Axboe 9bc68a1862 test/fadvise: support configured test files
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 21:58:31 -06:00
Jens Axboe 45099a4537 test/madvise: support configured test files
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 21:57:40 -06:00
Jens Axboe 5a1f4e3349 test/read-write: support configured test files
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 21:53:58 -06:00
Jens Axboe fce9567aa5 test/iopoll: add buf_select test case
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 21:48:06 -06:00
Jens Axboe 24a7afc64f test/iopoll: add polled IO test case
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 18:41:57 -06:00
Jens Axboe 00abd4b8cd test: add option to run with defined test files / devices
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 18:38:40 -06:00
Jens Axboe 6c32e92bb0 test: add potential argument, ignore if unused
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-19 17:36:19 -06:00
Pavel Begunkov ce72c30068 splice/tee/tests: test len=0 splice/tee
Check zero-length splice() and tee().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-17 14:23:23 -06:00
Pavel Begunkov 89ad6dc489 tee/test: add test for tee(2)
Add tee() tests with pipe data validation

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-17 14:23:23 -06:00
Pavel Begunkov 6005a2fb74 splice/test: improve splice tests
Split and test functionality separately, better cover registered files
cases, and validate file\pipe actual data.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-17 14:23:23 -06:00
Jens Axboe f17da76111 test/open-close: fix race with closing ring itself
Depending on timing, we can get -EBADF from the waiting on a
completion. This is fine, as we've closed the ring itself, so we
cannot rely the completion coming in, it'll depend completely on
the timing of events.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-15 10:50:04 -06:00
Pavel Begunkov ff7cda19f8 test/sfr: basic test for sync_file_range
Just call it and check that it doesn't hang and returns success.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-05-01 08:48:25 -06:00
Jens Axboe a4addb3657 test/link-timeout: FASTPOLL kernels can cancel successfully
We expect -EALREADY since an async worker was previously holding this
request, but for kernels with FASTPOLL (5.7+), we can successfully
cancel from the timeout. Allow -ETIME as well for the return value of
the linked timeout.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-30 10:21:03 -06:00
Jens Axboe a375473939 test/statx: add test case for AT_EMPTY_PATH + valid fd
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-27 10:51:30 -06:00
Jens Axboe 0e5568c707 Fix 32-bit warnings on compile
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-24 07:47:50 -06:00
Jens Axboe 2749d15774 test: use mmap() directly in syzbot generated code
Guillem reports that some new 32-bit architectures like armel and armhf
don't have mmap, just mmap2. Just use mmap() and let libc deal with
it, there's no reason why we need to call the specific mmap() system
call.

Reported-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-24 07:41:30 -06:00
Jens Axboe 8259505e96 configure: check for struct statx
If not there, don't build the test program test/statx

Fixes: https://github.com/axboe/liburing/issues/101
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-09 09:58:59 -06:00
Jens Axboe 0dcf490931 test/lfs-openat-write: return the correct error
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-08 09:56:52 -06:00
Jens Axboe 969ab6fdff Coding style cleanups
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-08 09:55:52 -06:00
Jens Axboe 3bf2159729 test/lfs-openat-write: test LFS writes with OPENAT file
Heavily based on test case from Dmitry Kadashev <dkadashev@gmail.com>

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-08 09:48:43 -06:00
Jens Axboe a47b583590 test/lfs-openat: unlink the right file
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-08 09:48:16 -06:00
Jens Axboe 9c42ac4424 Add LFS openat test
Heavily based on test case from Dmitry Kadashev <dkadashev@gmail.com>

Link: https://lore.kernel.org/io-uring/cc076d44-8cd0-1f19-2e79-45d2f0c5ace3@kernel.dk/T/#m894080c2370f51dd31cba85276d19b2720bc92a1
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-08 09:37:42 -06:00
Jens Axboe 53d4892db5 test/read-write: skip IOSQE_ASYNC if not supported
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-23 08:58:55 -06:00
Jens Axboe fed116f9ff test/read-write: add RLIMIT_SIZE test case
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-20 15:16:36 -06:00
Jens Axboe b26eaab8be test/fallocate: add test case for exceeding RLIMIT_FSIZE
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-20 15:08:02 -06:00
Jens Axboe 0f6c68999f test/link-timeout: accept -ECANCELED for bad address write as well
We just check for -EFAULT, but -ECANCELED is also OK and will happen
on later kernels since we check earlier there for prep and defer.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-14 17:17:01 -06:00
Jens Axboe 14bec8eb77 test/read-write: add test case for links with async/drain
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-14 17:00:15 -06:00
Jens Axboe acf0924c2a test/test/sq-space_left: test kernel vs liburing side sync on short submit
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-13 08:53:42 -06:00
Jens Axboe 293330b078 Change 'gid' to 'bgid' for providing buffers
This makes it clear it's a buffer group ID, and not some variant of
a credential related group ID.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-11 07:50:04 -06:00
Jens Axboe ef7d1fdf0c test/read-write: add more buffer select tests
Test both vectored and non-vectored reads, and also add two test
cases for vectored and non-vectored short reads.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-10 09:00:54 -06:00
Taylor f5ebe0faa1 Fix warnings when compiling tests
On certain architectures, like ppc64, __u64 is a typedef of unsigned long
rather than unsigned long long, which causes warnings when compiling tests
that use the %llu printf specifier.

If __SANE_USERSPACE_TYPES__ is defined before including <linux/types.h>,
__u64 will instead be a typedef of unsigned long long.
2020-03-08 16:43:44 -07:00
Jens Axboe 5afe10ef3b test/send_recvmsg: cleanup on abort
If we don't have PROVIDE_BUFFERS, then ensure we free the ring, and
(more importantly) up the mutex so we don't hang.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-02 21:48:46 -07:00
Jens Axboe dc7a54e3d9 test/splice: don't use memfd
The previous include is not enough, some older distros don't have
the memfd_create() in libc. Just get rid of it and open a regular
file instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-03-02 09:53:38 -07:00