zcashd/qa/pull-tester/rpc-tests.sh

170 lines
4.2 KiB
Bash
Raw Normal View History

#!/bin/bash
set -e -o pipefail
CURDIR=$(cd $(dirname "$0"); pwd)
# Get BUILDDIR and REAL_BITCOIND
. "${CURDIR}/tests-config.sh"
export BITCOINCLI=${BUILDDIR}/qa/pull-tester/run-bitcoin-cli
export BITCOIND=${REAL_BITCOIND}
#Run the tests
testScripts=(
'paymentdisclosure.py'
2017-01-11 04:25:19 -08:00
'prioritisetransaction.py'
'wallet_treestate.py'
'wallet_anchorfork.py'
'wallet_changeaddresses.py'
2018-07-16 13:49:29 -07:00
'wallet_changeindicator.py'
'wallet_import_export.py'
'wallet_protectcoinbase.py'
'wallet_shieldcoinbase_sprout.py'
'wallet_shieldcoinbase_sapling.py'
'wallet_listreceived.py'
'wallet.py'
'wallet_overwintertx.py'
'wallet_persistence.py'
'wallet_nullifiers.py'
'wallet_1941.py'
'wallet_addresses.py'
'wallet_sapling.py'
'wallet_listnotes.py'
'mergetoaddress_sprout.py'
'mergetoaddress_sapling.py'
'mergetoaddress_mixednotes.py'
'listtransactions.py'
'mempool_resurrect_test.py'
'txn_doublespend.py'
'txn_doublespend.py --mineblock'
'getchaintips.py'
'rawtransactions.py'
'getrawtransaction_insight.py'
'rest.py'
'mempool_spendcoinbase.py'
'mempool_reorg.py'
'mempool_tx_input_limit.py'
'mempool_nu_activation.py'
2018-02-22 23:27:38 -08:00
'mempool_tx_expiry.py'
'httpbasics.py'
'zapwallettxes.py'
'proxy_test.py'
2015-02-03 17:59:41 -08:00
'merkle_blocks.py'
'fundrawtransaction.py'
'signrawtransactions.py'
'signrawtransaction_offline.py'
'walletbackup.py'
'key_import_export.py'
'nodehandling.py'
'reindex.py'
2019-07-31 09:25:49 -07:00
'addressindex.py'
'spentindex.py'
'timestampindex.py'
'decodescript.py'
'blockchain.py'
'disablewallet.py'
2016-07-14 17:04:38 -07:00
'zcjoinsplit.py'
'zcjoinsplitdoublespend.py'
'zkey_import_export.py'
'reorg_limit.py'
2016-10-10 13:24:00 -07:00
'getblocktemplate.py'
'bip65-cltv-p2p.py'
'bipdersig-p2p.py'
'p2p_nu_peer_management.py'
2018-04-02 05:47:30 -07:00
'rewind_index.py'
'p2p_txexpiry_dos.py'
'p2p_txexpiringsoon.py'
2018-04-03 09:12:46 -07:00
'p2p_node_bloom.py'
'regtest_signrawtransaction.py'
'finalsaplingroot.py'
2019-08-16 12:17:21 -07:00
'shorter_block_times.py'
'sprout_sapling_migration.py'
'turnstile.py'
);
testScriptsExt=(
'getblocktemplate_longpoll.py'
'getblocktemplate_proposals.py'
'pruning.py'
'forknotify.py'
'hardforkdetection.py'
'invalidateblock.py'
'keypool.py'
'receivedby.py'
'rpcbind_test.py'
# 'script_test.py'
'smartfees.py'
'maxblocksinflight.py'
'invalidblockrequest.py'
2015-04-01 06:08:00 -07:00
# 'forknotify.py'
'p2p-acceptblock.py'
);
2015-05-05 17:30:20 -07:00
if [ "x$ENABLE_ZMQ" = "x1" ]; then
testScripts+=('zmq_test.py')
2015-05-05 17:30:20 -07:00
fi
if [ "x$ENABLE_PROTON" = "x1" ]; then
testScripts+=('proton_test.py')
fi
extArg="-extended"
passOn=${@#$extArg}
successCount=0
2016-04-08 14:50:52 -07:00
declare -a failures
function runTestScript
{
local testName="$1"
shift
echo -e "=== Running testscript ${testName} ==="
if eval "$@"
then
successCount=$(expr $successCount + 1)
echo "--- Success: ${testName} ---"
else
2016-04-08 14:50:52 -07:00
failures[${#failures[@]}]="$testName"
echo "!!! FAIL: ${testName} !!!"
fi
echo
}
if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
for (( i = 0; i < ${#testScripts[@]}; i++ ))
do
if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
then
runTestScript \
"${testScripts[$i]}" \
"${BUILDDIR}/qa/rpc-tests/${testScripts[$i]}" \
--srcdir "${BUILDDIR}/src" ${passOn}
fi
done
for (( i = 0; i < ${#testScriptsExt[@]}; i++ ))
do
if [ "$1" == $extArg ] || [ "$1" == "${testScriptsExt[$i]}" ] || [ "$1.py" == "${testScriptsExt[$i]}" ]
then
runTestScript \
"${testScriptsExt[$i]}" \
"${BUILDDIR}/qa/rpc-tests/${testScriptsExt[$i]}" \
--srcdir "${BUILDDIR}/src" ${passOn}
fi
done
2016-04-08 14:50:52 -07:00
echo -e "\n\nTests completed: $(expr $successCount + ${#failures[@]})"
echo "successes $successCount; failures: ${#failures[@]}"
if [ ${#failures[@]} -gt 0 ]
then
echo -e "\nFailing tests: ${failures[*]}"
exit 1
else
exit 0
fi
else
echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled"
fi