app: fix tests

This commit is contained in:
Peter Bourgon
2015-06-15 14:51:19 +02:00
parent c65aecd9e1
commit c900c17ad5
2 changed files with 21 additions and 16 deletions

View File

@@ -32,8 +32,7 @@ func TestAPITopologyApplications(t *testing.T) {
report.MakeEndpointNodeID("hostA", "192.168.1.1", "12345"),
report.MakeEndpointNodeID("hostA", "192.168.1.1", "12346"),
report.MakeHostNodeID("hostA"),
), node.Origins,
)
), node.Origins)
equals(t, "curl", node.LabelMajor)
equals(t, "node-a.local (23128)", node.LabelMinor)
equals(t, "23128", node.Rank)

View File

@@ -55,24 +55,28 @@ func (s StaticReport) Report() report.Report {
},
NodeMetadatas: report.NodeMetadatas{
report.MakeEndpointNodeID("hostA", "192.168.1.1", "12345"): report.NodeMetadata{
"pid": "23128",
"name": "curl",
"domain": "node-a.local",
"pid": "23128",
"name": "curl",
"domain": "node-a.local",
report.HostNodeID: report.MakeHostNodeID("hostA"),
},
report.MakeEndpointNodeID("hostA", "192.168.1.1", "12346"): report.NodeMetadata{ // <-- same as :12345
"pid": "23128",
"name": "curl",
"domain": "node-a.local",
"pid": "23128",
"name": "curl",
"domain": "node-a.local",
report.HostNodeID: report.MakeHostNodeID("hostA"),
},
report.MakeEndpointNodeID("hostA", "192.168.1.1", "8888"): report.NodeMetadata{
"pid": "55100",
"name": "ssh",
"domain": "node-a.local",
"pid": "55100",
"name": "ssh",
"domain": "node-a.local",
report.HostNodeID: report.MakeHostNodeID("hostA"),
},
report.MakeEndpointNodeID("hostB", "192.168.1.2", "80"): report.NodeMetadata{
"pid": "215",
"name": "apache",
"domain": "node-b.local",
"pid": "215",
"name": "apache",
"domain": "node-b.local",
report.HostNodeID: report.MakeHostNodeID("hostB"),
},
},
},
@@ -107,10 +111,12 @@ func (s StaticReport) Report() report.Report {
},
NodeMetadatas: report.NodeMetadatas{
report.MakeAddressNodeID("hostA", "192.168.1.1"): report.NodeMetadata{
"name": "host-a",
"name": "host-a",
report.HostNodeID: report.MakeHostNodeID("hostA"),
},
report.MakeAddressNodeID("hostB", "192.168.1.2"): report.NodeMetadata{
"name": "host-b",
"name": "host-b",
report.HostNodeID: report.MakeHostNodeID("hostB"),
},
},
},