forked from security/hakurei
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 <cat@ophivana.moe>
This commit is contained in:
19
internal/app/export_test.go
Normal file
19
internal/app/export_test.go
Normal file
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user