aboutsummaryrefslogtreecommitdiff
path: root/test/functional
AgeCommit message (Collapse)Author
2017-10-03[tests] Make p2p-leaktests.py more robustJohn Newbery
Github-Pull: #11078 Rebased-From: 0063d2c3dce9d9c1678197d2c65ee878793d1ef9
2017-10-03[qa] zapwallettxes: Wait up to 3s for mempool reloadMarcoFalke
Github-Pull: #11308 Rebased-From: fadd0c16b6bd62e9d663d906755320ae089e02d3
2017-10-03Add listwallets RPC test to multiwallet.pyCristian Mircea Messel
Github-Pull: #11310 Rebased-From: fb1f3258225a7052f4fc9e3f2accc3811c53e221
2017-10-03[tests] fixup dbcrash interaction with add_nodes()John Newbery
Github-Pull: #11230 Rebased-From: 8fdb6f9126fe1e13b60de11fd34c204247679ef4
2017-10-03[test] Replace check_output with low level versionJoão Barbosa
Github-Pull: #11125 Rebased-From: ce379b47b92d6c04250c21719bb1abfb41c586ad
2017-10-03[test] Add assert_raises_process_error to assert process errorsJoão Barbosa
Github-Pull: #11125 Rebased-From: 232e3e8471edb346c09f906c996b2f350cabc72a
2017-10-03[test] Add support for custom arguments to TestNodeCLIJoão Barbosa
Github-Pull: #11125 Rebased-From: 5c18a84b9a49e3f9dacf0502dbf7d5d755f38da6
2017-10-03[test] Improve assert_raises_jsonrpc docstringJoão Barbosa
Github-Pull: #11125 Rebased-From: e1274947d4574bb83a020d0e178f0e5db7fc6282
2017-10-03[qa] TestNode: Add wait_until_stopped helper methodMarcoFalke
Github-Pull: #11067 Rebased-From: faa8d9581affde35a8242c63fca8a52004d4f943
2017-10-03Improve signmessages functional testCristian Mircea Messel
This patch improves branch coverage of the test, making sure a message can not be verified with the wrong address or signature. Github-Pull: #11241 Rebased-From: b3d6fc654770e3b4d2f82e8d77e531df9e522982
2017-10-03[tests] fixups from set_test_params()John Newbery
Github-Pull: #11215 Rebased-From: 3918d93f3cd2305dc12cb964aebba0fc1f8720b4
2017-10-03[tests] Functional tests must explicitly set num_nodesJohn Newbery
Github-Pull: #11121 Rebased-From: 7148b74dc39110f53c665b94fa9d994c6ad6dc1c
2017-10-03[tests] don't override __init__() in individual testsJohn Newbery
Almost all test scripts currently need to override the __init__() method. When they do that they need to call into super().__init__() as the base class does some generic initialization. This commit makes the base class __init__() call into set_test_params() method. Individual test cases can override set_test_params() to setup their test parameters. Github-Pull: #11121 Rebased-From: 5448a1471d6fc638a2220ea5a2f3782172efe14c
2017-10-03[tests] Avoid passing around member variables in test_frameworkJohn Newbery
Github-Pull: #11121 Rebased-From: 6cf094a0229d051ab8a15189c8a0bc6011919e72
2017-10-03[tests] TestNode: separate add_node from start_nodeJohn Newbery
Separates the act of creating a TestNode object from starting the node. The test_framework now keeps track of its list of TestNodes, and test writers can call start_node() and stop_node() without having to update the self.nodes list. Github-Pull: #11121 Rebased-From: 36b626867087e9fae6d85f926248997ebff327b7
2017-10-03[tests] fix - use rpc_timeout as rpc timeoutJohn Newbery
Github-Pull: #11121 Rebased-From: be2a2ab6a67beef97e3c3cf42bd5eeea6c4e55cf
2017-10-03Add getmininginfo functional testCristian Mircea Messel
Github-Pull: #11150 Rebased-From: 4f2905b76b502a9de235dbe739e5fe504ef5bc22
2017-10-03RPC: gettxout: Slightly improve doc and testsJorge Timón
Github-Pull: #10859 Rebased-From: 6d2d2eb49389d70a5db327e133c9c90748f82d5f
2017-10-03[tests] Add bitcoin_cli.py test scriptJohn Newbery
Github-Pull: #10798 Rebased-From: c6ec4358a797b7a11283238a0cf0b4531def9e92
2017-10-03[tests] add TestNodeCLI class for calling bitcoin-cli for a nodeJohn Newbery
Github-Pull: #10798 Rebased-From: b23549f6e677a8e22953568704eac7ea0c2c1289
2017-10-03qa: Move wait_until to utilMarcoFalke
Github-Pull: #11068 Rebased-From: 08ce33f8e95efa81b37ddc6b3350462c61bbfd51
2017-10-03[tests] fix timeout issues from TestNodeJohn Newbery
Fixes a couple of bugs from the introduction of TestNode: - test scripts were no longer able to specify a custom timeout for starting a node. Therefore tests with nodes that take a long time to start up (eg pruning.py) would fail. - the test for whether a node has failed on start up was broken by changing 'assert x is None' to 'assert not x'. Since subprocess.poll() can return None (indicating the node is still running) or 0 (indicating the node exited with return code 0), this was a regression. Github-Pull: #11077 Rebased-From: 2b4ea520b717b3ca894adbac17796786667764d3
2017-10-03test: Increase initial RPC timeout to 60 secondsWladimir J. van der Laan
When running the tests locally with a parallelism of 4 on an otherwise busy system, RPC can take quite a wait to come up. Change the timeout to 60 seconds just to be safe. Github-Pull: #11091 Rebased-From: c1470a058f21bf98d83b9dc345c61626b87035cc
2017-10-03[tests] Introduce TestNodeJohn Newbery
TestNode is a class responsible for all state related to a bitcoind node under test. It stores local state, is responsible for tracking the bitcoind process and delegates unrecognised messages to the RPC connection. This commit changes start_nodes and stop_nodes to start and stop the bitcoind nodes in parallel, making test setup and teardown much faster. Github-Pull: #10711 Rebased-From: 7897338918dac072e788b8ab2919d4559f311bef
2017-08-14Merge #11022: Basic keypool topupWladimir J. van der Laan
d34957e [wallet] [tests] Add keypool topup functional test (Jonas Schnelli) 095142d [wallet] keypool mark-used and topup (John Newbery) c25d90f [wallet] Add HasUnusedKeys() helper (John Newbery) f2123e3 [wallet] Cache keyid -> keypool id mappings (John Newbery) 83f1ec3 [wallet] Don't hold cs_LastBlockFile while calling setBestChain (John Newbery) 2376bfc [wallet] [moveonly] Move LoadKeyPool to cpp (Matt Corallo) cab8557 [wallet] [moveonly] Move CAffectedKeysVisitor (Jonas Schnelli) Pull request description: This PR contains the first part of #10882 : - if a key from the keypool is used, mark all keys up to that key as used, and then try to top up the keypool - top up the keypool on startup Notably, it does not stop the node or prevent the best block from advancing if the keypool drops below a threshold (which means that transactions may be missed and funds lost if restoring from an old HD wallet backup). Tree-SHA512: ac681fefeaf7ec2aab2fa1da93d12273ea80bd05eb48d7b3b551ea6e5d975dd97ba7de52b7fba52993823280ac4079cc36cf78a27dac708107ebf8fb6326142b
2017-08-12Merge #11032: [qa] Fix block message processing error in sendheaders.pyMarcoFalke
f1bf31186 [qa] Fix block message processing error in sendheaders.py (Suhas Daftuar) Pull request description: Introduced in #10169 @jnewbery Tree-SHA512: f330b926c51bd4f1b63738e1ddac23c58cb32345baed36343f7a989b3b9906c5c6e7dbd74b416f662c6ef68b8d256a6c69a977ec5f85789b2c1dc802bc831f6b
2017-08-12test: Add resendwallettransactions functional testsJoão Barbosa
2017-08-11[qa] Fix block message processing error in sendheaders.pySuhas Daftuar
2017-08-11Merge #11023: [tests] Add option to attach a python debugger if functional ↵MarcoFalke
test fails cc5d38f4b Add option to attach a python debugger if test fails (John Newbery) Pull request description: Adds a simple option to the test_framework to attach pdb if the test fails. Helpful for catching and debugging intermittent failures: Run the test in a loop with this option. The first failure will cause execution to pause and nodes will be left running for interactive debugging. @sdaftuar Tree-SHA512: 01cfae15fa3f04ed6ec6a99fef60a6c6a59723429309e81eacd6767caf12f5758f59b337804291ecab33a38a2958f36e2b513d201bee72a2eeb207a67046f952
2017-08-11Merge #11025: qa: Fix inv race in example_testMarcoFalke
faa76d1b7 qa: Fix inv race in example_test (MarcoFalke) Pull request description: There have been intermittent test failures on this script. ```py File "./test/functional/example_test.py", line 216, in run_test assert_equal(block, 1) AssertionError: not(2 == 1) ``` Probably the simplest way to fix them is overriding the `on_inv` method, so that no "colliding" getdata for the blocks are sent out. Additionally, all getdata are now sent in a single message. Tree-SHA512: 809c2bbfa90a67fc97905769fcbe90ba9abe1aac1f145530934f56a364835973b94d3302b6be68f4f2987acf333bce146bcc4c878c283301871ba5bb1a9bedb6
2017-08-10qa: Fix inv race in example_testMarcoFalke
2017-08-10[wallet] [tests] Add keypool topup functional testJonas Schnelli
2017-08-10[wallet] keypool mark-used and topupJohn Newbery
This commit adds basic keypool mark-used and topup: - try to topup the keypool on initial load - if a key in the keypool is used, mark all keys before that as used and try to top up
2017-08-10Add option to attach a python debugger if test failsJohn Newbery
2017-08-09Merge #11003: Docs: Capitalize bullet points in CONTRIBUTING guideMarcoFalke
13b1e9a16 Capitalize bullet points in CONTRIBUTING guide (Evan Klitzke) Pull request description: English grammar dictates that these bullet points should be capitalized. This also makes the capitalization style consistent with the rest of the document, e.g. the "Decision Making Process" section. Tree-SHA512: 59f5a8941180ff3862ba63d364c27fd83d2e144299a71b2e784d58f806e8a02d7951dcc80fcc7152d0c78c2d1f5a22db1236af7ea6b9abece8dbe93533e4b65c
2017-08-08Merge #10695: [qa] Rewrite BIP65/BIP66 functional testsMarcoFalke
4ccc12a54 [qa] Rewrite BIP66 functional tests (Suhas Daftuar) d4f0d87b6 [qa] Rewrite BIP65 functional tests (Suhas Daftuar) Pull request description: After 122786d0e0170c73536360b705af711e1338adbf, BIP65 and BIP66 activate at particular fixed heights (without regard to version numbers of blocks below those heights). Rewrite the functional tests to take this into account, and remove two tests that weren't really testing anything. Moves the rewritten functional tests out of the extended test suite, so that they run in travis regularly. Note: I discovered that the ComparisonTestFramework (which the original versions of these p2p tests were written is, has a bug that caused them to not catch obvious errors, eg if you just comment out setting the script flags for these softforks in ConnectBlock, the versions of these tests in master do not fail(!) -- will separately PR a fix for the comparison test framework). Tree-SHA512: 2108b79951f2e980854d0d14ccc0fd1810a43dd4251fd6e3b203e7f104ea55e00650bb1a60a28c2801b4249f46563a8559ac3e3cd39db220914acfed0b3b163d
2017-08-08Capitalize bullet points in CONTRIBUTING guideEvan Klitzke
English grammar dictates that these bullet points should be capitalized. This also makes the capitalization style consistent with the rest of the document, e.g. the "Decision Making Process" section.
2017-08-07[tests] Test disconnecting unsupported service bits logic.John Newbery
In v0.15, we disconnect nodes that send us version messages with unsupported service bits (1 << 5 and 1 << 7). This commit adds a test that bitcoind will disconnect those nodes before August 1st 2018, and won't disconnect those nodes after August 1st 2018.
2017-08-01Merge #10788: [RPC] Fix addwitnessaddress by replacing ismine with ↵Wladimir J. van der Laan
producesignature e222dc2 Replace ismine with producesignature check in witnessifier (Andrew Chow) Pull request description: Instead of using ismine to check whether an address can be spent by us, make the witness version of the script or address first and then use ProduceSignature with the DummySignatureCreator to check if we can solve for the script. This is to fix cases where we don't have all of the private keys (for something like a multisig address) but have the redeemscript so we can witnessify it. Tree-SHA512: 371777aee839cceb41f099109a13689120d35cf3880cde39216596cc2aac5cc1096af7d9cf07ad9306c3b05c073897f4518a7e97f0b88642f1e3b80b799f481e
2017-07-28[wallet] Specify wallet name in wallet loading errorsJohn Newbery
2017-07-28Reject invalid wallet filesJoão Barbosa
2017-07-28Reject duplicate wallet filenamesJoão Barbosa
2017-07-27Replace ismine with producesignature check in witnessifierAndrew Chow
Instead of using ismine to check whether an address can be spent by us, make the witness version of the script or address first and then use ProduceSignature with the DummySignatureCreator to check if we can solve for the script. Also fixes test cases to reflect this change.
2017-07-26Fix misleading "Method not found" multiwallet errorsRussell Yanofsky
Raise RPC_WALLET_NOT_SPECIFIED instead of RPC_METHOD_NOT_FOUND when a required wallet filename was not specified in an RPC call. Also raise more specific RPC_WALLET_NOT_FOUND error instead of RPC_INVALID_PARAMETER in case an invalid wallet was specified, for consistency.
2017-07-25Revert "[tests] Allow tests to pass when stderr is non-empty"Wladimir J. van der Laan
This reverts commit d64ac3f4aab13a1a4e8d320b52e7a2b934e011b2 after further discussion. Tree-SHA512: db1e4ff5b17bcd6fd000a3d21aa74f6b7e4c194e0663c1896a100612671910a7cdadd896b59642420ea016598895b54a8468914847ebefef105a3c47c311d4b2
2017-07-25Merge #10703: [tests] Allow tests to pass when stderr is non-emptyMarcoFalke
d64ac3f [tests] Allow tests to pass when stderr is non-empty (Jonas Schnelli) Pull request description: Resurrect #10241 with nits addressed Not sure how much people want this. Would be useful for functional tests which cause bitcoind to print to stderr. Tree-SHA512: 28caccf7818fb3ed5a38caef7f77161b1678aa9b8fd12c2d1e76032f409f0d33c40f7ac91e0c8d908df4a44fd01cf97d657a08bae50c6ff17d07f5b2e20c3a6e
2017-07-24Merge #9622: [rpc] listsinceblock should include lost transactions when ↵Wladimir J. van der Laan
parameter is a reorg'd block 876e92b Testing: listsinceblock should display all transactions that were affected since the given block, including transactions that were removed due to a reorg. (Karl-Johan Alm) f999c46 listsinceblock: optionally find and list any transactions that were undone due to reorg when requesting a non-main chain block in a new 'removed' array. (Karl-Johan Alm) Pull request description: The following scenario will not notify the caller of the fact `tx0` has been dropped: 1. User 1 receives BTC in tx0 from utxo1 in block aa1. 2. User 2 receives BTC in tx1 from utxo1 (same) in block bb1 3. User 1 sees 2 confirmations at block aa3. 4. Reorg into bb chain. 5. User 1 asks `listsinceblock aa3` and does not see that tx0 is now invalidated. See `listsinceblock.py` commit for related test. The proposed fix is to iterate from the given block down to the fork point, and to check each transaction in the blocks against the wallet, in addition to including all transactions from the fork point to the active chain tip (the current behavior). Any transactions that were present will now also be listed in the `listsinceblock` output in a new `replaced` array. This operation may be a bit heavy but the circumstances (and perceived frequency of occurrence) warrant it, I believe. Example output: ```Python { 'transactions': [], 'replaced': [ { 'walletconflicts': [], 'vout': 1, 'account': '', 'timereceived': 1485234857, 'time': 1485234857, 'amount': '1.00000000', 'bip125-replaceable': 'unknown', 'trusted': False, 'category': 'receive', 'txid': 'ce673859a30dee1d2ebdb3c05f2eea7b1da54baf68f93bb8bfe37c5f09ed22ff', 'address': 'miqEt4kWp9zSizwGGuUWLAmxEcTW9bFUnQ', 'label': '', 'confirmations': -7 } ], 'lastblock': '7a388f27d09e3699102a4ebf81597d974fc4c72093eeaa02adffbbf7527f6715' } ``` I believe this addresses the comment by @luke-jr in https://github.com/bitcoin/bitcoin/pull/9516#issuecomment-274190081 but I could be wrong.. Tree-SHA512: 607b5dcaeccb9dc0d963d3de138c40490f3e923050b29821e6bd513d26beb587bddc748fbb194503fe618cfe34a6ed65d95e8d9c5764a882b6c5f976520cff35
2017-07-21[QA] Avoid running multiwallet.py twiceJonas Schnelli
2017-07-21Testing: listsinceblock should display all transactions that were affected ↵Karl-Johan Alm
since the given block, including transactions that were removed due to a reorg.
2017-07-20[wallet] [tests] Add listwallets to multiwallet testJohn Newbery