summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2019-07-24src/Makefile: keep private headers in <liburing/*.h>Stefan Hajnoczi
It is not possible to install barrier.h and compat.h into the top-level /usr/include directly since they are likely to conflict with other software. io_uring.h could be confused with the system's kernel header file. Put liburing headers into <liburing/*.h> so there is no chance of conflicts or confusion. Existing applications continue to build successfully since the location of <liburing.h> is unchanged. In-tree examples and tests require modification because src/liburing.h is moved to src/include/liburing.h. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-07-09Add regression test cases for kthread stuckJackie Liu
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-07-08Make runtests.sh output test to dmesgJens Axboe
Can be useful to figure out which test crashed. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-07-08Fix the 32-bit buildBart Van Assche
Fix the warnings reported when building liburing as follows: make CFLAGS=-m32 Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-07-08Makefiles: Support specifying CFLAGS on the command lineBart Van Assche
This patch makes the liburing build work as expected for e.g. the following command: make CFLAGS=-m32 and avoids that the build fails as follows for the above command: make[1]: Entering directory 'liburing/test' cc -m32 -o poll poll.c -luring /usr/bin/ld: cannot find -luring collect2: error: ld returned 1 exit status Makefile:18: recipe for target 'poll' failed make[1]: *** [poll] Error 1 make[1]: Leaving directory 'software/liburing/test' Makefile:12: recipe for target 'all' failed make: *** [all] Error 2 Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-07-02Fix the use of memory barriersBart Van Assche
Introduce the smp_load_acquire() and smp_store_release() macros. Fix synchronization in io_uring_cq_advance() and __io_uring_get_cqe(). Remove a superfluous local variable, if-test and write barrier from __io_uring_submit(). Remove a superfluous barrier from test/io_uring_enter.c. Cc: Stefan Hajnoczi <stefanha@redhat.com> Cc: Roman Penyaev <rpenyaev@suse.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-06-04Add basic helpers for file/buffer registrationJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-06-04test/ring-leak: use static array for io_uring_register()Jens Axboe
Don't leak the memory. We never need to reference it from the test app once the io_uring_register() call is done. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-06-04test/io_uring_register: don't test buffer size if too largeJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-27test/fsync: use io_uring_sqe_set_flags()Jens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-24test/send_recvmsg: code cleanups and error handlingJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-23Add send/recvmsg test caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-14test/io_uring_register: don't fail max fd test if we run out of memJens Axboe
We need a lot of RAM for this case, my vm always fails it. Don't hard fail due to ENOMEM, just skip the test. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-14Add chain failure handling test caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-13Add link SQE supportJens Axboe
Just a basic test case that does various forms of linked nops, and a sample bare bones copy program using linked reads and writes. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-01test/eeed8b54e0df-test: define RWF_NOWAIT if we don't have itJens Axboe
Older installs/distros don't have this in fs.h. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-01test/io_uring_setup: don't fail SQPOLL test case for non-rootJens Axboe
SQPOLL requires root, if the tests are run as a user, we'll get EPERM instead of EINVAL. Don't fail the test because of that, just mention it in the log. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-01test/eeed8b54e0df-test: check write(2) return valueJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-01liburing: improve output for test/io_uring_setup.cShenghui Wang
For the IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF test case, add_pipe is not set, and the output is like: "...flags: IORING_SETUP_SQPOLLIORING_SETUP_SQ_AFF...". Set add_pipe for IORING_SETUP_SQPOLL flag so that the output is like: "...flags: IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF...". Acked-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Shenghui Wang <shhuiw@foxmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-30Update tests for 'sqe submit always posts a cqe'Jens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-30test/runtests.sh: list all failed tests when doneJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-25Add test case for -EAGAIN issueJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-23Add regression test cases for three recent issuesJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-23Actually add test/runtests.shJens Axboe
This adds the missing shell script that runs the tests. Fixes: 4916320ec374 ("Separate test cases from examples") Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-18Rename completion helpersJens Axboe
We have io_uring_get_sqe() on the submission side, yet the completion side is named _completion. Rename as follows: io_uring_get_completion() io_uring_peek_cqe() iO_uring_wait_completion() io_uring_wait_cqe() This better tells the user what the _get variant does by calling it _peek instead, and we move to using _cqe() as the postfix instead of _completion. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-17Separate test cases from examplesJens Axboe
Also adds a runtests makefile target.
2019-04-17Add io_uring_cqe_seen()Jens Axboe
There's a failure case where an application gets a cqe entry, but the kernel can then overwrite it before the application is done reading it. This can happen since the io_uring_{get,wait}_completion() interface both returns a CQE pointer AND increments the ring index. If the kernel reuses this entry before the applications is done reading it, the contents may be corrupted. Remove the CQ head increment from the CQE retrieval, and put it into a separate helper, io_uring_cqe_seen(). The application must call this helper when it got a new CQE entry through one of the above calls, and it's now done reading it. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-17Add SQ/CQ overflow testsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-11test/nop: add NOP test caseJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-11test/fsync: error out if we submit less than we wantedJens Axboe
This failure is expected on kernels that don't support the DRAIN primitive. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-10test/fsync: update for IOSQE_IO_DRAIN approachJens Axboe
I generalized the barrier flag to be applicable to all commands, so let's drop the fsync special flag. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-07Use io_uring_cqe_get_data() internallyJens Axboe
Replace all cqe->user_data casts with io_uring_cqe_get_data(). Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-04-06Add barrier fsync test caseJens Axboe
Also changes the fsync prep helper to require passing in the actual flag, not just a boolean for fsync vs fdatasync. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-06test/io_uring-cp: add some commentsJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-05test/io_uring-cp: make it more efficientJens Axboe
Clean it up, and just use a single io_uring for both the reads and the writes. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-04add syscall unit testsJeff Moyer
Add tests for io_uring_setup, io_uring_register and io_uring_enter. The test coverage is nowhere near complete and the reporting is not uniform. But, it's a start. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08test/fsync: add simple fsync testerJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-08test/ring-leak: silence "sending fd" messageJens Axboe
We assume that a silent test is good. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-02-07test/ring-leak: add test app demonstrating leak of io_uring instanceJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-18test/poll: ignore parent dyingJens Axboe
The parent may well die before the child is done, as long as it wrote to the pipe, we're fine. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-18test/poll: simply test caseJens Axboe
Just setup one ring in the child process, and poll for when the read side of the pipe is readable. From the parent, write something to the pipe. If nothing happens within 1 second, fail the test. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-18test/poll-cancel: improve test caseJens Axboe
- Add a timeout, if we don't finish in one second we are definitely hung because the poll remove command didn't work. - Don't assume completion ordering Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-18Switch to IORING_OP_POLL_ADD/REMOVEJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-1732-bit fixesJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17Add sqe prep helpersJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17Update POLL APIJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17Add IORING_OP_POLL_CANCEL testJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-17Add test case for IORING_OP_POLLJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-16Sync with upstream APIJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-11Sync with kernel APIJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>