path: root/test
AgeCommit message (Collapse)Author
2019-11-05Add IORING_OP_LINK_TIMEOUT test caseslink-timeoutJens Axboe
Tries to cover a wide variety of things that could go wrong. Signed-off-by: Jens Axboe <>
2019-11-04Printout correct failure locations in test/timeout.cHrvoje Zeba
Some printouts were misleading, probably a c/p bug. Signed-off-by: Hrvoje Zeba <> Signed-off-by: Jens Axboe <>
2019-11-04Use msec parameter instead of TIMEOUT_MSEC in msec_to_ts()Hrvoje Zeba
Small fix to make sure correct ts structure is filled with correct values. Signed-off-by: Hrvoje Zeba <> Signed-off-by: Jens Axboe <>
2019-10-30liburing/test: fix build errorsJoseph Qi
Fix the following errors when make: error: ‘for’ loop initial declarations are only allowed in C99 mode error: redeclaration of ‘i’ with no linkage Signed-off-by: Joseph Qi <> Signed-off-by: Jens Axboe <>
2019-10-29Add test/io-cancelJens Axboe
This tests normal reads and writes mixed with IO cancellations. Signed-off-by: Jens Axboe <>
2019-10-27Add read/write test that does various combinations of IOJens Axboe
Tests a mixed of buffered, direct, SQTHREAD, fixed buffers. Signed-off-by: Jens Axboe <>
2019-10-25test/file-register: add huge file set test caseJens Axboe
Add a test case that registers 8K files (sparse), then does a file set update of a random file late in the set and performs some IO to it to ensure it works. Signed-off-by: Jens Axboe <>
2019-10-25test/defer: Test deferring with drain and linksPavel Begunkov
1. test user_data integrity with cancelled links 2. test the whole link is cancelled by sq_thread 3. hunging io_uring based on koverflow and kdropped Be aware, that this test may leave unkillable user process, or unstopped actively polling kthread. Signed-off-by: Pavel Begunkov <> Signed-off-by: Jens Axboe <>
2019-10-24Add runtests-loop targetJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-24test/send_recvmsg: hopefully make it reliableJens Axboe
Split the recv part in prep, sync, then receive. This should make it more reliable, hopefully. Signed-off-by: Jens Axboe <>
2019-10-24test/send_recvmsg: ensure we exitJens Axboe
We may never get the data from the socket read, and this requires someone to SIGINT the test. Let's quit after 1 second if we haven't received anything. If the test is actually hung, the alive worker detection will catch it. Signed-off-by: Jens Axboe <>
2019-10-24test/ only log first test to have alive workers on exitJens Axboe
We still collect all of them, but no point spewing during the run. Signed-off-by: Jens Axboe <>
2019-10-24test/accept: add test to see if we cancel correctly on exitJens Axboe
This will exit with 0 in both the normal and failure case, but the failure case will leave workers idle once done. We check for that in now. Signed-off-by: Jens Axboe <>
2019-10-24test/ check for remaining io_uring workers on exitJens Axboe
That usually indicates a hang issue where we don't properly exit. Log is as _maybe_ failed. Note that if you see maybe failed, then the last in the list is likely the culprit. Signed-off-by: Jens Axboe <>
2019-10-23test/timeout: add multi timeout reqs test with different countzhangyi (F)
Add multi timeout reqs test case which want to test submitting timeout reqs with different count number, check the return sequence and the status of each req. Signed-off-by: zhangyi (F) <> Signed-off-by: Jens Axboe <>
2019-10-23test/timeout: add multi timeout reqs test with different timeoutzhangyi (F)
Add multi timeout reqs test case which want to test submitting timeout reqs with different timeout value, check the return sequence and the status of each req. Signed-off-by: zhangyi (F) <> Signed-off-by: Jens Axboe <>
2019-10-21Shorten timeout testsJens Axboe
We use 1s for a lot of testing, shrink it down to 200 msec to allow it to run a bit quicker. Signed-off-by: Jens Axboe <>
2019-10-21Add test for overflow of timeout request's sequenceyangerkun
Before 5da0fb1ab34c ("io_uring: consider the overflow of sequence for timeout req"). We can meet some situation like below: 1. setup 2. prepare 4 timeout req which expected count is 1,1,2,UINT_MAX, and the sequence of this 4 requests will be 1,2,4,2, this 4 requests will not lead the change of cached_cq_tail and sq_dropped until the timeout really happened. So the tail_index in io_timeout will still be 0. 3. based on the above and before this patch, the order of timeout_list will be req1->req2->req4->req3, which the right order should be req1->req2->req3->req4. 4. setup two nop requests. And the timeout requests will return correctly with the patch. Add this testcase to cover it. Signed-off-by: yangerkun <> Signed-off-by: Jens Axboe <>
2019-10-18test/accept: fix a few errorsJens Axboe
- Don't re-init the io_uring - SQPOLL can fail with -EBADF or -EINVAL, depends on which path the sqe takes. Signed-off-by: Jens Axboe <>
2019-10-18test/accept: test that we -EINVAL for accept with SQPOLLJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-17Add simple IORING_OP_ACCEPT test caseJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-17test/socket-rw.c: use TCP, not pipesJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-17Add deadlock socket read/write test caseJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-17Un-DOSify test/232c93d07b74-test.cJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-17Add test case for non-blocking socket reads/writesJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-16Add IORING_OP_TIMEOUT_REMOVEJens Axboe
Add the command opcode, and add two test cases for it. Signed-off-by: Jens Axboe <>
2019-10-16test/timeout: cleanup cqe seen and error printsJens Axboe
Use stderr always, and include the function name. Signed-off-by: Jens Axboe <>
2019-10-15Make io_uring_prep_timeout() take timeout flagsJens Axboe
Not in a released version yet, plan for using the flags since we already have the IORING_TIMEOUT_ABS flag. Signed-off-by: Jens Axboe <>
2019-10-15Add test case for absolute timeoutsJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-14Add test case for skb/socket ref count issues with fully sparse file setJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-09Add regression test case for commit 8a9973408177Jens Axboe
Anything that causes an async punt after a fileset has been unregistered will cause a NULL pointer deref. Add a test case for that. We use fsync() since that will always need an async punt. Signed-off-by: Jens Axboe <>
2019-10-08test/ distinguish between failed and OK timeoutsJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-08test/cq-size: use 'ret', not 'errno' directlyJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-08b/test/file-register: convert to library functions and clean upJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-08test/ check for root before using /dev/kmsgJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-07test/file-register: close/unlink test_shrink() filesJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-07test/file-register: catch succeeding with too many fdsJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-04Add test case for application specified cq ring sizeJens Axboe
Signed-off-by: Jens Axboe <>
2019-10-04test/file-register: add test case for zero initial fdsJeff Moyer
Then grow it by one. Signed-off-by: Jens Axboe <>
2019-10-03test/ make default timeout 30s, not 10sJens Axboe
The file register test takes more than 10 seconds, let's bump the timeout. We really need a way to signal if we expect to terminate a test through a timeout, which would make the timeout expected, or whether having to terminate it with timeout constitutes a failure. Signed-off-by: Jens Axboe <>
2019-10-03test/file-register: add grow/shrink casesJens Axboe
Register file set with room for 300, but use 50. Grow to the max and see if we can get to 300. Register file set of 50, shrink to 0. Signed-off-by: Jens Axboe <>
2019-10-03Add test/file-registerJens Axboe
Tests both existing functionality, but also the new sparse maps, update/remove/add functionality. Signed-off-by: Jens Axboe <>
2019-10-01Switch to 32/64-bit agnostic timeout formatJens Axboe
We made a kernel change to support timeouts properly on 32-bit archs, update liburing to use __kernel_timespec instead of the differently sized timespec. Signed-off-by: Jens Axboe <>
2019-09-27Fold io_uring_wait_cqes_timeout() with io_uring_wait_cqes()Jens Axboe
We also need the sigset for certain setups, and adding a third option is pretty crazy. Since io_uring_wait_cqes_timeout() isn't in a released version yet (and neither is io_uring_wait_cqes()), make the necessary adjustments. Signed-off-by: Jens Axboe <>
2019-09-25Add io_uring_peek_batch_cqe()James Rouzier
io_uring_peek_batch_cqe(), get multiple cqe from the queue at once. Returns the number of cqe gotten. test/cq-peek-batch.c: tests io_uring_peek_batch_cqe() Signed-off-by: James Rouzier <>
2019-09-25Add io_uring_cq_ready()James Rouzier
io_uring_cq_ready(), returns the number of completions that are ready. test/cq-ready.c: tests io_uring_cq_ready Signed-off-by: James Rouzier <>
2019-09-23Add STDOUT write testJens Axboe
This will fail if we don't support non ->write_iter() fops. Signed-off-by: Jens Axboe <>
2019-09-22Makefile: handle quiet AR/RANLIBJens Axboe
Also unify across subdirs. Signed-off-by: Jens Axboe <>
2019-09-21Makefile: add pretty/quiet CC/LN outputJens Axboe
Signed-off-by: Jens Axboe <>
2019-09-21Generalize Makefiles for examples and test.James Rouzier
Signed-off-by: James Rouzier <>