From 17d927ac74ebb24d7fc5ce07c70ed5f9bc1a008c Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 19 Jul 2018 11:56:40 -0700 Subject: [PATCH] Count testnet nodes as a part of sanity --- ci/testnet-sanity.sh | 9 ++++++++- multinode-demo/common.sh | 18 +++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ci/testnet-sanity.sh b/ci/testnet-sanity.sh index 8537cf3bb..d8ae39335 100755 --- a/ci/testnet-sanity.sh +++ b/ci/testnet-sanity.sh @@ -4,6 +4,7 @@ # cd "$(dirname "$0")/.." +source multinode-demo/common.sh TESTNET=$1 if [[ -z $TESTNET ]]; then @@ -13,5 +14,11 @@ fi echo "--- $TESTNET: wallet sanity" multinode-demo/test/wallet-sanity.sh $TESTNET -echo --- fin +echo "--- $TESTNET: node count" +if [[ $TESTNET = testnet.solana.com ]]; then + echo "TODO: Remove this block when a release > 0.7.0 is deployed" +else + $solana_client_demo $TESTNET 50 -c # <-- Expect to see at least 50 nodes +fi + exit 0 diff --git a/multinode-demo/common.sh b/multinode-demo/common.sh index 099448ee3..d74275191 100644 --- a/multinode-demo/common.sh +++ b/multinode-demo/common.sh @@ -3,12 +3,6 @@ # Disable complaints about unused variables in this file: # shellcheck disable=2034 -# shellcheck disable=2154 # 'here' is referenced but not assigned -if [[ -z $here ]]; then - echo "|here| is not defined" - exit 1 -fi - rsync=rsync leader_logger="cat" validator_logger="cat" @@ -65,6 +59,12 @@ else printf "cargo run $maybe_release --bin solana-%s %s -- " "$program" "$features" } if [[ -n $SOLANA_CUDA ]]; then + # shellcheck disable=2154 # 'here' is referenced but not assigned + if [[ -z $here ]]; then + echo "|here| is not defined" + exit 1 + fi + # Locate perf libs downloaded by |./fetch-perf-libs.sh| LD_LIBRARY_PATH=$(cd "$here" && dirname "$PWD"):$LD_LIBRARY_PATH export LD_LIBRARY_PATH @@ -91,7 +91,7 @@ export RUST_BACKTRACE=1 # export SOLANA_METRICS_CONFIG="host=,db=,u=,p=" # configure_metrics() { - [[ -n $SOLANA_METRICS_CONFIG ]] || return + [[ -n $SOLANA_METRICS_CONFIG ]] || return 0 declare metrics_params IFS=',' read -r -a metrics_params <<< "$SOLANA_METRICS_CONFIG" @@ -154,13 +154,13 @@ rsync_url() { # adds the 'rsync://` prefix to URLs that need it if [[ "$url" =~ ^.*:.*$ ]]; then # assume remote-shell transport when colon is present, use $url unmodified echo "$url" - return + return 0 fi if [[ -d "$url" ]]; then # assume local directory if $url is a valid directory, use $url unmodified echo "$url" - return + return 0 fi # Default to rsync:// URL