| ... | @@ -2072,6 +2072,7 @@ test "openat" { | ... | @@ -2072,6 +2072,7 @@ test "openat" { |
| 2072 | const cqe_openat = try ring.copy_cqe(); | 2072 | const cqe_openat = try ring.copy_cqe(); |
| 2073 | try testing.expectEqual(@as(u64, 0x33333333), cqe_openat.user_data); | 2073 | try testing.expectEqual(@as(u64, 0x33333333), cqe_openat.user_data); |
| 2074 | if (cqe_openat.err() == .INVAL) return error.SkipZigTest; | 2074 | if (cqe_openat.err() == .INVAL) return error.SkipZigTest; |
| | 2075 | if (cqe_openat.err() == .BADF) return error.SkipZigTest; |
| 2075 | if (cqe_openat.res <= 0) std.debug.print("\ncqe_openat.res={}\n", .{cqe_openat.res}); | 2076 | if (cqe_openat.res <= 0) std.debug.print("\ncqe_openat.res={}\n", .{cqe_openat.res}); |
| 2076 | try testing.expect(cqe_openat.res > 0); | 2077 | try testing.expect(cqe_openat.res > 0); |
| 2077 | try testing.expectEqual(@as(u32, 0), cqe_openat.flags); | 2078 | try testing.expectEqual(@as(u32, 0), cqe_openat.flags); |
| ... | @@ -2329,7 +2330,8 @@ test "timeout_remove" { | ... | @@ -2329,7 +2330,8 @@ test "timeout_remove" { |
| 2329 | // * kernel 5.18 gives user data 0x99999999 first, 0x88888888 second | 2330 | // * kernel 5.18 gives user data 0x99999999 first, 0x88888888 second |
| 2330 | | 2331 | |
| 2331 | var cqes: [2]os.linux.io_uring_cqe = undefined; | 2332 | 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(); |
| 2333 | | 2335 | |
| 2334 | for (cqes) |cqe| { | 2336 | for (cqes) |cqe| { |
| 2335 | // IORING_OP_TIMEOUT_REMOVE is not supported by this kernel version: | 2337 | // IORING_OP_TIMEOUT_REMOVE is not supported by this kernel version: |
| ... | @@ -2499,6 +2501,8 @@ test "statx" { | ... | @@ -2499,6 +2501,8 @@ test "statx" { |
| 2499 | // The filesystem containing the file referred to by fd does not support this operation; | 2501 | // The filesystem containing the file referred to by fd does not support this operation; |
| 2500 | // or the mode is not supported by the filesystem containing the file referred to by fd: | 2502 | // or the mode is not supported by the filesystem containing the file referred to by fd: |
| 2501 | .OPNOTSUPP => return error.SkipZigTest, | 2503 | .OPNOTSUPP => return error.SkipZigTest, |
| | 2504 | // not supported on older kernels (5.4) |
| | 2505 | .BADF => return error.SkipZigTest, |
| 2502 | else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), | 2506 | else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), |
| 2503 | } | 2507 | } |
| 2504 | try testing.expectEqual(linux.io_uring_cqe{ | 2508 | try testing.expectEqual(linux.io_uring_cqe{ |
| ... | @@ -3144,6 +3148,7 @@ test "remove_buffers" { | ... | @@ -3144,6 +3148,7 @@ test "remove_buffers" { |
| 3144 | | 3148 | |
| 3145 | const cqe = try ring.copy_cqe(); | 3149 | const cqe = try ring.copy_cqe(); |
| 3146 | switch (cqe.err()) { | 3150 | switch (cqe.err()) { |
| | 3151 | .INVAL => return error.SkipZigTest, |
| 3147 | .SUCCESS => {}, | 3152 | .SUCCESS => {}, |
| 3148 | else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), | 3153 | else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), |
| 3149 | } | 3154 | } |
| ... | @@ -3234,6 +3239,8 @@ test "provide_buffers: accept/connect/send/recv" { | ... | @@ -3234,6 +3239,8 @@ test "provide_buffers: accept/connect/send/recv" { |
| 3234 | switch (cqe.err()) { | 3239 | switch (cqe.err()) { |
| 3235 | // Happens when the kernel is < 5.7 | 3240 | // Happens when the kernel is < 5.7 |
| 3236 | .INVAL => return error.SkipZigTest, | 3241 | .INVAL => return error.SkipZigTest, |
| | 3242 | // Happens on the kernel 5.4 |
| | 3243 | .BADF => return error.SkipZigTest, |
| 3237 | .SUCCESS => {}, | 3244 | .SUCCESS => {}, |
| 3238 | else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), | 3245 | else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), |
| 3239 | } | 3246 | } |