authorgravatar for igor.anic@gmail.comIgor Anić <igor.anic@gmail.com> 2023-11-08 18:52:03+01:00
committergravatar for igor.anic@gmail.comIgor Anić <igor.anic@gmail.com> 2023-11-08 18:52:03+01:00
log715e5f757f4768825d923ef473af1e02f6c7754c
tree14869542cb9a2534e1a6066226cfe26e513ac7ba
parent7a1dbbd4f93f7e6221eab7f8c26b464685728bf6

fix io_uring tests on kernel 5.4

Unsupported tests are now skipped on kernel 5.4: ``` uname -a Linux d20 5.4.0-166-generic #183-Ubuntu SMP Mon Oct 2 11:31:37 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux zig test lib/std/std.zig --zig-lib-dir lib --main-mod-path lib/std 2>&1 | cat 709/2616 test.nop... OK 710/2616 test.readv... OK 711/2616 test.writev/fsync/readv... OK 712/2616 test.write/read... SKIP 713/2616 test.splice/read... SKIP 714/2616 test.write_fixed/read_fixed... OK 715/2616 test.openat... SKIP 716/2616 test.close... SKIP 717/2616 test.accept/connect/send/recv... SKIP 718/2616 test.sendmsg/recvmsg... OK 719/2616 test.timeout (after a relative time)... SKIP 720/2616 test.timeout (after a number of completions)... OK 721/2616 test.timeout_remove... SKIP 722/2616 test.accept/connect/recv/link_timeout... SKIP 723/2616 test.fallocate... SKIP 724/2616 test.statx... SKIP 725/2616 test.accept/connect/recv/cancel... SKIP 726/2616 test.register_files_update... SKIP 727/2616 test.shutdown... SKIP 728/2616 test.renameat... SKIP 729/2616 test.unlinkat... SKIP 730/2616 test.mkdirat... SKIP 731/2616 test.symlinkat... SKIP 732/2616 test.linkat... SKIP 733/2616 test.provide_buffers: read... SKIP 734/2616 test.remove_buffers... SKIP 735/2616 test.provide_buffers: accept/connect/send/recv... SKIP 736/2616 test.accept multishot... SKIP ```

1 files changed, 6 insertions(+), 0 deletions(-)

lib/std/os/linux/io_uring.zig+6
......@@ -2072,6 +2072,7 @@ test "openat" {
20722072 const cqe_openat = try ring.copy_cqe();
20732073 try testing.expectEqual(@as(u64, 0x33333333), cqe_openat.user_data);
20742074 if (cqe_openat.err() == .INVAL) return error.SkipZigTest;
2075 if (cqe_openat.err() == .BADF) return error.SkipZigTest;
20752076 if (cqe_openat.res <= 0) std.debug.print("\ncqe_openat.res={}\n", .{cqe_openat.res});
20762077 try testing.expect(cqe_openat.res > 0);
20772078 try testing.expectEqual(@as(u32, 0), cqe_openat.flags);
......@@ -2500,6 +2501,8 @@ test "statx" {
25002501 // The filesystem containing the file referred to by fd does not support this operation;
25012502 // or the mode is not supported by the filesystem containing the file referred to by fd:
25022503 .OPNOTSUPP => return error.SkipZigTest,
2504 // not supported on older kernels (5.4)
2505 .BADF => return error.SkipZigTest,
25032506 else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
25042507 }
25052508 try testing.expectEqual(linux.io_uring_cqe{
......@@ -3145,6 +3148,7 @@ test "remove_buffers" {
31453148
31463149 const cqe = try ring.copy_cqe();
31473150 switch (cqe.err()) {
3151 .INVAL => return error.SkipZigTest,
31483152 .SUCCESS => {},
31493153 else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
31503154 }
......@@ -3235,6 +3239,8 @@ test "provide_buffers: accept/connect/send/recv" {
32353239 switch (cqe.err()) {
32363240 // Happens when the kernel is < 5.7
32373241 .INVAL => return error.SkipZigTest,
3242 // Happens on the kernel 5.4
3243 .BADF => return error.SkipZigTest,
32383244 .SUCCESS => {},
32393245 else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
32403246 }