Update tests for 'sqe submit always posts a cqe'

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2019-04-30 14:50:36 -06:00
parent 49d2017b3d
commit ce8e2bc298
2 changed files with 18 additions and 3 deletions

View File

@@ -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;
}