aboutsummaryrefslogtreecommitdiff
path: root/test/functional
AgeCommit message (Collapse)Author
2019-04-08scripted-diff: Rename sync_blocks to send_blocks to avoid name collisions ↵MarcoFalke
and confusion -BEGIN VERIFY SCRIPT- FILE_LIST=$(git grep -l 'def sync_blocks' ./test/functional/*.py) sed -i -e 's/def sync_blocks/def send_blocks/g' $FILE_LIST sed -i -e 's/self.sync_blocks/self.send_blocks/g' $FILE_LIST -END VERIFY SCRIPT-
2019-04-08Merge #15495: Add regtests for HTTP status codesJonas Schnelli
8f5d9431a Add regtests for HTTP status codes. (Daniel Kraft) Pull request description: This adds explicit tests for the returned HTTP status codes to `interface_rpc.py` (for error cases) and the HTTP JSON-RPC client in general for success. #15381 brought up discussion about the HTTP status codes in general, and the general opinion was that the current choice may not be ideal but should not be changed to preserve compatibility with existing JSON-RPC clients. Thus it makes sense to actually test the current status to ensure this desired compatibility is not broken accidentally. ACKs for commit 8f5d94: laanwj: utACK 8f5d9431a36740aa12abc0acea64df48fe32d2a6 promag: utACK 8f5d943. jonasschnelli: utACK 8f5d9431a36740aa12abc0acea64df48fe32d2a6 Tree-SHA512: 82503ccd134dd9145304e95cb6c61755f100bee27593d567cdd5c0c554d47e7b06d937456cab04107f46f4984930355db65d5e711008a0b05f2b8feec9f2950e
2019-04-06Merge #15660: [qa] Overhaul p2p_compactblocks.pyMarcoFalke
7813eb1db1 [qa] Overhaul p2p_compactblocks.py (Suhas Daftuar) Pull request description: Remove tests of: - compactblock behavior in a simulated pre-segwit version of bitcoind This should have been removed a long time ago, as it is not generally necessary for us to test the behavior of old nodes (except perhaps if we want to test that upgrading from an old node to a new one behaves properly) - compactblock behavior during segwit upgrade (ie verifying that network behavior before and after activation was as expected) This is unnecessary to test now that segwit activation has already happened. ACKs for commit 7813eb: jnewbery: utACK 7813eb1db132c023902ad945995cc32a325893ca Tree-SHA512: cadf035e6f822fa8cff974ed0c2e88a1d4d7da559b341e574e785fd3d309cc2c98c63bc05479265dc00550ae7b77fc3cbe815caae7f68bcff13a04367dca9b52
2019-04-02Merge #15680: Remove resendwallettransactions RPC methodMarcoFalke
ea1a2d8794 [wallet] Remove ResendWalletTransactionsBefore (John Newbery) f5162458cd [rpc] remove resendwallettransactions RPC (John Newbery) Pull request description: Remove resendwallettransactions RPC method This RPC was added for testing wallet rebroadcasts. Since we now have a real test for wallet rebroadcasts, it's no longer needed. The call in wallet_basic.py can be removed because wallet_resendwallettransactions.py tests wallet rebroadcast. ACKs for commit ea1a2d: MarcoFalke: re-utACK ea1a2d8794 promag: utACK ea1a2d8. Tree-SHA512: 48245d947be1a2d2b8c30d2946105818c454a03b70b63534ecadf2144da64dafe1c9527ea670a5f4d1acd05ccdfc6c9be43ca636ee2ba58a8b7a7b2fc7bc88fd
2019-04-01[qa] Overhaul p2p_compactblocks.pySuhas Daftuar
Remove tests of: - compactblock behavior in a simulated pre-segwit version of bitcoind This should have been removed a long time ago, as it is not generally necessary for us to test the behavior of old nodes (except perhaps if we want to test that upgrading from an old node to a new one behaves properly) - compactblock behavior during segwit upgrade (ie verifying that network behavior before and after activation was as expected) This is unnecessary to test now that segwit activation has already happened. Includes changes by John Newbery.
2019-04-01Merge #15652: wallet: Update transactions with current mempool after loadMarcoFalke
4bf1b1cefa qa: Check unconfirmed balance after loadwallet (João Barbosa) 2ebf650b2e wallet: Update transactions with current mempool after load (João Barbosa) 57908a739c interfaces: Add Chain::requestMempoolTransactions (João Barbosa) 0440481c6b wallet: Move CWallet::ReacceptWalletTransactions locks to callers (João Barbosa) Pull request description: Fixes #15591. ACKs for commit 4bf1b1: MarcoFalke: re-utACK 4bf1b1cefa jnewbery: utACK 4bf1b1cefa9723bf2cfa8b1a938757abc99bb17b Tree-SHA512: 604b1057c7f9fc3772084bf6914e52dd1a68a1cfd365f907e8ec78f6f5f726bc56a3cad9f2b665642714fbf3d51e37c1184ac396460bddeafd918e8f9f7af392
2019-03-31qa: Check unconfirmed balance after loadwalletJoão Barbosa
2019-03-29[rpc] remove resendwallettransactions RPCJohn Newbery
This RPC was added for testing wallet rebroadcasts. Since we now have a real test for wallet rebroadcasts, it's no longer needed. The call in wallet_basic.py can be removed because wallet_resendwallettransactions.py tests wallet rebroadcast.
2019-03-29[tests] make pruning test fasterJohn Newbery
This commit makes the pruning.py much faster. Key insights to do this: - pruning.py doesn't care what kind of transactions make up the big blocks that are pruned in the test. Instead of making blocks with several large, expensive to construct and validate transactions, instead make the large blocks contain a single coinbase transaction with a huge OP_RETURN txout. - avoid stop-starting nodes where possible. This test could probably be made even faster by using the P2P interface for submitting blocks instead of the submitblock RPC.
2019-03-29[tests] style fixes in feature_pruning.pyJohn Newbery
Minor style fixups. No functional change.
2019-03-27Merge #15646: [tests] Add test for wallet rebroadcastsMarcoFalke
529c1ae4a0 [tests] Add test for wallet rebroadcasts (John Newbery) Pull request description: The existing wallet_resendwallettransactions.py test only tests the resendwallettransactions RPC. It does not test whether transactions are actually rebroadcast, or whether the rebroadcast logic is called on a timer. Update the test to not use the resendwallettransactions RPC and test that transactions are resent on a timer. ACKs for commit 529c1a: MarcoFalke: re-utACK 529c1ae4a0 Tree-SHA512: 7341e7dd07cdc8ecbc08b1949121824148d2b58133a8e298ecdc5b7555713df3cecffb49854443cef9f033ef847cbf329e879a3bf57ab4e1fc733be432e9f718
2019-03-27[tests] Add test for wallet rebroadcastsJohn Newbery
The existing wallet_resendwallettransactions.py test only tests the resendwallettransactions RPC. It does not test whether transactions are actually rebroadcast, or whether the rebroadcast logic is called on a timer. This commit updates the test to not use the resendwallettransactions RPC and test that transactions are rebroadcast on a timer.
2019-03-24rpc: Rename size to vsize in mempool related callsMiguel Herranz
2019-03-23Merge #15642: [rpc] Remove deprecated rpc warningsWladimir J. van der Laan
947f73ceba7d74153fe83b538e42be1dfe77aea4 [docs] remove reference to signrawtransaction in the developer docs. (John Newbery) 7b6616b78bd9f76502002db1a209a0363979e506 [rpc] Remove deprecated functionality message from validateaddress help (John Newbery) 839c3f7c4937eb8a3e1e5ab2dafff26688af1078 [rpc] Remove signrawtransaction warning (John Newbery) Pull request description: Removes some deprecated code from the RPCs: - signrawtransaction was deprecated in 0.17 and removed in 0.18. A warning message was left in place to advise users to use signrawtransactionwithwallet and signrawtransactionwithkey. That warning can now be removed. - validateaddress had some functionality deprecated in 0.17 and removed in 0.18. The help text for that functionality was not removed in 0.18 and can be removed now. Tree-SHA512: 981678a697954ff2c392752e5a183b4b12c4eb94f55766ee1aa97a70d300668237db8fc5748c2772869d0155ba4a93e38817887b98160ee972a6f6ee94e3f7d9
2019-03-22[rpc] Remove signrawtransaction warningJohn Newbery
signrawtransaction was deprecated in 0.17 and removed in 0.18. A warning was left in place to tell users to migrate to using signrawtransactionswithwallet or signrawtransactionwithkey. Remove the warning now that it's been two releases since the method was removed.
2019-03-19qa: mininode: Clearer error message on invalid magic bytesMarcoFalke
2019-03-18Merge #13541: wallet/rpc: sendrawtransaction maxfeerateMarcoFalke
7abd2e697c wallet/rpc: add maxfeerate parameter to testmempoolaccept (Karl-Johan Alm) 6c0a6f73e3 wallet/rpc: add maxfeerate parameter to sendrawtransaction (Karl-Johan Alm) e5efacb941 test: Refactor vout fetches in rpc_rawtransaction (Karl-Johan Alm) Pull request description: This adds a new `maxfeerate` parameter to `sendrawtransaction` which forces the node to reject a transaction whose feerate is above the given fee rate. This is a safety harness from shooting yourself in the foot and accidentally overpaying fees. See also #12911. Tree-SHA512: efa50134a7c17c9330cfdfd48ba400e095c0a419cc45e630618d8b44929c25d780d1bb2710c1fbbb6e687eca373505b0338cdaa7f2ff4ca22636d84c31557a2e
2019-03-18Merge #15466: tests: Print remaining jobs in test_runner.pyMarcoFalke
2e5d482659 tests: Print remaining jobs in test_runner.py (Steven Roose) Pull request description: This helps finding out which tests fail to finish. Tree-SHA512: d22beb82beecd33aaa50731c83075e49577842d29fd21aa63bcb859df5da99069eba9cc16eed5d91dbba8fb0fdc317fb88b3b370c4d3917e9da1cd13b0a622dc
2019-03-14wallet/rpc: add maxfeerate parameter to testmempoolacceptKarl-Johan Alm
2019-03-14wallet/rpc: add maxfeerate parameter to sendrawtransactionKarl-Johan Alm
2019-03-12rpc: return a number for estimated_feerate in analyzepsbtfanquake
2019-03-11Merge #15564: cli: remove duplicate wallet fields from -getinfoMarcoFalke
3f6568d66b cli: remove duplicate wallet fields from -getinfo (fanquake) Pull request description: `walletversion` and `balance` are both included below. Tree-SHA512: cd9fe9739a2f492c8f7c0407b43a6fa95187f7e5318f05e080bac112f9f4333d2e9b84c505d098f8d66fa79439007d1c0b22e5a87d70bf5ea53ab647ee4c2046
2019-03-09cli: remove duplicate wallet fields from -getinfofanquake
2019-03-09cli: replace testnet with chain and return network name as per BIP70.fanquake
2019-03-06test: Refactor vout fetches in rpc_rawtransactionKarl-Johan Alm
2019-03-05tests: Print remaining jobs in test_runner.pySteven Roose
This helps finding out which tests fail to finish.
2019-03-05Merge #14954: build: Require python 3.5MarcoFalke
fa2797808e test: Remove python3.4 workaround in feature_dbcrash (MarcoFalke) dddd1d05d3 .python-version: Specify full version 3.5.6 (MarcoFalke) faa7cdf764 scripted-diff: Update copyright in ./test (MarcoFalke) fa0e65b772 scripted-diff: test: Remove brackets after assert (MarcoFalke) fab5a1e0f4 build: Require python 3.5 (MarcoFalke) fa6bf21f5e scripted-diff: test: Use py3.5 bytes::hex() method (MarcoFalke) Pull request description: Python 3.4 is EOL after March 2019, so switch to 3.5. See https://devguide.python.org/#status-of-python-branches This pull does the following in a bunch of commits: * scripted diff to use the `bytes::hex()` method in place of previous wrappers (`b2x`, `bytes_to_hex_str`, `hexlify`, ...) * Update the build system (gitian and travis) to remove python2.7 and replace it with python3.5 * Another scripted-diff to remove brackets after `assert`. This is unrelated to the python3.5 switch, but a stylistic commit, so probably not worth to split up. The motivation behind it is to avoid asserting on data structures (such as tuples of length one), which never fails: ```py >>> assert(False,) # with brackets >>> assert False, # without brackets SyntaxError: invalid syntax >>> assert False # proper assertion AssertionError ``` * And then a final scripted diff to update the copyright headers in the `test` subfolder, since I touched most of the files anyway and it wouldn't make sense to split this commit out into a separate pull. For reference (contributed by luke-jr): Ubuntu LTS (bionic): 3.6.5 Debian stable (stretch): 3.5.3 RHEL 8 (expected before v0.19): 3.6.x Gentoo stable: 3.6.5 Arch: 3.7.1 Tree-SHA512: 643c28cd2d5b9543ce4bf8ad2a8b282bc79b37dc5b25c9c8358e6ce201e2a67a546463e5f3430b16652eb2489d7c3ed4b0772cd2e2bf790fe68a5e3cc8a25029
2019-03-04test: Remove python3.4 workaround in feature_dbcrashMarcoFalke
2019-03-02scripted-diff: Update copyright in ./testMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./test/ -END VERIFY SCRIPT-
2019-03-02scripted-diff: test: Remove brackets after assertMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test) -END VERIFY SCRIPT-
2019-03-02build: Require python 3.5MarcoFalke
2019-03-02scripted-diff: test: Use py3.5 bytes::hex() methodMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i -e "s/def bytes_to_hex_str/def b_2_x/g" $(git grep -l bytes_to_hex_str) export RE_B_0="[^()]*" # match no bracket export RE_B_1="${RE_B_0}\(${RE_B_0}\)${RE_B_0}" # match exactly one () export RE_B_2="${RE_B_0}\(${RE_B_1}\)${RE_B_0}" # match wrapped (()) export RE_M="(b2x|bytes_to_hex_str)\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\)" sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l -E '(b2x|bytes_to_hex_str)') sed -i --regexp-extended -e "/ +bytes_to_hex_str( as b2x)?,/d" $(git grep -l bytes_to_hex_str) sed -i --regexp-extended -e "s/ +bytes_to_hex_str( as b2x)?,//g" $(git grep -l bytes_to_hex_str) sed -i --regexp-extended -e "s/, bytes_to_hex_str( as b2x)?//g" $(git grep -l bytes_to_hex_str) export RE_M="(binascii\.)?hexlify\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\).decode\(${RE_B_0}\)" sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l hexlify -- ':(exclude)share') sed -i --regexp-extended -e "/from binascii import hexlify$/d" $(git grep -l hexlify -- ':(exclude)share') sed -i --regexp-extended -e "s/(from binascii import) .*hexlify/\1 unhexlify/g" $(git grep -l hexlify -- ':(exclude)share') sed -i -e 's/ignore-names "/ignore-names "b_2_x,/g' ./test/lint/lint-python-dead-code.sh -END VERIFY SCRIPT-
2019-03-02Merge #15335: Fix lack of warning of unrecognized section namesMarcoFalke
1a7ba84e11 Fix lack of warning of unrecognized section names (Akio Nakamura) Pull request description: In #14708, It was introduced that to warn when unrecognized section names are exist in the config file. But ```m_config_sections.clear()``` in ```ArgsManager::ReadConfigStream()``` is called every time when reading each configuration file, so it can warn about only last reading file if ```includeconf``` exists. This PR fix lack of warning by collecting all section names by moving ```m_config_sections.clear()``` to ```ArgsManager::ReadConfigFiles()``` . Also add a test code to confirm this situation. Tree-SHA512: 26aa0cbe3e4ae2e58cbe73d4492ee5cf465fd4c3e5df2c8ca7e282b627df9e637267af1e3816386b1dc6db2398b31936925ce0e432219fec3a9b3398f01e3e65
2019-03-02Merge #15492: [rpc] remove deprecated generate methodMarcoFalke
07cae5287c [wallet] remove unused GetScriptForMining (Sjors Provoost) 8bb3e4c487 [rpc] remove deprecated generate method (Sjors Provoost) Pull request description: As announced in v0.18, the wallet generate rpc method is deprecated and will be fully removed in v0.19. Clients should transition to using the node rpc method `generatetoaddress`. Tree-SHA512: 9e5e913b59f3e18440b2b7b356124c7b87ad19f81a1ab6ada06a6c396b84e734895465f569296f1ba8c12abf74863bab5fd77765c9e806c239713aa83a59485f
2019-03-01Merge #15485: add rpc_misc.py, mv test getmemoryinfo, add test mallocinfoMarcoFalke
f13ad1cae0 modify test for memory locked in case locking pages failed at some point (Adam Jonas) 2fa85ebd1c add rpc_misc.py, mv test getmemoryinfo, add test mallocinfo (Adam Jonas) Pull request description: Creating the `rpc_misc.py` functional test file to add space for adding tests to a file that doesn't have a lot of coverage. - Removing the `getmemoryinfo()` smoke test from wallet basic rather than moving it to keep the wallet decoupled. Feel like testing for reasonable memory allocation values should suffice. - Adding coverage for `mallocinfo()`. Introduced standard lib XML parser since the function exports an XML string that describes the current state of the memory-allocation implementation in the caller. Tree-SHA512: ced30115622916c88d1e729969ee331272ec9f2881eb36dee4bb7331bf633a6810a57fed63a0cfaf86de698edb5162e6a035efd07c89ece1df56b69d61288072
2019-03-01modify test for memory locked in case locking pages failed at some pointAdam Jonas
2019-03-01Merge #15497: rpc: Consistent range arguments in ↵MarcoFalke
scantxoutset/importmulti/deriveaddresses ca253f6ebf Make deriveaddresses use stop/[start,stop] notation for ranges (Pieter Wuille) 1675b7ce55 Use stop/[start,stop] notation in importmulti desc range (Pieter Wuille) 4566011631 Add support for stop/[start,stop] ranges to scantxoutset (Pieter Wuille) 6b9f45e81b Support ranges arguments in RPC help (Pieter Wuille) 7aa6a8aefb Add ParseRange function to parse args of the form int/[int,int] (Pieter Wuille) Pull request description: This introduces a consistent notation for RPC arguments in `scantxoutset`, `importmulti`, and `deriveaddresses`, either: * `"range" : int` to just specify the end of the range * `"range" : [int,int]` to specify both the begin and the end of the range. For `scantxoutset`, this is a backward compatible new feature. For the two other RPCs, it's an incompatible change, but neither of them has been in a release so far. Because of that non-released reason, this only makes sense in 0.18, in my opinion. I suggest this as an alternative to #15496, which only makes `deriveaddresses` compatible with `importmulti`, but not with the existing `scantxoutset` RPC. I also think `[int,int]` is more convenient than `{"start":int,"stop":int}`. I realize this is technically a feature added to `scantxoutset` after the feature freeze. If desired, I'll drop the `scantxoutset` changes. Tree-SHA512: 1cbebb90cf34f106786dbcec7afbf3f43fb8b7e46cc7e6763faf1bc1babf12375a1b3c3cf86ee83c21ed2171d99b5a2f60331850bc613db25538c38b6a056676
2019-03-01Add regtests for HTTP status codes.Daniel Kraft
This adds explicit tests for the returned HTTP status codes to interface_rpc.py (for error cases) and the HTTP JSON-RPC client in general for success. PR 15381 brought up discussion about the HTTP status codes in general, and the general opinion was that the current choice may not be ideal but should not be changed to preserve compatibility with existing JSON-RPC clients. Thus it makes sense to actually test the current status to ensure this desired compatibility is not broken accidentally.
2019-02-28Make deriveaddresses use stop/[start,stop] notation for rangesPieter Wuille
2019-02-28test: Bump timeout on tests that timeout on windowsMarcoFalke
2019-02-28Use stop/[start,stop] notation in importmulti desc rangePieter Wuille
2019-02-28Add support for stop/[start,stop] ranges to scantxoutsetPieter Wuille
2019-02-27[rpc] remove deprecated generate methodSjors Provoost
2019-02-26add rpc_misc.py, mv test getmemoryinfo, add test mallocinfoAdam Jonas
2019-02-26Merge #15471: rpc/gui: Remove 'Unknown block versions being mined' warningMarcoFalke
ef362f2773 rpc/gui: Remove 'Unknown block versions being mined' warning (Wladimir J. van der Laan) Pull request description: Due to miners inserting garbage into the version numbers causing false positives, the current version signalling has become completely useless. This removes the "unknown block versions" warning which has the tendency to scare users unnecessarily (and might get them to "update" to something bad). It preserves the warning in the logs. Whether this is desirable can be a point of discussion. Tree-SHA512: 51407ccd24a571462465d9c7180f0f28307c50b82a03284abe783e181d8ab7e0638dbb710698d883f28de8a609db70763e39be2470d956e67c833da0768e43e9
2019-02-25Merge #15419: qa: Always refresh cache to be out of ibdMarcoFalke
fa2cdc9ac2 test: Simplify create_cache (MarcoFalke) fa25210d62 qa: Fix wallet_txn_doublespend issue (MarcoFalke) 1111aecbb5 qa: Always refresh stale cache to be out of ibd (MarcoFalke) fab0d85802 qa: Remove mocktime unless required (MarcoFalke) Pull request description: When starting a test, we are always in IBD because the timestamps on cached blocks are in the past. Usually, we solve that by generating a block at the beginning of the test. That is clumsy and might even lead to other problems such as #15360 and https://github.com/bitcoin/bitcoin/issues/14446#issuecomment-461926598 So fix that by getting rid of mocktime and always refreshing the last block of the cache when starting the test framework. Should fix #14446 Tree-SHA512: 6af09800f9c86131349a103af617a54551f5f3f3260d38e14e3f30fdd3d91a0feb0100c56cbb12eae4aeac5571ae4b530b16345cbb831d2670237b53351a22c1
2019-02-25test: Simplify create_cacheMarcoFalke
2019-02-25rpc/gui: Remove 'Unknown block versions being mined' warningWladimir J. van der Laan
Due to miners inserting garbage into the version numbers, the current version signalling has become completely useless. This removes the "unknown block versions" warning which has the tendency to scare users unnecessarily (and might get them to "update" to something bad). It preserves the warning in the logs. Whether this is desirable can be a point of discussion.
2019-02-20rpc: Actually throw help when passed invalid number of paramsMarcoFalke
2019-02-20Merge #15439: tests: remove byte.hex() to keep compatibilityMarcoFalke
1a062b85f0 tests: remove byte.hex() to keep compatibility (Akio Nakamura) Pull request description: Use ```test_framework.util.bytes_to_hex_str()``` instead of ```bytes.hex()``` that new in Python 3.5 to support minimum version of Python(test). ```test/functional/test_framework/wallet_util.py``` is also reported to have '\.hex()' in #15397, but it does not matter because it calls CScript.hex() defined in wallet_util.py. Tree-SHA512: 1019212e965f0848d235fab4da11959dffa42e8adfcd41216c10795cfc63c804b5deb5a3317f25d29940b9dcf088ab76fe3fa80d2679dc19f5f482dc5bde3283