From 732e792fc6fceb65e215b269564d67700122576f Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sat, 10 Jun 2017 10:33:59 -0700 Subject: [PATCH 1/2] rename and fix sharness issue in ptp test License: MIT Signed-off-by: Jeromy --- test/sharness/t0180-p2p.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sharness/t0180-p2p.sh b/test/sharness/t0180-p2p.sh index f56d43b29..ab92315ec 100755 --- a/test/sharness/t0180-p2p.sh +++ b/test/sharness/t0180-p2p.sh @@ -26,8 +26,8 @@ test_expect_success "test ports are closed" ' (! (netstat -ln | grep "LISTEN" | grep ":10102 ")) ' -test_must_fail 'fail without config option being enabled' ' - ipfsi 0 p2p stream ls +test_expect_success 'fail without config option being enabled' ' + test_must_fail ipfsi 0 p2p stream ls ' test_expect_success "enable filestore config setting" ' From ef43fb8c8b977cda196f668dc372fa1d4c3cca41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 21 Jun 2017 18:35:17 +0200 Subject: [PATCH 2/2] Don't use wait in p2p sharness test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Ɓukasz Magiera --- test/sharness/t0180-p2p.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/sharness/t0180-p2p.sh b/test/sharness/t0180-p2p.sh index ab92315ec..a6f696421 100755 --- a/test/sharness/t0180-p2p.sh +++ b/test/sharness/t0180-p2p.sh @@ -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' '