authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-11-09 00:49:22+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-11-09 00:49:22+02:00
log10a28bc4c48cd50882a7a5e5c57fee02b8c34731
treeddf2387e14bf710211f308f8262a7efdaad5ac8d
parentbe14fe1fa18ec2ac0ead232a4e6035656e3f67dc
parent715e5f757f4768825d923ef473af1e02f6c7754c
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #17935 from ianic/fix_io_uring_test_kernel_5_4

Fix io_uring tests on kernel 5.4

1 files changed, 8 insertions(+), 1 deletions(-)

lib/std/os/linux/io_uring.zig+8-1
......@@ -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);
......@@ -2329,7 +2330,8 @@ test "timeout_remove" {
23292330 // * kernel 5.18 gives user data 0x99999999 first, 0x88888888 second
23302331
23312332 var cqes: [2]os.linux.io_uring_cqe = undefined;
2332 try testing.expectEqual(@as(u32, 2), try ring.copy_cqes(cqes[0..], 2));
2333 cqes[0] = try ring.copy_cqe();
2334 cqes[1] = try ring.copy_cqe();
23332335
23342336 for (cqes) |cqe| {
23352337 // IORING_OP_TIMEOUT_REMOVE is not supported by this kernel version:
......@@ -2499,6 +2501,8 @@ test "statx" {
24992501 // The filesystem containing the file referred to by fd does not support this operation;
25002502 // or the mode is not supported by the filesystem containing the file referred to by fd:
25012503 .OPNOTSUPP => return error.SkipZigTest,
2504 // not supported on older kernels (5.4)
2505 .BADF => return error.SkipZigTest,
25022506 else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
25032507 }
25042508 try testing.expectEqual(linux.io_uring_cqe{
......@@ -3144,6 +3148,7 @@ test "remove_buffers" {
31443148
31453149 const cqe = try ring.copy_cqe();
31463150 switch (cqe.err()) {
3151 .INVAL => return error.SkipZigTest,
31473152 .SUCCESS => {},
31483153 else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
31493154 }
......@@ -3234,6 +3239,8 @@ test "provide_buffers: accept/connect/send/recv" {
32343239 switch (cqe.err()) {
32353240 // Happens when the kernel is < 5.7
32363241 .INVAL => return error.SkipZigTest,
3242 // Happens on the kernel 5.4
3243 .BADF => return error.SkipZigTest,
32373244 .SUCCESS => {},
32383245 else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
32393246 }