MCPcopy Create free account
hub / github.com/encodeous/nylon / setupTwoNodeHarness

Function setupTwoNodeHarness

integration/ipc_test.go:25–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func setupTwoNodeHarness(t *testing.T) (*VirtualHarness, chan error) {
26 t.Helper()
27 vh := &VirtualHarness{}
28 a1 := "192.168.50.1:1234"
29 vh.NewNode("a", "10.0.0.1/32")
30 b1 := "192.168.50.2:1234"
31 b2 := "192.168.50.3:1234"
32 vh.NewNode("b", "10.0.0.2/32")
33 vh.Central.Graph = []string{"a, b"}
34 vh.Endpoints = map[string]state.NodeId{a1: "a", b1: "b", b2: "b"}
35 vh.AddLink(a1, b1)
36 vh.AddLink(b1, a1)
37 vh.AddLink(a1, b2)
38 vh.AddLink(b2, a1)
39 errs := vh.Start()
40 return vh, errs
41}
42
43func ipcCall(t *testing.T, n *core.Nylon, req *protocol.IpcRequest) *protocol.IpcResponse {
44 t.Helper()

Callers 6

TestIPCStatusFunction · 0.85
TestIPCReloadConfigFunction · 0.85
TestIPCProbeNonNeighbourFunction · 0.85
TestIPCTraceDisabledFunction · 0.85
TestIPCMalformedRequestFunction · 0.85

Calls 3

NewNodeMethod · 0.95
AddLinkMethod · 0.95
StartMethod · 0.95

Tested by

no test coverage detected