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,22 @@
package deploy
import "testing"
func TestNearestLANSeederPrefersSameSubnet(t *testing.T) {
seeders := []LANSeederHint{
{AgentID: "far", IP: "10.0.9.1", LANFallbackURL: "http://10.0.9.1/manifest"},
{AgentID: "near", IP: "192.168.1.50", LANFallbackURL: "http://192.168.1.50/manifest"},
}
got := NearestLANSeeder(seeders, "192.168.1.10")
if got == nil || got.AgentID != "near" {
t.Fatalf("got %+v", got)
}
}
func TestApplyLANSeederToWebRTC(t *testing.T) {
policy := WebRTCMeshPolicy{}
ApplyLANSeederToWebRTC(&policy, &LANSeederHint{AgentID: "seed-1", LANFallbackURL: "http://lan/seed"})
if policy.SeederAgentID != "seed-1" || policy.LANFallbackURL != "http://lan/seed" {
t.Fatalf("policy=%+v", policy)
}
}