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/init_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'container/init_test.go') diff --git a/container/init_test.go b/container/init_test.go index de165dab..94e165d8 100644 --- a/container/init_test.go +++ b/container/init_test.go @@ -377,7 +377,7 @@ func TestInitEntrypoint(t *testing.T) { }, }, nil}, - {"apply", func(k syscallDispatcher) error { initEntrypoint(k, assertPrefix, assertVerboseTrue); return nil }, [][]kexpect{ + {"early unhandled error", func(k syscallDispatcher) error { initEntrypoint(k, assertPrefix, assertVerboseTrue); return nil }, [][]kexpect{ { {"lockOSThread", expectArgs{}, nil, nil}, {"getpid", expectArgs{}, 1, nil}, @@ -759,10 +759,8 @@ func TestInitEntrypoint(t *testing.T) { {"bindMount", expectArgs{"/host", "/sysroot", uintptr(0x4001), false}, nil, nil}, {"verbosef", expectArgs{"%s %s", []any{"mounting", &MountProcOp{Target: MustAbs("/proc/")}}}, nil, nil}, {"mkdirAll", expectArgs{"/sysroot/proc", os.FileMode(0755)}, nil, nil}, - {"mount", expectArgs{"proc", "/sysroot/proc", "proc", uintptr(0xe), ""}, nil, errUnique}, - {"printBaseErr", expectArgs{wrapErrSuffix(errUnique, `cannot mount proc on "/proc/":`), "cannot apply op at index 1:"}, nil, nil}, - {"beforeExit", expectArgs{}, nil, nil}, - {"exit", expectArgs{1}, nil, nil}, + {"mount", expectArgs{"proc", "/sysroot/proc", "proc", uintptr(0xe), ""}, nil, &MountError{"proc", "/sysroot/proc", "proc", uintptr(0xe), "", syscall.ENOTRECOVERABLE}}, + {"fatal", expectArgs{[]any{"cannot mount proc on /sysroot/proc: state not recoverable"}}, nil, nil}, /* end apply */ }, }, nil}, -- cgit v1.3.1