From 09d284498109b847da0da1e2c5f883268a7f2d46 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 21 Aug 2025 21:59:07 +0900 Subject: container/init: wrap syscall helper functions This allows tests to stub all kernel behaviour, enabling measurement of all function call arguments and error injection. Signed-off-by: Ophestra --- container/initmkdir_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'container/initmkdir_test.go') diff --git a/container/initmkdir_test.go b/container/initmkdir_test.go index ad326240..1f54e748 100644 --- a/container/initmkdir_test.go +++ b/container/initmkdir_test.go @@ -1,8 +1,20 @@ package container -import "testing" +import ( + "os" + "testing" +) func TestMkdirOp(t *testing.T) { + checkOpBehaviour(t, []opBehaviourTestCase{ + {"success", new(Params), &MkdirOp{ + Path: MustAbs("/.hakurei"), + Perm: 0500, + }, nil, nil, []kexpect{ + {"mkdirAll", expectArgs{"/sysroot/.hakurei", os.FileMode(0500)}, nil, nil}, + }, nil}, + }) + checkOpsValid(t, []opValidTestCase{ {"nil", (*MkdirOp)(nil), false}, {"zero", new(MkdirOp), false}, -- cgit v1.3.1