mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
io_uring: fix version check in tests
For renameat, unlinkat, mkdirat, symlinkat and linkat the error code differs between kernel 5.4 which returns EBADF and kernel 5.10 which returns EINVAL. Fixes #10466
This commit is contained in:
parent
885d96735d
commit
0662f1d522
@ -2471,7 +2471,7 @@ test "renameat" {
|
||||
switch (cqe.err()) {
|
||||
.SUCCESS => {},
|
||||
// This kernel's io_uring does not yet implement renameat (kernel version < 5.11)
|
||||
.INVAL => return error.SkipZigTest,
|
||||
.BADF, .INVAL => return error.SkipZigTest,
|
||||
else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
|
||||
}
|
||||
try testing.expectEqual(linux.io_uring_cqe{
|
||||
@ -2533,7 +2533,7 @@ test "unlinkat" {
|
||||
switch (cqe.err()) {
|
||||
.SUCCESS => {},
|
||||
// This kernel's io_uring does not yet implement unlinkat (kernel version < 5.11)
|
||||
.INVAL => return error.SkipZigTest,
|
||||
.BADF, .INVAL => return error.SkipZigTest,
|
||||
else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
|
||||
}
|
||||
try testing.expectEqual(linux.io_uring_cqe{
|
||||
@ -2579,7 +2579,7 @@ test "mkdirat" {
|
||||
switch (cqe.err()) {
|
||||
.SUCCESS => {},
|
||||
// This kernel's io_uring does not yet implement mkdirat (kernel version < 5.15)
|
||||
.INVAL => return error.SkipZigTest,
|
||||
.BADF, .INVAL => return error.SkipZigTest,
|
||||
else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
|
||||
}
|
||||
try testing.expectEqual(linux.io_uring_cqe{
|
||||
@ -2628,7 +2628,7 @@ test "symlinkat" {
|
||||
switch (cqe.err()) {
|
||||
.SUCCESS => {},
|
||||
// This kernel's io_uring does not yet implement symlinkat (kernel version < 5.15)
|
||||
.INVAL => return error.SkipZigTest,
|
||||
.BADF, .INVAL => return error.SkipZigTest,
|
||||
else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
|
||||
}
|
||||
try testing.expectEqual(linux.io_uring_cqe{
|
||||
@ -2683,7 +2683,7 @@ test "linkat" {
|
||||
switch (cqe.err()) {
|
||||
.SUCCESS => {},
|
||||
// This kernel's io_uring does not yet implement linkat (kernel version < 5.15)
|
||||
.INVAL => return error.SkipZigTest,
|
||||
.BADF, .INVAL => return error.SkipZigTest,
|
||||
else => |errno| std.debug.panic("unhandled errno: {}", .{errno}),
|
||||
}
|
||||
try testing.expectEqual(linux.io_uring_cqe{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user