diff mbox series

[liburing,2/3] tests: test DEFER_TASKRUN in poll-many

Message ID ab0dd0f1f8d656ad7e647027c5040d0e99dd8828.1673886955.git.asml.silence@gmail.com (mailing list archive)
State New
Headers show
Series test lazy poll wq activation | expand

Commit Message

Pavel Begunkov Jan. 16, 2023, 4:46 p.m. UTC
We want to extend DEFER_TASKRUN test coverage for polling, so
make poll-many.c to test it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 test/poll-many.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/test/poll-many.c b/test/poll-many.c
index ebf22e8..da3da21 100644
--- a/test/poll-many.c
+++ b/test/poll-many.c
@@ -208,6 +208,20 @@  int main(int argc, char *argv[])
 		return T_EXIT_FAIL;
 	}
 	io_uring_queue_exit(&ring);
+
+	if (t_probe_defer_taskrun()) {
+		params.flags |= IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_DEFER_TASKRUN;
+		ret = io_uring_queue_init_params(RING_SIZE, &ring, &params);
+		if (ret) {
+			fprintf(stderr, "ring DEFER setup failed: %d\n", ret);
+			return T_EXIT_FAIL;
+		}
+		if (do_test(&ring)) {
+			fprintf(stderr, "test (DEFER) failed\n");
+			return T_EXIT_FAIL;
+		}
+		io_uring_queue_exit(&ring);
+	}
 	return 0;
 err_nofail:
 	fprintf(stderr, "poll-many: not enough files available (and not root), "