From af5cd5cc7522729b72747d3cbf5b7293df3c634c Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 17 Jan 2017 23:08:30 +0400 Subject: [PATCH] [p2p tests] test other peers connect to us if we have neither seeds nor the addrbook --- test/p2p/pex/test.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/p2p/pex/test.sh b/test/p2p/pex/test.sh index 84d832b9..45779603 100644 --- a/test/p2p/pex/test.sh +++ b/test/p2p/pex/test.sh @@ -18,7 +18,7 @@ docker stop "local_testnet_$ID" docker cp "local_testnet_$ID:/go/src/github.com/tendermint/tendermint/test/p2p/data/mach1/core/addrbook.json" "/tmp/addrbook.json" docker rm -vf "local_testnet_$ID" -# NOTE that we do not provide seeds this time +# NOTE that we do not provide seeds bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$ID" "$PROXY_APP" "--pex" docker cp "/tmp/addrbook.json" "local_testnet_$ID:/go/src/github.com/tendermint/tendermint/test/p2p/data/mach1/core/addrbook.json" echo "with the following addrbook:" @@ -28,6 +28,20 @@ echo "" # if the client runs forever, it means addrbook wasn't saved or was empty bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "pex_$ID" "test/p2p/pex/check_peer.sh $ID $N" +echo "----------------------------------------------------------------------" +echo "Testing other peers connect to us if we have neither seeds nor the addrbook" +echo "(assuming peers are started with pex enabled)" + +echo "1. restart peer $ID" +docker stop "local_testnet_$ID" +docker rm -vf "local_testnet_$ID" + +# NOTE that we do not provide seeds +bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$ID" "$PROXY_APP" "--pex" + +# if the client runs forever, it means other peers have removed us from their books (which should not happen) +bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "pex_$ID" "test/p2p/pex/check_peer.sh $ID $N" + echo "" echo "PASS" echo ""