From e64e7608ca47d25e81fb43d66838d9aa0ffd2e9a Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 15 Mar 2025 03:04:27 +0900 Subject: sandbox: expose cancel behaviour Signed-off-by: Ophestra --- internal/sandbox/container_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'internal/sandbox/container_test.go') diff --git a/internal/sandbox/container_test.go b/internal/sandbox/container_test.go index 6ef8cecd..566de75c 100644 --- a/internal/sandbox/container_test.go +++ b/internal/sandbox/container_test.go @@ -18,6 +18,7 @@ import ( "git.gensokyo.uk/security/fortify/internal/fmsg" "git.gensokyo.uk/security/fortify/internal/sandbox" "git.gensokyo.uk/security/fortify/ldd" + "git.gensokyo.uk/security/fortify/seccomp" check "git.gensokyo.uk/security/fortify/test/sandbox" ) @@ -146,6 +147,16 @@ func TestContainer(t *testing.T) { } } +func TestContainerString(t *testing.T) { + container := sandbox.New(context.TODO(), "ldd", "/usr/bin/env") + container.Flags |= sandbox.FAllowDevel + container.Seccomp |= seccomp.FlagMultiarch + want := `argv: ["ldd" "/usr/bin/env"], flags: 0x2, seccomp: 0x2e` + if got := container.String(); got != want { + t.Errorf("String: %s, want %s", got, want) + } +} + func TestHelperInit(t *testing.T) { if len(os.Args) != 5 || os.Args[4] != "init" { return -- cgit v1.3.1