diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-02-27 07:27:28 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-02-27 07:27:28 -0700 |
commit | 8103e66409acd7f29fcfafb532049f80432e7da8 (patch) | |
tree | 90cffc59d96db560b253106ab2eae134daca6d21 | |
parent | 097250601ff2085a86c288e94dfb619576e86175 (diff) | |
download | liburing-8103e66409acd7f29fcfafb532049f80432e7da8.tar.gz |
test: add some missing checks for lack of support
These two tests didn't have conclusive checks for whether or not the
support that is being tested exists, so they would fail on older
kernels. Fix them up.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | test/buf-ring-nommap.c | 2 | ||||
-rw-r--r-- | test/socket-io-cmd.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/test/buf-ring-nommap.c b/test/buf-ring-nommap.c index 46a3b674..1e47f281 100644 --- a/test/buf-ring-nommap.c +++ b/test/buf-ring-nommap.c @@ -71,6 +71,8 @@ int main(int argc, char *argv[]) br = mmap(NULL, ring_size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_POPULATE, ring.ring_fd, off); if (br == MAP_FAILED) { + if (errno == ENOMEM) + return T_EXIT_SKIP; perror("mmap"); return T_EXIT_FAIL; } diff --git a/test/socket-io-cmd.c b/test/socket-io-cmd.c index e3f5330b..f1f14655 100644 --- a/test/socket-io-cmd.c +++ b/test/socket-io-cmd.c @@ -110,7 +110,7 @@ static int run_test(bool stream) return T_EXIT_FAIL; bytes_in = receive_cqe(&ring); if (bytes_in < 0) { - if (bytes_in == -EINVAL) { + if (bytes_in == -EINVAL || bytes_in == -EOPNOTSUPP) { no_io_cmd = 1; return T_EXIT_SKIP; } |