2014-10-31 03:58:13 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
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}
|
|
|
|
|
2014-11-17 20:08:08 +01:00
|
|
|
if [ "x${EXEEXT}" = "x.exe" ]; then
|
|
|
|
echo "Win tests currently disabled"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2014-10-31 03:58:13 +01:00
|
|
|
#Run the tests
|
|
|
|
|
2014-12-09 17:31:23 +01:00
|
|
|
testScripts=(
|
|
|
|
'wallet.py'
|
|
|
|
'listtransactions.py'
|
|
|
|
'mempool_resurrect_test.py'
|
|
|
|
'txn_doublespend.py'
|
|
|
|
'txn_doublespend.py --mineblock'
|
|
|
|
'getchaintips.py'
|
2015-03-23 18:16:07 +01:00
|
|
|
'rawtransactions.py'
|
2014-12-09 17:31:23 +01:00
|
|
|
'rest.py'
|
|
|
|
'mempool_spendcoinbase.py'
|
|
|
|
'mempool_coinbase_spends.py'
|
|
|
|
'httpbasics.py'
|
2015-01-07 11:21:53 +01:00
|
|
|
'zapwallettxes.py'
|
2015-04-17 19:26:03 +02:00
|
|
|
'proxy_test.py'
|
2015-02-04 02:59:41 +01:00
|
|
|
'merkle_blocks.py'
|
2015-04-25 03:26:30 +02:00
|
|
|
'fundrawtransaction.py'
|
2015-03-23 18:16:07 +01:00
|
|
|
'signrawtransactions.py'
|
2015-05-27 16:00:15 +02:00
|
|
|
'walletbackup.py'
|
2015-06-16 18:21:03 +02:00
|
|
|
'nodehandling.py'
|
2015-06-17 18:06:39 +02:00
|
|
|
'reindex.py'
|
2015-06-30 15:40:44 +02:00
|
|
|
'decodescript.py'
|
2015-05-02 13:15:26 +02:00
|
|
|
);
|
|
|
|
testScriptsExt=(
|
|
|
|
'bipdersig-p2p.py'
|
|
|
|
'bipdersig.py'
|
|
|
|
'getblocktemplate_longpoll.py'
|
|
|
|
'getblocktemplate_proposals.py'
|
2015-05-02 13:58:10 +02:00
|
|
|
'pruning.py'
|
2015-05-02 13:15:26 +02:00
|
|
|
'forknotify.py'
|
|
|
|
'invalidateblock.py'
|
|
|
|
'keypool.py'
|
|
|
|
'receivedby.py'
|
|
|
|
'rpcbind_test.py'
|
2015-05-18 15:29:39 +02:00
|
|
|
# 'script_test.py'
|
2015-05-02 13:15:26 +02:00
|
|
|
'smartfees.py'
|
2015-04-28 18:36:15 +02:00
|
|
|
'maxblocksinflight.py'
|
2015-04-28 18:39:47 +02:00
|
|
|
'invalidblockrequest.py'
|
2015-04-01 15:08:00 +02:00
|
|
|
'rawtransactions.py'
|
|
|
|
# 'forknotify.py'
|
2015-05-04 16:50:24 +02:00
|
|
|
'p2p-acceptblock.py'
|
2014-12-09 17:31:23 +01:00
|
|
|
);
|
2015-05-02 13:58:10 +02:00
|
|
|
|
|
|
|
extArg="-extended"
|
|
|
|
passOn=${@#$extArg}
|
|
|
|
|
2014-10-31 03:58:13 +01:00
|
|
|
if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
|
2014-12-09 17:31:23 +01:00
|
|
|
for (( i = 0; i < ${#testScripts[@]}; i++ ))
|
|
|
|
do
|
2015-05-02 13:58:10 +02:00
|
|
|
if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
|
2014-12-09 17:31:23 +01:00
|
|
|
then
|
2015-01-07 11:21:53 +01:00
|
|
|
echo -e "Running testscript \033[1m${testScripts[$i]}...\033[0m"
|
2015-05-02 13:58:10 +02:00
|
|
|
${BUILDDIR}/qa/rpc-tests/${testScripts[$i]} --srcdir "${BUILDDIR}/src" ${passOn}
|
2014-12-09 17:31:23 +01:00
|
|
|
fi
|
|
|
|
done
|
2015-05-02 13:15:26 +02:00
|
|
|
for (( i = 0; i < ${#testScriptsExt[@]}; i++ ))
|
|
|
|
do
|
2015-05-02 13:58:10 +02:00
|
|
|
if [ "$1" == $extArg ] || [ "$1" == "${testScriptsExt[$i]}" ] || [ "$1.py" == "${testScriptsExt[$i]}" ]
|
2015-05-02 13:15:26 +02:00
|
|
|
then
|
2015-05-02 13:58:10 +02:00
|
|
|
echo -e "Running \033[1m2nd level\033[0m testscript \033[1m${testScriptsExt[$i]}...\033[0m"
|
|
|
|
${BUILDDIR}/qa/rpc-tests/${testScriptsExt[$i]} --srcdir "${BUILDDIR}/src" ${passOn}
|
2015-05-02 13:15:26 +02:00
|
|
|
fi
|
|
|
|
done
|
2014-10-31 03:58:13 +01:00
|
|
|
else
|
|
|
|
echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled"
|
|
|
|
fi
|