From d85efc7878c8399fd28a6cade0b08bb98903269d Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 15 Oct 2026 01:37:45 +0900 Subject: internal/testsuite: optional startup notification This is only really used by the sandbox test suite for seccomp validation. Make it optional here to simplify other use cases. Signed-off-by: Ophestra --- internal/testsuite/testsuite.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'internal') diff --git a/internal/testsuite/testsuite.go b/internal/testsuite/testsuite.go index 82cc23ec..d1f3d933 100644 --- a/internal/testsuite/testsuite.go +++ b/internal/testsuite/testsuite.go @@ -478,7 +478,7 @@ func StartHakurei( dbusEnv string, processCommand func(cmd *exec.Cmd), onDone func(err error, output string), - scan bool, + scan, wait bool, c *hst.Config, ) (p hst.State, pid int, err error) { s := store.New(check.MustAbs("/tmp/hakurei.0/state")) @@ -558,10 +558,13 @@ func StartHakurei( return } - if _, err = io.ReadFull(notify, make([]byte, 8)); err != nil { - _ = notify.Close() - return - } else if err = notify.Close(); err != nil { + if wait { + if _, err = io.ReadFull(notify, make([]byte, 8)); err != nil { + _ = notify.Close() + return + } + } + if err = notify.Close(); err != nil { return } @@ -650,6 +653,7 @@ func MustStartHakurei( cred *syscall.Credential, dbusEnv string, onDone func(err error, output string), + wait bool, c *hst.Config, ) (p hst.State, pid int) { _ctx, cancel := context.WithCancel(ctx) @@ -660,7 +664,7 @@ func MustStartHakurei( nil, func(err error, output string) { defer cancel() onDone(err, output) - }, true, c, + }, true, wait, c, ) if err != nil { log.Printf("cannot start hakurei container: %v", err) -- cgit v1.3.1