diff --git a/audit/cmd/bee/main.go b/audit/cmd/bee/main.go index 8915c3e..cfdff8f 100644 --- a/audit/cmd/bee/main.go +++ b/audit/cmd/bee/main.go @@ -540,13 +540,18 @@ func runScenario(args []string, stdout, stderr io.Writer) int { return 1 } - // Wires the same blackbox kick/sync-bracket hooks the SAT job runner - // uses (see app.New()), so a scenario command job's evidence reaches - // removable media the same way a SAT job's does. - _ = app.New(sys) + // Run through the App (not sys.RunScenario directly) for two reasons: + // it wires the same blackbox kick/sync-bracket hooks the SAT job runner + // uses (see app.New()), AND App.RunScenario defaults the base dir to + // DefaultSATBaseDir (under DefaultExportDir) — the tree the blackbox + // worker actually mirrors to removable media. Calling sys.RunScenario + // with an empty base dir would write to /var/log/bee-sat instead, which + // blackbox does not mirror, so a `bee run` scenario would never reach the + // USB stick even with the hooks firing. + a := app.New(sys) logLine := func(s string) { fmt.Fprintln(stderr, s) } - runDir, err := sys.RunScenario(context.Background(), "", spec, logLine) + runDir, err := a.RunScenario(context.Background(), "", spec, logLine) if err != nil { fmt.Fprintf(stderr, "bee run: %v\n", err) return 1