mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
app: fix tests
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user