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
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
This commit is contained in:
34
agent/client/scout_mode_test.go
Normal file
34
agent/client/scout_mode_test.go
Normal 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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user