From eb3385d490523262e26b6cb691a5e18a07a8b26d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 29 Aug 2025 01:46:54 +0900 Subject: container/initsymlink: unwrap mount errors The mount function now wraps its own errors in a much more descriptive type with proper message formatting. Wrapping them no longer makes any sense. Signed-off-by: Ophestra --- container/mount_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'container/mount_test.go') diff --git a/container/mount_test.go b/container/mount_test.go index 2b5b1c42..c3d9ad3d 100644 --- a/container/mount_test.go +++ b/container/mount_test.go @@ -15,7 +15,7 @@ func TestBindMount(t *testing.T) { }, [][]kexpect{{ {"verbosef", expectArgs{"resolved %q flags %#x", []any{"/sysroot/nix", uintptr(1)}}, nil, nil}, {"mount", expectArgs{"/host/nix", "/sysroot/nix", "", uintptr(0x9000), ""}, nil, errUnique}, - }}, wrapErrSuffix(errUnique, `cannot mount "/host/nix" on "/sysroot/nix":`)}, + }}, errUnique}, {"success ne", func(k syscallDispatcher) error { return newProcPaths(k, hostPath).bindMount("/host/nix", "/sysroot/.host-nix", syscall.MS_RDONLY, false) @@ -139,7 +139,7 @@ func TestRemount(t *testing.T) { {"close", expectArgs{0xdeadbeef}, nil, nil}, {"openNew", expectArgs{"/host/proc/self/mountinfo"}, newConstFile(sampleMountinfoNix), nil}, {"mount", expectArgs{"none", "/sysroot/nix", "", uintptr(0x209027), ""}, nil, errUnique}, - }}, wrapErrSuffix(errUnique, `cannot remount "/sysroot/nix":`)}, + }}, errUnique}, {"mount propagate", func(k syscallDispatcher) error { return newProcPaths(k, hostPath).remount("/sysroot/nix", syscall.MS_REC|syscall.MS_RDONLY|syscall.MS_NODEV) @@ -151,7 +151,7 @@ func TestRemount(t *testing.T) { {"openNew", expectArgs{"/host/proc/self/mountinfo"}, newConstFile(sampleMountinfoNix), nil}, {"mount", expectArgs{"none", "/sysroot/nix", "", uintptr(0x209027), ""}, nil, nil}, {"mount", expectArgs{"none", "/sysroot/nix/.ro-store", "", uintptr(0x209027), ""}, nil, errUnique}, - }}, wrapErrSuffix(errUnique, `cannot propagate flags to "/sysroot/nix/.ro-store":`)}, + }}, errUnique}, {"success toplevel", func(k syscallDispatcher) error { return newProcPaths(k, hostPath).remount("/sysroot/bin", syscall.MS_REC|syscall.MS_RDONLY|syscall.MS_NODEV) -- cgit v1.3.1