Don't use wait in p2p sharness test

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
Łukasz Magiera 2017-06-21 18:35:17 +02:00
parent 732e792fc6
commit ef43fb8c8b

View File

@ -40,21 +40,26 @@ test_expect_success 'start p2p listener' '
'
test_expect_success 'Test server to client communications' '
ma-pipe-unidir --listen send /ip4/127.0.0.1/tcp/10101 < test0.bin &
SERVER_PID=$!
ma-pipe-unidir --listen --pidFile=listener.pid send /ip4/127.0.0.1/tcp/10101 < test0.bin &
go-sleep 500ms &&
kill -0 $(cat listener.pid) &&
ipfsi 1 p2p stream dial $PEERID_0 p2p-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ma-pipe-unidir recv /ip4/127.0.0.1/tcp/10102 > client.out &&
wait $SERVER_PID
test ! -f listener.pid
'
test_expect_success 'Test client to server communications' '
ma-pipe-unidir --listen recv /ip4/127.0.0.1/tcp/10101 > server.out &
SERVER_PID=$!
ma-pipe-unidir --listen --pidFile=listener.pid recv /ip4/127.0.0.1/tcp/10101 > server.out &
go-sleep 500ms &&
kill -0 $(cat listener.pid) &&
ipfsi 1 p2p stream dial $PEERID_0 p2p-test /ip4/127.0.0.1/tcp/10102 2>&1 > dialer-stdouterr.log &&
ma-pipe-unidir send /ip4/127.0.0.1/tcp/10102 < test1.bin
wait $SERVER_PID
ma-pipe-unidir send /ip4/127.0.0.1/tcp/10102 < test1.bin &&
go-sleep 250ms &&
test ! -f listener.pid
'
test_expect_success 'server to client output looks good' '