diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-04-30 14:50:36 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-04-30 14:50:36 -0600 |
commit | ce8e2bc298c7dc8604a908136b9563ff6b986674 (patch) | |
tree | 5b7e76ccfb62ac0ab3286c1b90acb4cd70877131 | |
parent | 49d2017b3df8d5a98fd3b5293fcfe36c747bd1bd (diff) |
Update tests for 'sqe submit always posts a cqe'
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | test/eeed8b54e0df-test.c | 16 | ||||
-rw-r--r-- | test/fsync.c | 5 |
2 files changed, 18 insertions, 3 deletions
diff --git a/test/eeed8b54e0df-test.c b/test/eeed8b54e0df-test.c index 428b42b..f9ddfb3 100644 --- a/test/eeed8b54e0df-test.c +++ b/test/eeed8b54e0df-test.c @@ -47,6 +47,7 @@ int main(int argc, char *argv[]) { struct io_uring ring; struct io_uring_sqe *sqe; + struct io_uring_cqe *cqe; struct iovec iov; int ret, fd; @@ -74,8 +75,19 @@ int main(int argc, char *argv[]) sqe->rw_flags = RWF_NOWAIT; ret = io_uring_submit(&ring); - if (ret != -EAGAIN) { - printf("Got submit %d, expected EAGAIN\n", ret); + if (ret != 1) { + printf("Got submit %d, expected 1\n", ret); + goto err; + } + + ret = io_uring_peek_cqe(&ring, &cqe); + if (ret) { + printf("Ring peek got %d\n", ret); + goto err; + } + + if (cqe->res != -EAGAIN) { + printf("cqe error: %d\n", cqe->res); goto err; } diff --git a/test/fsync.c b/test/fsync.c index de28c2c..c9c2c5d 100644 --- a/test/fsync.c +++ b/test/fsync.c @@ -112,6 +112,9 @@ static int test_barrier_fsync(struct io_uring *ring) printf("child: wait completion %d\n", ret); goto err; } + /* kernel doesn't support IOSQE_IO_DRAIN */ + if (cqe->res == -EINVAL) + break; if (i <= 3) { if (cqe->user_data) { printf("Got fsync early?\n"); @@ -153,7 +156,7 @@ int main(int argc, char *argv[]) ret = test_barrier_fsync(&ring); if (ret) { - printf("test_single_fsync failed\n"); + printf("test_barrier_fsync failed\n"); return ret; } |