Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Agents poll AETHERFORGE_CLOUD_MAP_ENDPOINT to sync know_node gossip; deploy plans attach route_via DNS hints for standalone operator registries.
26 lines
608 B
Go
26 lines
608 B
Go
package cloudmap
|
|
|
|
import "testing"
|
|
|
|
func TestSeederDNSName(t *testing.T) {
|
|
if got := SeederDNSName("seeder", "prod.local"); got != "seeder.svc.prod.local" {
|
|
t.Fatalf("got %q", got)
|
|
}
|
|
}
|
|
|
|
func TestKnowNodeTargets(t *testing.T) {
|
|
doc := RegistryDocument{
|
|
Namespace: "prod.local",
|
|
Service: "seeder",
|
|
Instances: []RegistryInstance{
|
|
{AgentID: "a1", Healthy: true},
|
|
{AgentID: "a2", Healthy: false},
|
|
{DNSName: "seeder.svc.prod.local", Healthy: true},
|
|
},
|
|
}
|
|
got := KnowNodeTargets(doc)
|
|
if len(got) != 2 || got[0] != "a1" || got[1] != "seeder.svc.prod.local" {
|
|
t.Fatalf("got=%v", got)
|
|
}
|
|
}
|