From ad7e389eee5f49c47576c69122af08fc9c51ebd7 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Fri, 25 Oct 2024 17:12:13 +0900 Subject: app: test app permissive defaults sealing behaviour This test seals App against a deterministic os stub and checks the resulting sys and bwrap values against known correct ones. The effects of sys and bwrap on the OS and sandbox is deterministic and tested in their own respective packages. Signed-off-by: Ophestra Umiker --- internal/app/export_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 internal/app/export_test.go (limited to 'internal/app/export_test.go') diff --git a/internal/app/export_test.go b/internal/app/export_test.go new file mode 100644 index 00000000..8e524681 --- /dev/null +++ b/internal/app/export_test.go @@ -0,0 +1,19 @@ +package app + +import ( + "git.ophivana.moe/security/fortify/helper/bwrap" + "git.ophivana.moe/security/fortify/internal" + "git.ophivana.moe/security/fortify/internal/system" +) + +func NewWithID(id ID, os internal.System) App { + a := new(app) + a.id = &id + a.os = os + return a +} + +func AppSystemBwrap(a App) (*system.I, *bwrap.Config) { + v := a.(*app) + return v.seal.sys.I, v.seal.sys.bwrap +} -- cgit v1.3.1