diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-29 02:15:48 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-29 02:15:48 +0900 |
| commit | 8d472ebf2b654e0b97b21b40a4333184fc2c0736 (patch) | |
| tree | da8917f72d6b19e4efdd8b4031f1ff19baf1c42d /container/inittmpfs_test.go | |
| parent | 4da6463135f63658365d837e8d7dd69f0ca1468e (diff) | |
container/inittmpfs: unwrap out of bounds error
This eliminates generic WrapErr from tmpfs.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/inittmpfs_test.go')
| -rw-r--r-- | container/inittmpfs_test.go | 11 |
1 files changed, 9 insertions, 2 deletions
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", |
