Skip to contentSkip to conversation

tests: test early-submit link fails

PATCH Applied Pavel Begunkov 3 participants 4 messages Aug 31, 2021 – Sep 1, 2021 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests: test early-submit link fails

Add a whole bunch of tests for when linked requests fail early during submission.

---

v2: correct io_uring_submit() ret checks with !drain

 .gitignore              |   1 +
 test/Makefile           |   2 +
 test/submit-link-fail.c | 150 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 153 insertions(+)
 create mode 100644 test/submit-link-fail.c
.gitignore +1 -0
index 3d67ef9..df0f740 100644
@@ -128,6 +128,7 @@
 /test/rw_merge_test
 /test/sqpoll-cancel-hang
 /test/testfile
+/test/submit-link-fail
 /test/*.dmesg
 
 config-host.h
test/Makefile +2 -0
index d392b95..775e3bb 100644
@@ -123,6 +123,7 @@ test_targets += \
 	sq-space_left \
 	stdout \
 	submit-reuse \
+	submit-link-fail \
 	symlink \
 	teardowns \
 	thread-exit \
@@ -264,6 +265,7 @@ test_srcs := \
 	statx.c \
 	stdout.c \
 	submit-reuse.c \
+	submit-link-fail.c \
 	symlink.c \
 	teardowns.c \
 	thread-exit.c \
test/submit-link-fail.c new file +150 -0

150 lines not on this page · raw message

Signature · 1 line
2.33.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Pavel Begunkov

Add a whole bunch of tests for when linked requests fail early during submission.

Applied, but remember to check write(2) returns:

submit-link-fail.c: In function ‘test_underprep_fail’:
submit-link-fail.c:80:17: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]

   80 |                 write(fds[1], buffer, sizeof(buffer));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 10 lines · Jens Axboe
Quoted 2 lines · Pavel Begunkov

Add a whole bunch of tests for when linked requests fail early during submission.

Applied, but remember to check write(2) returns:

submit-link-fail.c: In function ‘test_underprep_fail’:
submit-link-fail.c:80:17: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]

   80 |                 write(fds[1], buffer, sizeof(buffer));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

My bad. Interesting why my gcc 11 doesn't complain.

Signature · 1 line
Pavel Begunkov