From f57f97c4bd30a35946a0c59cb1157c36e126ceb5 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 18 Jan 2018 17:40:12 -0500 Subject: [PATCH] fix bash tests --- .../pex/{dial_persistent_peers.sh => dial_peers.sh} | 13 +++++++------ test/p2p/pex/test.sh | 4 ++-- ..._dial_persistent_peers.sh => test_dial_peers.sh} | 10 +++++----- 3 files changed, 14 insertions(+), 13 deletions(-) rename test/p2p/pex/{dial_persistent_peers.sh => dial_peers.sh} (57%) rename test/p2p/pex/{test_dial_persistent_peers.sh => test_dial_peers.sh} (78%) diff --git a/test/p2p/pex/dial_persistent_peers.sh b/test/p2p/pex/dial_peers.sh similarity index 57% rename from test/p2p/pex/dial_persistent_peers.sh rename to test/p2p/pex/dial_peers.sh index 95c1d6e9..ddda7dbe 100644 --- a/test/p2p/pex/dial_persistent_peers.sh +++ b/test/p2p/pex/dial_peers.sh @@ -19,13 +19,14 @@ for i in `seq 1 $N`; do done set -e -# persistent_peers need quotes -persistent_peers="\"$(test/p2p/ip.sh 1):46656\"" +# peers need quotes +peers="\"$(test/p2p/ip.sh 1):46656\"" for i in `seq 2 $N`; do - persistent_peers="$persistent_peers,\"$(test/p2p/ip.sh $i):46656\"" + peers="$peers,\"$(test/p2p/ip.sh $i):46656\"" done -echo $persistent_peers +echo $peers -echo $persistent_peers +echo $peers IP=$(test/p2p/ip.sh 1) -curl --data-urlencode "persistent_peers=[$persistent_peers]" "$IP:46657/dial_persistent_peers" +curl "$IP:46657/dial_peers?persistent=true&peers=\[$peers\]" + diff --git a/test/p2p/pex/test.sh b/test/p2p/pex/test.sh index 06d40c3e..ffecd651 100644 --- a/test/p2p/pex/test.sh +++ b/test/p2p/pex/test.sh @@ -11,5 +11,5 @@ cd "$GOPATH/src/github.com/tendermint/tendermint" echo "Test reconnecting from the address book" bash test/p2p/pex/test_addrbook.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$N" "$PROXY_APP" -echo "Test connecting via /dial_persistent_peers" -bash test/p2p/pex/test_dial_persistent_peers.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$N" "$PROXY_APP" +echo "Test connecting via /dial_peers" +bash test/p2p/pex/test_dial_peers.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$N" "$PROXY_APP" diff --git a/test/p2p/pex/test_dial_persistent_peers.sh b/test/p2p/pex/test_dial_peers.sh similarity index 78% rename from test/p2p/pex/test_dial_persistent_peers.sh rename to test/p2p/pex/test_dial_peers.sh index 7dda62b1..d0b04234 100644 --- a/test/p2p/pex/test_dial_persistent_peers.sh +++ b/test/p2p/pex/test_dial_peers.sh @@ -11,7 +11,7 @@ ID=1 cd $GOPATH/src/github.com/tendermint/tendermint echo "----------------------------------------------------------------------" -echo "Testing full network connection using one /dial_persistent_peers call" +echo "Testing full network connection using one /dial_peers call" echo "(assuming peers are started with pex enabled)" # stop the existing testnet and remove local network @@ -26,11 +26,11 @@ bash test/p2p/local_testnet_start.sh $DOCKER_IMAGE $NETWORK_NAME $N $PROXY_APP $ -# dial persistent_peers from one node -CLIENT_NAME="dial_persistent_peers" -bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME $CLIENT_NAME "test/p2p/pex/dial_persistent_peers.sh $N" +# dial peers from one node +CLIENT_NAME="dial_peers" +bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME $CLIENT_NAME "test/p2p/pex/dial_peers.sh $N" # test basic connectivity and consensus # start client container and check the num peers and height for all nodes -CLIENT_NAME="dial_persistent_peers_basic" +CLIENT_NAME="dial_peers_basic" bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME $CLIENT_NAME "test/p2p/basic/test.sh $N"