zcashd/qa/rpc-tests
Homu 9bf8443c16 Auto merge of #4504 - str4d:disconnectblock-fixes, r=str4d
Use the cached consensusBranchId in DisconnectBlock

If a node is started with a set of network upgrades that don't match the
serialized chain (such as when we implement NU rollbacks on testnet),
RewindBlockIndex will disconnect each block in the chain until it
reaches the most recent block that agrees with the node's set of network
upgrades. However, the blocks themselves should be disconnected using
the consensus branch ID that they were connected with, which is
persisted alongside the chain and reconstructed in LoadBlockIndex.
2020-05-28 02:51:34 +00:00
..
golden Update golden test for heartwood network upgrade. 2020-05-07 19:12:24 -06:00
test_framework Merge remote-tracking branch 'upstream/master' into hotfix-v2.1.2-2-golden 2020-05-14 12:24:44 -06:00
.gitignore Python-based regression tests 2014-02-28 15:24:31 -05:00
README.md Fix some typos in rpc-tests readme 2018-08-05 21:51:35 -07:00
addressindex.py test: Ignore timestamps in addressindex checks 2020-04-14 20:56:37 +12:00
bip65-cltv-p2p.py clean-up imports, keep string notation consistent, remove spacing 2020-02-09 08:15:43 -08:00
bipdersig-p2p.py update io module, fix py3 division, and string encoding 2020-02-09 08:15:43 -08:00
blockchain.py remove u encoding 2020-02-09 08:17:32 -08:00
decodescript.py Update hexlify for encoding, update to py3 io module 2020-02-09 08:14:21 -08:00
disablewallet.py Update py3 env path, remove py2 assert 2020-02-09 08:14:21 -08:00
feature_zip221.py Remove unused imports. 2020-05-05 11:41:06 -06:00
finalsaplingroot.py Update py2 conventions to py3, remove py2 env and assert 2020-02-09 08:14:21 -08:00
forknotify.py Update ignored testScriptsExt to Python3 2020-02-09 08:14:21 -08:00
framework.py remove unused import 2020-03-19 08:46:33 -03:00
fundrawtransaction.py clean-up imports, keep string notation consistent, remove spacing 2020-02-09 08:15:43 -08:00
getblocktemplate.py Update py2 env path, remove py2 assert 2020-02-09 08:14:21 -08:00
getblocktemplate_longpoll.py Add basic coverage reporting for RPC tests 2020-03-24 21:51:51 +13:00
getblocktemplate_proposals.py Update ignored testScriptsExt to Python3 2020-02-09 08:14:21 -08:00
getchaintips.py Update py2 env path, remove py2 assert 2020-02-09 08:14:21 -08:00
getrawtransaction_insight.py Update py2 env path, remove py2 assert, update filter to return list for py3 2020-02-09 08:14:21 -08:00
hardforkdetection.py Update ignored testScriptsExt to Python3 2020-02-09 08:14:21 -08:00
httpbasics.py fix pyflakes errors 2020-02-09 08:18:00 -08:00
invalidateblock.py Update ignored testScriptsExt to Python3 2020-02-09 08:14:21 -08:00
invalidblockrequest.py Update ignored testScriptsExt to Python3 2020-02-09 08:14:21 -08:00
key_import_export.py Update cmp to py3 functions, update map return to list for py3 2020-02-09 08:14:21 -08:00
keypool.py Updating remaining python3 conventions 2020-02-10 13:15:26 -08:00
listtransactions.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
maxblocksinflight.py Update ignored testScriptsExt to Python3 2020-02-09 08:14:21 -08:00
mempool_limit.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
mempool_nu_activation.py Fix decimal 0 issues 2020-02-09 08:17:32 -08:00
mempool_reorg.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
mempool_resurrect_test.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
mempool_spendcoinbase.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
mempool_tx_expiry.py remove space after new line 2020-03-07 09:26:25 -03:00
mergetoaddress_helper.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
mergetoaddress_mixednotes.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
mergetoaddress_sapling.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
mergetoaddress_sprout.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
merkle_blocks.py Auto merge of #4280 - oxarbitrage:issue2197, r=daira 2020-03-05 16:36:32 +00:00
mining_shielded_coinbase.py move check_node_log framework test to a new file 2020-03-10 11:05:49 -03:00
multi_rpc.py fix pyflakes errors 2020-02-09 08:18:00 -08:00
nodehandling.py clean-up imports, keep string notation consistent, remove spacing 2020-02-09 08:15:43 -08:00
p2p-acceptblock.py Updating remaining python3 conventions 2020-02-10 13:15:26 -08:00
p2p_node_bloom.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
p2p_nu_peer_management.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
p2p_txexpiringsoon.py update io module, fix py3 division, and string encoding 2020-02-09 08:15:43 -08:00
p2p_txexpiry_dos.py Update to py3, ISSUE with encoding 2020-02-09 08:15:43 -08:00
paymentdisclosure.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
post_heartwood_rollback.py Add RPC tests for post-Heartwood rollback 2020-05-28 09:54:42 +12:00
prioritisetransaction.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
proton_test.py Update py3 division 2020-02-09 08:18:00 -08:00
proxy_test.py update to py3 conventions, preserve ipv6 patch 2020-02-09 08:14:21 -08:00
pruning.py Update ignored testScriptsExt to Python3 2020-02-09 08:14:21 -08:00
rawtransactions.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
receivedby.py Update ignored testScriptsExt to Python3 2020-02-09 08:14:21 -08:00
regtest_signrawtransaction.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
reindex.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
reorg_limit.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
rest.py fix initialize statements for imports 2020-02-09 08:15:43 -08:00
rewind_index.py Narrow down the test case. 2020-04-14 17:47:29 -06:00
rpcbind_test.py Add basic coverage reporting for RPC tests 2020-03-24 21:51:51 +13:00
sapling_rewind_check.py Remove unused imports. 2020-05-05 11:41:06 -06:00
script_test.py Updating remaining python3 conventions 2020-02-10 13:15:26 -08:00
shorter_block_times.py fix type issue 2020-02-09 08:15:43 -08:00
signrawtransaction_offline.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
signrawtransactions.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
smartfees.py Update ignored testScriptsExt to Python3 2020-02-09 08:14:21 -08:00
spentindex.py Update to py3 conventions, update filter to return list 2020-02-09 08:14:21 -08:00
sprout_sapling_migration.py Update type to be decimal 2020-02-09 08:15:43 -08:00
timestampindex.py update to py3 conventions, update range to return list for py3 2020-02-09 08:14:21 -08:00
turnstile.py preserve test semantics 2020-03-18 22:49:44 -03:00
tx_expiry_helper.py fix pyflakes errors 2020-02-09 08:18:00 -08:00
txn_doublespend.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
upgrade_golden.py Remove unused imports. 2020-05-18 10:38:37 -06:00
wallet.py Auto merge of #4242 - oxarbitrage:issue3726, r=str4d 2020-05-28 00:49:49 +00:00
wallet_1941.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
wallet_addresses.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
wallet_anchorfork.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
wallet_changeaddresses.py clean up conventions and whitespace 2020-02-09 08:44:23 -08:00
wallet_changeindicator.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
wallet_import_export.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
wallet_listnotes.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
wallet_listreceived.py implement z_getnotescount api call 2020-04-25 11:17:20 -03:00
wallet_nullifiers.py Auto merge of #4249 - oxarbitrage:issue_3724, r=str4d 2020-04-25 05:28:16 +00:00
wallet_overwintertx.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
wallet_persistence.py Store imported Sapling ExtFVKs in wallet database 2020-02-21 01:32:15 +00:00
wallet_sapling.py add expected address check to tests 2020-04-07 10:39:33 -03:00
wallet_shieldcoinbase.py fix pyflakes errors 2020-02-09 08:18:00 -08:00
wallet_shieldcoinbase_sapling.py fix pyflakes errors 2020-02-09 08:18:00 -08:00
wallet_shieldcoinbase_sprout.py fix pyflakes errors 2020-02-09 08:18:00 -08:00
wallet_shieldingcoinbase.py preserve test semantics 2020-03-18 22:49:44 -03:00
wallet_treestate.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
walletbackup.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
zapwallettxes.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
zcjoinsplit.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
zcjoinsplitdoublespend.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
zkey_import_export.py fix pyflakes errors 2020-02-09 08:18:00 -08:00
zmq_test.py fix pyflakes errors 2020-02-09 08:18:00 -08:00

README.md

Regression tests of RPC interface

test_framework/test_framework.py

Base class for RPC regression tests.

test_framework/util.py

Generally useful functions.

Notes

You can run a single test by calling qa/pull-tester/rpc-tests.sh <testname>.

Run all possible tests with qa/pull-tester/rpc-tests.sh -extended.

Possible options:

-h, --help       show this help message and exit
  --nocleanup      Leave zcashds and test.* datadir on exit or error
  --noshutdown     Don't stop bitcoinds after the test execution
  --srcdir=SRCDIR  Source directory containing zcashd/zcash-cli (default:
                   ../../src)
  --tmpdir=TMPDIR  Root directory for datadirs
  --tracerpc       Print out all RPC calls as they are made

If you set the environment variable PYTHON_DEBUG=1 you will get some debug output (example: PYTHON_DEBUG=1 qa/pull-tester/rpc-tests.sh wallet).

A 200-block -regtest blockchain and wallets for four nodes is created the first time a regression test is run and is stored in the cache/ directory. Each node has the miner subsidy from 25 mature blocks (25*10=250 ZEC) in its wallet.

After the first run, the cache/ blockchain and wallets are copied into a temporary directory and used as the initial test state.

If you get into a bad state, you should be able to recover with:

rm -rf cache
killall zcashd