summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
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>
2019-01-10io_queue_init: pass in flags, not io_uring_paramsJens Axboe
We don't need any of the information in there in the caller, and this makes it harder to abuse as we don't require the caller to have memset() the struct first. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-10Fix test casesJens Axboe
- Don't use polled IO for the io_uring-test, that'll fail if the fs/device doesn't suppor it - copy read-in was broken for io_uring-cp Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-10Update to newer APIJens Axboe
- Fixed buffers are now available through io_uring_register() - Various thread/wq options are now dead and automatic instead - sqe->index is now sqe->buf_index - Fixed buffers require flag, not separate opcode Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-10Update APIJens Axboe
- io_uring_sqe added a data field that's passed back at completion - io_uring_sqe added an index field, for fixed buffer locations - io_uring_setup(2) system call added a 'nr_iovecs' field Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-09Update to newer APIJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08liburing: include the ring fd in the io_uringJens Axboe
No point in keeping these separate. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08Add simple test/ MakefileJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08Add sample 'cp' programJens Axboe
Don't rely on this for anything, it's just a test case / demo. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08Change API to provide io_uring struct abstractionJens Axboe
This is cleaner than having the app juggle an SQ and CQ ring, just wrap them in struct io_uring and have the API always take that. This means the app doesn't need to worry about the different types of rings, and that we only need to pass in one argument for setup/teardown. Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-08Initial commitJens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>