Expand P2 test coverage: mining chain, spread lanes, path forge, WS/beacon, E2E onion, file handling
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

This commit is contained in:
AetherForge
2026-06-07 04:58:55 -07:00
parent b2a7b1723f
commit 7b2d41cda8
118 changed files with 9938 additions and 223 deletions

View File

@@ -0,0 +1,34 @@
package client
import (
"testing"
"crypto-miner-agent/config"
)
func TestAllowRemoteActionScoutModeBlocksStaging(t *testing.T) {
c := &AgentClient{cfg: config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{ScoutMode: true}}}
ok, reason := c.allowRemoteAction("stage_fetch")
if ok {
t.Fatal("scout should block stage_fetch")
}
if reason == "" {
t.Fatal("expected reason for blocked stage_fetch")
}
ok, _ = c.allowRemoteAction("discover_and_join")
if !ok {
t.Fatal("scout should allow discover_and_join")
}
ok, _ = c.allowRemoteAction("service_discover")
if !ok {
t.Fatal("scout should allow service_discover")
}
}
func TestAllowRemoteActionScoutBlocksSpreadNow(t *testing.T) {
c := &AgentClient{cfg: config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{ScoutMode: true}}}
ok, _ := c.allowRemoteAction("spread_now")
if ok {
t.Fatal("scout should block spread_now")
}
}