Skip to content

Commit

Permalink
test/msg-ring-sync: ensure test is skipped on older kernels
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
axboe committed Sep 27, 2024
1 parent 8c71ada commit dacb3bd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/msg-ring-sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ static int test_invalid(void)

ret = io_uring_send_msg_ring_sync(&sqe);

if (ret == -EINVAL) {
no_msg = 1;
return 0;
}

if (ret != -EBADFD) {
fprintf(stderr, "res %d\n", ret);
return -1;
Expand Down Expand Up @@ -223,6 +228,8 @@ static int test(int ring_flags)
fprintf(stderr, "test_invalid failed\n");
return T_EXIT_FAIL;
}
if (no_msg)
return T_EXIT_SKIP;

ret = test_remote(ring_flags, 0);
if (ret) {
Expand Down Expand Up @@ -271,12 +278,12 @@ int main(int argc, char *argv[])

for (i = 0; i < 5; i++) {
ret = test(0);
if (no_msg)
return T_EXIT_SKIP;
if (ret != T_EXIT_PASS) {
fprintf(stderr, "ring flags 0 failed\n");
return ret;
}
if (no_msg)
return T_EXIT_SKIP;
}

for (i = 0; i < 5; i++) {
Expand Down

0 comments on commit dacb3bd

Please sign in to comment.