2018-07-16 12:05:48 -07:00
|
|
|
#!/bin/bash -e
|
|
|
|
#
|
|
|
|
# Perform a quick sanity test on the specific testnet
|
|
|
|
#
|
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
2018-07-19 11:56:40 -07:00
|
|
|
source multinode-demo/common.sh
|
2018-07-16 12:05:48 -07:00
|
|
|
|
2018-07-20 08:50:08 -07:00
|
|
|
NET_URL=$1
|
|
|
|
if [[ -z $NET_URL ]]; then
|
|
|
|
NET_URL=testnet.solana.com
|
2018-07-16 12:05:48 -07:00
|
|
|
fi
|
|
|
|
|
2018-07-20 08:50:08 -07:00
|
|
|
EXPECTED_NODE_COUNT=$2
|
|
|
|
if [[ -z $EXPECTED_NODE_COUNT ]]; then
|
|
|
|
EXPECTED_NODE_COUNT=50
|
|
|
|
fi
|
|
|
|
|
2018-08-08 15:55:17 -07:00
|
|
|
echo "--- $NET_URL: verify ledger"
|
2018-08-17 20:41:30 -07:00
|
|
|
if [[ -z $NO_LEDGER_VERIFY ]]; then
|
|
|
|
if [[ -d /var/snap/solana/current/config/ledger ]]; then
|
|
|
|
# Note: here we assume this script is actually running on the leader node...
|
|
|
|
sudo solana.ledger-tool --ledger /var/snap/solana/current/config/ledger verify
|
|
|
|
else
|
2018-08-17 20:58:00 -07:00
|
|
|
echo "^^^ +++"
|
|
|
|
echo "Ledger verify skipped"
|
2018-08-17 20:41:30 -07:00
|
|
|
fi
|
2018-08-13 09:10:28 -07:00
|
|
|
else
|
2018-08-17 20:58:00 -07:00
|
|
|
echo "^^^ +++"
|
|
|
|
echo "Ledger verify skipped (NO_LEDGER_VERIFY defined)"
|
2018-08-13 09:10:28 -07:00
|
|
|
fi
|
2018-07-20 08:50:08 -07:00
|
|
|
|
|
|
|
echo "--- $NET_URL: wallet sanity"
|
2018-07-20 09:36:29 -07:00
|
|
|
(
|
|
|
|
set -x
|
|
|
|
multinode-demo/test/wallet-sanity.sh $NET_URL
|
|
|
|
)
|
2018-07-16 12:05:48 -07:00
|
|
|
|
2018-07-20 08:50:08 -07:00
|
|
|
echo "--- $NET_URL: node count"
|
2018-08-13 12:13:00 -07:00
|
|
|
if [[ -n "$USE_SNAP" ]]; then
|
|
|
|
# TODO: Merge client.sh functionality into solana-bench-tps proper and
|
|
|
|
# remove this USE_SNAP case
|
|
|
|
cmd=$solana_bench_tps
|
2018-07-19 11:56:40 -07:00
|
|
|
else
|
2018-08-13 12:13:00 -07:00
|
|
|
cmd=multinode-demo/client.sh
|
2018-07-19 11:56:40 -07:00
|
|
|
fi
|
|
|
|
|
2018-08-13 12:13:00 -07:00
|
|
|
(
|
|
|
|
set -x
|
|
|
|
$cmd $NET_URL $EXPECTED_NODE_COUNT -c
|
|
|
|
)
|
|
|
|
|
2018-08-13 09:01:58 -07:00
|
|
|
echo "--- $NET_URL: validator sanity"
|
2018-08-13 09:10:28 -07:00
|
|
|
if [[ -z $NO_VALIDATOR_SANITY ]]; then
|
|
|
|
(
|
|
|
|
./multinode-demo/setup.sh -t validator
|
|
|
|
set -e pipefail
|
|
|
|
timeout 10s ./multinode-demo/validator.sh "$NET_URL" 2>&1 | tee validator.log
|
|
|
|
)
|
|
|
|
wc -l validator.log
|
|
|
|
if grep -C100 panic validator.log; then
|
2018-08-17 20:58:00 -07:00
|
|
|
echo "^^^ +++"
|
|
|
|
echo "Panic observed"
|
2018-08-13 09:10:28 -07:00
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Validator log looks ok"
|
2018-08-13 09:01:58 -07:00
|
|
|
fi
|
2018-08-13 09:10:28 -07:00
|
|
|
else
|
2018-08-17 20:58:00 -07:00
|
|
|
echo "^^^ +++"
|
|
|
|
echo "Validator sanity disabled (NO_VALIDATOR_SANITY defined)"
|
2018-08-13 09:10:28 -07:00
|
|
|
fi
|
2018-08-09 18:35:43 -07:00
|
|
|
|
2018-07-16 12:05:48 -07:00
|
|
|
exit 0
|