2014-10-30 19:58:13 -07:00
|
|
|
#!/bin/bash
|
2016-04-07 17:13:29 -07:00
|
|
|
set -e -o pipefail
|
2014-10-30 19:58:13 -07:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2014-12-09 08:31:23 -08:00
|
|
|
testScripts=(
|
2017-11-14 13:29:05 -08:00
|
|
|
'paymentdisclosure.py'
|
2017-01-11 04:25:19 -08:00
|
|
|
'prioritisetransaction.py'
|
2016-12-03 00:22:42 -08:00
|
|
|
'wallet_treestate.py'
|
2018-03-16 15:18:34 -07:00
|
|
|
'wallet_anchorfork.py'
|
2019-07-31 03:09:32 -07:00
|
|
|
'wallet_changeaddresses.py'
|
2018-07-16 13:49:29 -07:00
|
|
|
'wallet_changeindicator.py'
|
2018-09-12 04:01:08 -07:00
|
|
|
'wallet_import_export.py'
|
2016-09-22 11:30:32 -07:00
|
|
|
'wallet_protectcoinbase.py'
|
2018-09-13 15:12:29 -07:00
|
|
|
'wallet_shieldcoinbase_sprout.py'
|
|
|
|
'wallet_shieldcoinbase_sapling.py'
|
2018-09-25 12:48:01 -07:00
|
|
|
'wallet_listreceived.py'
|
2014-12-09 08:31:23 -08:00
|
|
|
'wallet.py'
|
2018-02-15 22:19:36 -08:00
|
|
|
'wallet_overwintertx.py'
|
2018-09-13 14:22:00 -07:00
|
|
|
'wallet_persistence.py'
|
2018-09-19 19:40:51 -07:00
|
|
|
'wallet_nullifiers.py'
|
2017-01-19 15:42:55 -08:00
|
|
|
'wallet_1941.py'
|
2018-07-09 15:46:36 -07:00
|
|
|
'wallet_addresses.py'
|
2018-08-04 15:19:52 -07:00
|
|
|
'wallet_sapling.py'
|
2018-08-28 17:16:04 -07:00
|
|
|
'wallet_listnotes.py'
|
2018-10-18 10:13:51 -07:00
|
|
|
'mergetoaddress_sprout.py'
|
|
|
|
'mergetoaddress_sapling.py'
|
2019-03-21 17:12:50 -07:00
|
|
|
'mergetoaddress_mixednotes.py'
|
2014-12-09 08:31:23 -08:00
|
|
|
'listtransactions.py'
|
|
|
|
'mempool_resurrect_test.py'
|
|
|
|
'txn_doublespend.py'
|
|
|
|
'txn_doublespend.py --mineblock'
|
|
|
|
'getchaintips.py'
|
2015-03-23 10:16:07 -07:00
|
|
|
'rawtransactions.py'
|
2019-05-07 15:18:06 -07:00
|
|
|
'getrawtransaction_insight.py'
|
2014-12-09 08:31:23 -08:00
|
|
|
'rest.py'
|
|
|
|
'mempool_spendcoinbase.py'
|
2015-08-26 18:15:04 -07:00
|
|
|
'mempool_reorg.py'
|
2017-06-19 20:58:46 -07:00
|
|
|
'mempool_tx_input_limit.py'
|
2018-02-09 15:16:55 -08:00
|
|
|
'mempool_nu_activation.py'
|
2018-02-22 23:27:38 -08:00
|
|
|
'mempool_tx_expiry.py'
|
2014-12-09 08:31:23 -08:00
|
|
|
'httpbasics.py'
|
2015-01-07 02:21:53 -08:00
|
|
|
'zapwallettxes.py'
|
2015-04-17 10:26:03 -07:00
|
|
|
'proxy_test.py'
|
2015-02-03 17:59:41 -08:00
|
|
|
'merkle_blocks.py'
|
2018-09-19 19:40:51 -07:00
|
|
|
'fundrawtransaction.py'
|
2015-03-23 10:16:07 -07:00
|
|
|
'signrawtransactions.py'
|
2018-09-13 15:34:23 -07:00
|
|
|
'signrawtransaction_offline.py'
|
2015-05-27 07:00:15 -07:00
|
|
|
'walletbackup.py'
|
2017-09-17 22:56:37 -07:00
|
|
|
'key_import_export.py'
|
2015-06-16 09:21:03 -07:00
|
|
|
'nodehandling.py'
|
2015-06-17 09:06:39 -07:00
|
|
|
'reindex.py'
|
2019-07-31 09:25:49 -07:00
|
|
|
'addressindex.py'
|
2015-06-30 06:40:44 -07:00
|
|
|
'decodescript.py'
|
2015-10-08 01:22:50 -07:00
|
|
|
'blockchain.py'
|
2015-11-08 23:40:46 -08:00
|
|
|
'disablewallet.py'
|
2016-07-14 17:04:38 -07:00
|
|
|
'zcjoinsplit.py'
|
|
|
|
'zcjoinsplitdoublespend.py'
|
2017-11-27 19:55:38 -08:00
|
|
|
'zkey_import_export.py'
|
2017-06-21 04:53:01 -07:00
|
|
|
'reorg_limit.py'
|
2016-10-10 13:24:00 -07:00
|
|
|
'getblocktemplate.py'
|
2017-05-10 04:42:00 -07:00
|
|
|
'bip65-cltv-p2p.py'
|
|
|
|
'bipdersig-p2p.py'
|
2018-09-12 04:11:10 -07:00
|
|
|
'p2p_nu_peer_management.py'
|
2018-04-02 05:47:30 -07:00
|
|
|
'rewind_index.py'
|
2018-04-03 16:01:49 -07:00
|
|
|
'p2p_txexpiry_dos.py'
|
2018-11-06 17:33:27 -08:00
|
|
|
'p2p_txexpiringsoon.py'
|
2018-04-03 09:12:46 -07:00
|
|
|
'p2p_node_bloom.py'
|
2018-09-21 11:10:15 -07:00
|
|
|
'regtest_signrawtransaction.py'
|
2018-10-10 17:30:58 -07:00
|
|
|
'finalsaplingroot.py'
|
2019-03-18 19:33:02 -07:00
|
|
|
'sprout_sapling_migration.py'
|
2019-04-19 10:57:12 -07:00
|
|
|
'turnstile.py'
|
2015-05-02 04:15:26 -07:00
|
|
|
);
|
|
|
|
testScriptsExt=(
|
|
|
|
'getblocktemplate_longpoll.py'
|
|
|
|
'getblocktemplate_proposals.py'
|
2015-05-02 04:58:10 -07:00
|
|
|
'pruning.py'
|
2015-05-02 04:15:26 -07:00
|
|
|
'forknotify.py'
|
2016-06-09 12:48:04 -07:00
|
|
|
'hardforkdetection.py'
|
2015-05-02 04:15:26 -07:00
|
|
|
'invalidateblock.py'
|
|
|
|
'keypool.py'
|
|
|
|
'receivedby.py'
|
|
|
|
'rpcbind_test.py'
|
2015-05-18 06:29:39 -07:00
|
|
|
# 'script_test.py'
|
2015-05-02 04:15:26 -07:00
|
|
|
'smartfees.py'
|
2015-04-28 09:36:15 -07:00
|
|
|
'maxblocksinflight.py'
|
2015-04-28 09:39:47 -07:00
|
|
|
'invalidblockrequest.py'
|
2015-04-01 06:08:00 -07:00
|
|
|
# 'forknotify.py'
|
2015-05-04 07:50:24 -07:00
|
|
|
'p2p-acceptblock.py'
|
2014-12-09 08:31:23 -08:00
|
|
|
);
|
2015-05-02 04:58:10 -07:00
|
|
|
|
2015-05-05 17:30:20 -07:00
|
|
|
if [ "x$ENABLE_ZMQ" = "x1" ]; then
|
2015-09-17 06:45:14 -07:00
|
|
|
testScripts+=('zmq_test.py')
|
2015-05-05 17:30:20 -07:00
|
|
|
fi
|
|
|
|
|
2017-03-08 16:19:54 -08:00
|
|
|
if [ "x$ENABLE_PROTON" = "x1" ]; then
|
|
|
|
testScripts+=('proton_test.py')
|
|
|
|
fi
|
|
|
|
|
2015-05-02 04:58:10 -07:00
|
|
|
extArg="-extended"
|
|
|
|
passOn=${@#$extArg}
|
|
|
|
|
2016-04-07 17:13:29 -07:00
|
|
|
successCount=0
|
2016-04-08 14:50:52 -07:00
|
|
|
declare -a failures
|
2016-04-07 17:13:29 -07:00
|
|
|
|
|
|
|
function runTestScript
|
|
|
|
{
|
|
|
|
local testName="$1"
|
|
|
|
shift
|
|
|
|
|
|
|
|
echo -e "=== Running testscript ${testName} ==="
|
|
|
|
|
2017-10-05 07:13:28 -07:00
|
|
|
if eval "$@"
|
2016-04-07 17:13:29 -07:00
|
|
|
then
|
|
|
|
successCount=$(expr $successCount + 1)
|
|
|
|
echo "--- Success: ${testName} ---"
|
|
|
|
else
|
2016-04-08 14:50:52 -07:00
|
|
|
failures[${#failures[@]}]="$testName"
|
2016-04-07 17:13:29 -07:00
|
|
|
echo "!!! FAIL: ${testName} !!!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2014-10-30 19:58:13 -07:00
|
|
|
if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
|
2014-12-09 08:31:23 -08:00
|
|
|
for (( i = 0; i < ${#testScripts[@]}; i++ ))
|
|
|
|
do
|
2015-05-02 04:58:10 -07:00
|
|
|
if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
|
2014-12-09 08:31:23 -08:00
|
|
|
then
|
2016-04-07 17:13:29 -07:00
|
|
|
runTestScript \
|
|
|
|
"${testScripts[$i]}" \
|
|
|
|
"${BUILDDIR}/qa/rpc-tests/${testScripts[$i]}" \
|
|
|
|
--srcdir "${BUILDDIR}/src" ${passOn}
|
2014-12-09 08:31:23 -08:00
|
|
|
fi
|
|
|
|
done
|
2015-05-02 04:15:26 -07:00
|
|
|
for (( i = 0; i < ${#testScriptsExt[@]}; i++ ))
|
|
|
|
do
|
2015-05-02 04:58:10 -07:00
|
|
|
if [ "$1" == $extArg ] || [ "$1" == "${testScriptsExt[$i]}" ] || [ "$1.py" == "${testScriptsExt[$i]}" ]
|
2015-05-02 04:15:26 -07:00
|
|
|
then
|
2016-04-07 17:13:29 -07:00
|
|
|
runTestScript \
|
|
|
|
"${testScriptsExt[$i]}" \
|
|
|
|
"${BUILDDIR}/qa/rpc-tests/${testScriptsExt[$i]}" \
|
|
|
|
--srcdir "${BUILDDIR}/src" ${passOn}
|
2015-05-02 04:15:26 -07:00
|
|
|
fi
|
|
|
|
done
|
2016-04-07 17:13:29 -07:00
|
|
|
|
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
|
2014-10-30 19:58:13 -07:00
|
|
|
else
|
|
|
|
echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled"
|
|
|
|
fi
|