bastion 0.57.0
ci / personal-data (push) Successful in 4s
ci / test (push) Successful in 4m30s
ci / fuzz (push) Successful in 3m25s

This commit is contained in:
Privatae
2026-10-28 20:35:45 +00:00
parent 4012da0b75
commit 081763a675
26 changed files with 2118 additions and 37 deletions
+12
View File
@@ -36,8 +36,13 @@ import (
"os"
"strings"
"testing"
"time"
)
// installShStandInRun is the argument that makes this test binary stand in
// for a running bastion (TestMain).
const installShStandInRun = "install-sh-stand-in-run"
func TestMain(m *testing.M) {
// The op sandbox re-execs its own binary (ops_exec_linux.go); under
// `go test` that binary is this one, so the child must be answered here
@@ -62,6 +67,13 @@ func TestMain(m *testing.M) {
if len(os.Args) >= 3 && os.Args[1] == rootExecConnectSubcommand {
os.Exit(rootExecConnectMain(os.Args[2:]))
}
// install_sh_test.go runs a copy of this binary named privatae-bastion as
// a bastion left running outside its service: it only waits to be
// stopped, and never starts the suite.
if len(os.Args) >= 2 && os.Args[1] == installShStandInRun {
time.Sleep(2 * time.Minute)
os.Exit(0)
}
// Likewise when git runs this binary as the bastion's credential helper
// (claims_git_test.go): answer as the helper, with the config dir the
// test named, and never start the suite.