From 8d472ebf2b654e0b97b21b40a4333184fc2c0736 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 29 Aug 2025 02:15:48 +0900 Subject: container/inittmpfs: unwrap out of bounds error This eliminates generic WrapErr from tmpfs. Signed-off-by: Ophestra --- container/inittmpfs_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'container/inittmpfs_test.go') diff --git a/container/inittmpfs_test.go b/container/inittmpfs_test.go index 8110f446..97a591f2 100644 --- a/container/inittmpfs_test.go +++ b/container/inittmpfs_test.go @@ -1,17 +1,24 @@ package container import ( - "io/fs" "os" "syscall" "testing" ) func TestMountTmpfsOp(t *testing.T) { + t.Run("size error", func(t *testing.T) { + tmpfsSizeError := TmpfsSizeError(-1) + want := "tmpfs size -1 out of bounds" + if got := tmpfsSizeError.Error(); got != want { + t.Errorf("Error: %q, want %q", got, want) + } + }) + checkOpBehaviour(t, []opBehaviourTestCase{ {"size oob", new(Params), &MountTmpfsOp{ Size: -1, - }, nil, nil, nil, msg.WrapErr(fs.ErrInvalid, "size -1 out of bounds")}, + }, nil, nil, nil, TmpfsSizeError(-1)}, {"success", new(Params), &MountTmpfsOp{ FSName: "ephemeral", -- cgit v1.3.1