Commit a31d9af2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e4a617ec
...@@ -121,9 +121,16 @@ func TestMasterStorage(t *testing.T) { ...@@ -121,9 +121,16 @@ func TestMasterStorage(t *testing.T) {
//net := xnet.NetTrace(pipenet.New(""), tracer) // test network //net := xnet.NetTrace(pipenet.New(""), tracer) // test network
net := pipenet.New("testnet") // test network net := pipenet.New("testnet") // test network
// syntatic shortcut for net tx events // shortcut for addresses
xaddr := func(addr string) *pipenet.Addr {
a, err := net.ParseAddr(addr)
exc.Raiseif(err)
return a
}
// shortcut for net tx events
nettx := func(src, dst, pkt string) *xnet.TraceTx { nettx := func(src, dst, pkt string) *xnet.TraceTx {
return &xnet.TraceTx{Src: net.Addr(src), Dst: net.Addr(dst), Pkt: []byte(pkt)} return &xnet.TraceTx{Src: xaddr(src), Dst: xaddr(dst), Pkt: []byte(pkt)}
} }
Mhost := xnet.NetTrace(net.Host("m"), tracer) Mhost := xnet.NetTrace(net.Host("m"), tracer)
...@@ -144,7 +151,9 @@ func TestMasterStorage(t *testing.T) { ...@@ -144,7 +151,9 @@ func TestMasterStorage(t *testing.T) {
// expect: // expect:
//tc.ExpectNetListen("0") //tc.ExpectNetListen("0")
println("111")
tc.Expect(&xnet.TraceListen{Laddr: "0"}) tc.Expect(&xnet.TraceListen{Laddr: "0"})
println("222")
// M.clusterState <- RECOVERY // M.clusterState <- RECOVERY
// M.nodeTab <- Node(M) // M.nodeTab <- Node(M)
...@@ -164,11 +173,15 @@ func TestMasterStorage(t *testing.T) { ...@@ -164,11 +173,15 @@ func TestMasterStorage(t *testing.T) {
tc.Expect(&xnet.TraceDial{Dst: "0"}) tc.Expect(&xnet.TraceDial{Dst: "0"})
//tc.ExpectNetDial("0") //tc.ExpectNetDial("0")
println("333")
tc.ExpectPar( tc.ExpectPar(
nettx("s:1", "m:1", "\x00\x00\x00\x01"), // handshake nettx("s:1", "m:1", "\x00\x00\x00\x01"), // handshake
nettx("m:1", "s:1", "\x00\x00\x00\x01"), nettx("m:1", "s:1", "\x00\x00\x00\x01"),
) )
println("444")
// XXX temp // XXX temp
return return
......
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