Commit 7930f2f7 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent de4c4f48
...@@ -94,6 +94,11 @@ func UUID(typ NodeType, num int32) NodeUUID { ...@@ -94,6 +94,11 @@ func UUID(typ NodeType, num int32) NodeUUID {
// Addr converts network address string into NEO Address // Addr converts network address string into NEO Address
// TODO make neo.Address just string without host:port split // TODO make neo.Address just string without host:port split
func AddrString(network, addr string) (Address, error) { func AddrString(network, addr string) (Address, error) {
// empty is always empty
if addr == "" {
return Address{}, nil
}
// e.g. on unix, networks there is no host/port split - the address there // e.g. on unix, networks there is no host/port split - the address there
// is single string -> we put it into .Host and set .Port=0 to indicate such cases // is single string -> we put it into .Host and set .Port=0 to indicate such cases
switch { switch {
......
...@@ -238,7 +238,7 @@ func TestMasterStorage(t *testing.T) { ...@@ -238,7 +238,7 @@ func TestMasterStorage(t *testing.T) {
// M starts listening // M starts listening
tc.Expect(netlisten("m:1")) tc.Expect(netlisten("m:1"))
tc.Expect(node(&M.node, "m:1", neo.MASTER, 1, neo.RUNNING, 0.0)) tc.Expect(node(M.node, "m:1", neo.MASTER, 1, neo.RUNNING, 0.0))
tc.Expect(clusterState(&M.node.ClusterState, neo.ClusterRecovering)) tc.Expect(clusterState(&M.node.ClusterState, neo.ClusterRecovering))
// TODO create C; C tries connect to master - rejected ("not yet operational") // TODO create C; C tries connect to master - rejected ("not yet operational")
...@@ -266,7 +266,7 @@ func TestMasterStorage(t *testing.T) { ...@@ -266,7 +266,7 @@ func TestMasterStorage(t *testing.T) {
IdTimestamp: 0, IdTimestamp: 0,
})) }))
tc.Expect(node(&M.node, "s:1", neo.STORAGE, 1, neo.PENDING, 0.01)) tc.Expect(node(M.node, "s:1", neo.STORAGE, 1, neo.PENDING, 0.01))
tc.Expect(conntx("m:2", "s:2", 1, &neo.AcceptIdentification{ tc.Expect(conntx("m:2", "s:2", 1, &neo.AcceptIdentification{
NodeType: neo.MASTER, NodeType: neo.MASTER,
...@@ -303,7 +303,7 @@ func TestMasterStorage(t *testing.T) { ...@@ -303,7 +303,7 @@ func TestMasterStorage(t *testing.T) {
exc.Raiseif(err) exc.Raiseif(err)
}) })
tc.Expect(node(&M.node, "s:1", neo.STORAGE, 1, neo.RUNNING, 0.01)) tc.Expect(node(M.node, "s:1", neo.STORAGE, 1, neo.RUNNING, 0.01))
xwait(wg) xwait(wg)
// XXX M.partTab <- S1 // XXX M.partTab <- S1
...@@ -364,7 +364,7 @@ func TestMasterStorage(t *testing.T) { ...@@ -364,7 +364,7 @@ func TestMasterStorage(t *testing.T) {
IdTimestamp: 0, IdTimestamp: 0,
})) }))
tc.Expect(node(&M.node, "", neo.CLIENT, 1, neo.RUNNING, 0.02)) tc.Expect(node(M.node, "", neo.CLIENT, 1, neo.RUNNING, 0.02))
tc.Expect(conntx("m:3", "c:1", 1, &neo.AcceptIdentification{ tc.Expect(conntx("m:3", "c:1", 1, &neo.AcceptIdentification{
NodeType: neo.MASTER, NodeType: neo.MASTER,
...@@ -394,7 +394,7 @@ func TestMasterStorage(t *testing.T) { ...@@ -394,7 +394,7 @@ func TestMasterStorage(t *testing.T) {
}, },
})) }))
Cnode := (*neo.NodeApp)(unsafe.Pointer(C)) // XXX hack Cnode := *(**neo.NodeApp)(unsafe.Pointer(C)) // XXX hack, fragile
tc.Expect(node(Cnode, "m:1", neo.MASTER, 1, neo.RUNNING, 0.00)) tc.Expect(node(Cnode, "m:1", neo.MASTER, 1, neo.RUNNING, 0.00))
tc.Expect(node(Cnode, "s:1", neo.STORAGE, 1, neo.RUNNING, 0.01)) tc.Expect(node(Cnode, "s:1", neo.STORAGE, 1, neo.RUNNING, 0.01))
tc.Expect(node(Cnode, "", neo.CLIENT, 1, neo.RUNNING, 0.02)) tc.Expect(node(Cnode, "", neo.CLIENT, 1, neo.RUNNING, 0.02))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment