Files
AetherForge/agent/client/scout_mode_test.go
AetherForge 7b2d41cda8
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Expand P2 test coverage: mining chain, spread lanes, path forge, WS/beacon, E2E onion, file handling
2026-06-07 04:58:55 -07:00

35 lines
906 B
Go

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")
}
}