Add tiered LOTL mining onion and fleet recon so agents can fallback across execution tiers while operators see spread and vuln posture in Crucible. Includes triple-onion chain, spread cred graph, and full Go/TS/E2E test validation.
This commit is contained in:
29
agent/deploy/common_defer_test.go
Normal file
29
agent/deploy/common_defer_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package deploy
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestWantsDeferMiningFlag(t *testing.T) {
|
||||
old := os.Args
|
||||
defer func() { os.Args = old }()
|
||||
os.Args = []string{"agent", "--run"}
|
||||
if WantsDeferMining() {
|
||||
t.Fatal("expected false without defer flag or env")
|
||||
}
|
||||
os.Args = []string{"agent", "--run", "--defer-mining"}
|
||||
if !WantsDeferMining() {
|
||||
t.Fatal("expected true with --defer-mining")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunFlagsIncludesDeferWhenSet(t *testing.T) {
|
||||
old := os.Args
|
||||
defer func() { os.Args = old }()
|
||||
os.Args = []string{"agent", "--defer-mining"}
|
||||
flags := RunFlags()
|
||||
if flags != "--run --defer-mining" {
|
||||
t.Fatalf("RunFlags = %q", flags)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user