diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-09-14 15:57:41 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-09-14 15:57:41 +0900 |
| commit | 56aad8dc112f45ec26df72bdbbd959c5e8db5bec (patch) | |
| tree | c5e7ce10adfa87388d69363c0455672fbcbb67b5 /test/sandbox | |
| parent | 83c4f8b767c31734a7e465e49ee0e23487ac22ca (diff) | |
test/sandbox/tool: marker pathname from flag
Since this is going to be placed in a shared directory, it needs to be unique to the identity. Instead of trying to figure out identity from mountinfo, just have the test script pass hardcoded values.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/sandbox')
| -rw-r--r-- | test/sandbox/tool/main.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/sandbox/tool/main.go b/test/sandbox/tool/main.go index 37167abd..cd7322e3 100644 --- a/test/sandbox/tool/main.go +++ b/test/sandbox/tool/main.go @@ -16,11 +16,13 @@ import ( ) var ( - flagTestCase string - flagBpfHash string + flagMarkerPath string + flagTestCase string + flagBpfHash string ) func init() { + flag.StringVar(&flagMarkerPath, "p", "/tmp/sandbox-ok", "Pathname of completion marker") flag.StringVar(&flagTestCase, "t", "", "Nix store path to test case file") flag.StringVar(&flagBpfHash, "s", "", "String representation of expected bpf sha512 hash") } @@ -37,10 +39,10 @@ func main() { go func() { <-s; log.Println("exiting on signal (likely from verifier)"); os.Exit(0) }() (&sandbox.T{FS: os.DirFS("/")}).MustCheckFile(flagTestCase) - if _, err := os.Create("/tmp/sandbox-ok"); err != nil { + if _, err := os.Create(flagMarkerPath); err != nil { log.Fatalf("cannot create success marker: %v", err) } - log.Println("blocking for seccomp check") + log.Printf("blocking for seccomp check (%s)", flagMarkerPath) select {} return } |
