aboutsummaryrefslogtreecommitdiff
path: root/test/functional
AgeCommit message (Collapse)Author
2018-01-15Merge #11796: [tests] Functional test naming conventionWladimir J. van der Laan
5fecd84 [tests] Remove redundant import in blocktools.py test (Anthony Towns) 9b20bb4 [tests] Check tests conform to naming convention (Anthony Towns) 7250b4e [tests] README.md nit fixes (Anthony Towns) 82b2712 [tests] move witness util functions to blocktools.py (John Newbery) 1e10854 [tests] [docs] update README for new test naming scheme (John Newbery) Pull request description: Splitting #11774 into two parts -- this part updates the README with the proposed naming convention, and adds some checks to test_runner.py that the number of tests violating the naming convention doesn't increase too much. Idea is this part of the change should not introduce merge conflicts or require much rebasing, so reviews of the complicated bits won't become invalidated too often; while the second part will just be file renames, which will require regular rebasing and will introduce merge conflicts with pending PRs, but can be merged later, and should also be much easier to review, since it will only include relatively trivial changes. Tree-SHA512: b96557d41714addbbfe2aed62fb5a48639eaeb1eb3aba30ac1b3a86bb3cb8d796c6247f9c414c4695c4bf54c0ec9968ac88e2f88fb62483bc1a2f89368f7fc80
2018-01-12Merge #11970: Add test coverage for bitcoin-cli multiwallet callsMarcoFalke
a14dbff39e Allow multiwallet.py to be used with --usecli (Russell Yanofsky) f6ade9ce1a [tests] allow tests to be run with --usecli (John Newbery) ff9a363ff7 TestNodeCLI batch emulation (Russell Yanofsky) ca9085afc5 Prevent TestNodeCLI.args mixups (Russell Yanofsky) fcfb952bca Improve TestNodeCLI output parsing (Russell Yanofsky) Pull request description: Lack of test coverage was pointed out by @jnewbery in https://github.com/bitcoin/bitcoin/pull/11687#discussion_r158133900 Tree-SHA512: 5f10e31abad11a5edab0da4e2515e39547adb6ab9e55e50427ab2eb7ec9a43d6b896b579b15863e5edc9beee7d8bf1c84d9dabd247be0760a1b9ae39e1e8ee02
2018-01-11Merge #12133: [qa] Fix rare failure in p2p-segwit.pyWladimir J. van der Laan
35c2b1f Fix rare failure in p2p-segwit.py (Suhas Daftuar) Pull request description: Avoid creating very small utxos that would violate an assumption in test_non_standard_witness. Fixes #11953 Tree-SHA512: 5fb7ae68f8731df819bab365923a84568b57227e4112f711fc2574767d15be83acd3e99d0d5bac94a42411a958b13a2119468babefed14efcfdda180004d4166
2018-01-10Merge #11403: SegWit wallet supportJonas Schnelli
b224a47a1 Add address_types test (Pieter Wuille) 7ee54fd7c Support downgrading after recovered keypool witness keys (Pieter Wuille) 940a21932 SegWit wallet support (Pieter Wuille) f37c64e47 Implicitly know about P2WPKH redeemscripts (Pieter Wuille) 57273f2b3 [test] Serialize CTransaction with witness by default (Pieter Wuille) cf2c0b6f5 Support P2WPKH and P2SH-P2WPKH in dumpprivkey (Pieter Wuille) 37c03d3e0 Support P2WPKH addresses in create/addmultisig (Pieter Wuille) 3eaa003c8 Extend validateaddress information for P2SH-embedded witness (Pieter Wuille) 30a27dc5b Expose method to find key for a single-key destination (Pieter Wuille) 985c79552 Improve witness destination types and use them more (Pieter Wuille) cbe197470 [refactor] GetAccount{PubKey,Address} -> GetAccountDestination (Pieter Wuille) 0c8ea6380 Abstract out IsSolvable from Witnessifier (Pieter Wuille) Pull request description: This implements a minimum viable implementation of SegWit wallet support, based on top of #11389, and includes part of the functionality from #11089. Two new configuration options are added: * `-addresstype`, with options `legacy`, `p2sh`, and `bech32`. It controls what kind of addresses are produced by `getnewaddress`, `getaccountaddress`, and `createmultisigaddress`. * `-changetype`, with the same options, and by default equal to `-addresstype`, that controls what kind of change is used. All wallet private and public keys can be used for any type of address. Support for address types dependent on different derivation paths will need a major overhaul of how our internal detection of outputs work. I expect that that will happen for a next major version. The above also applies to imported keys, as having a distinction there but not for normal operations is a disaster for testing, and probably for comprehension of users. This has some ugly effects, like needing to associate the provided label to `importprivkey` with each style address for the corresponding key. To deal with witness outputs requiring a corresponding redeemscript in wallet, three approaches are used: * All SegWit addresses created through `getnewaddress` or multisig RPCs explicitly get their redeemscripts added to the wallet file. This means that downgrading after creating a witness address will work, as long as the wallet file is up to date. * All SegWit keys in the wallet get an _implicit_ redeemscript added, without it being written to the file. This means recovery of an old backup will work, as long as you use new software. * All keypool keys that are seen used in transactions explicitly get their redeemscripts added to the wallet files. This means that downgrading after recovering from a backup that includes a witness address will work. These approaches correspond to solutions 3a, 1a, and 5a respectively from https://gist.github.com/sipa/125cfa1615946d0c3f3eec2ad7f250a2. As argued there, there is no full solution for dealing with the case where you both downgrade and restore a backup, so that's also not implemented. `dumpwallet`, `importwallet`, `importmulti`, `signmessage` and `verifymessage` don't work with SegWit addresses yet. They're remaining TODOs, for this PR or a follow-up. Because of that, several tests unexpectedly run with `-addresstype=legacy` for now. Tree-SHA512: d425dbe517c0422061ab8dacdc3a6ae47da071450932ed992c79559d922dff7b2574a31a8c94feccd3761c1dffb6422c50055e6dca8e3cf94a169bc95e39e959
2018-01-09Add address_types testPieter Wuille
Improvements and cleanups by John Newbery
2018-01-09SegWit wallet supportPieter Wuille
This introduces two command line flags (-addresstype and -changetype) which control the type of addresses/outputs created by the GUI and RPCs. Certain RPCs allow overriding these (`getnewaddress` and `getrawchangeaddress`). Supported types are "legacy" (P2PKH and P2SH-multisig), "p2sh-segwit" (P2SH-P2WPKH and P2SH-P2WSH-multisig), and "bech32" (P2WPKH and P2WSH-multisig). A few utility functions are added to the wallet to construct different address type and to add the necessary entries to the wallet file to be compatible with earlier versions (see `CWallet::LearnRelatedScripts`, `GetDestinationForKey`, `GetAllDestinationsForKey`, `CWallet::AddAndGetDestinationForScript`).
2018-01-09Implicitly know about P2WPKH redeemscriptsPieter Wuille
Make CKeyStore automatically known about the redeemscripts necessary for P2SH-P2WPKH (and due to the extra checks in IsMine, also P2WPKH) spending.
2018-01-09[test] Serialize CTransaction with witness by defaultPieter Wuille
2018-01-09Fix rare failure in p2p-segwit.pySuhas Daftuar
Avoid creating very small utxos that would violate an assumption in test_non_standard_witness.
2018-01-08Allow multiwallet.py to be used with --usecliRussell Yanofsky
Add test coverage for bitcoin-cli multiwallet calls.
2018-01-08[tests] allow tests to be run with --usecliJohn Newbery
test_framework accepts a new --usecli parameter. Running the test with this parameter will cause all RPCs to be sent through bitcoin-cli rather than directly over http. By default, individual test cases do not support --usecli, and self.supports_cli must be set to True in the set_test_params method. We can make supports_cli default to True in future once we know which tests will fail with use_cli.
2018-01-08TestNodeCLI batch emulationRussell Yanofsky
Support same get_request and batch methods as AuthServiceProxy
2018-01-08Prevent TestNodeCLI.args mixupsRussell Yanofsky
Change TestNodeCLI.__call__() to return a new instance instead of modifying the existing instance. This way, it's possible to create different cli objects that have their own options (for example -rpcwallet options to connect to different wallets), and options set for a single call (`node.cli(options).method(args)`) will no longer leak into future calls.
2018-01-08Improve TestNodeCLI output parsingRussell Yanofsky
Parse JSONRPCException errors, and avoid JSON decode exception if RPC method returns a plain string.
2018-01-06Merge #12079: Improve prioritisetransaction test coverageMarcoFalke
7f67dd0aa6 [qa] Improve prioritisetransaction functional test (João Barbosa) Pull request description: Tree-SHA512: 7a5c446772069cd9ace085ae2635e1f61870c597e2216614628f4b6ebfe209b29f381a182a6f60d09f43f22bb82b59bb573b5441fa8e7b958a5fd0d5aad80d86
2018-01-05[qa] Improve prioritisetransaction functional testJoão Barbosa
2018-01-04Fix incorrect Markdown linkpracticalswift
2018-01-04Merge #12001: [RPC] Adding ::minRelayTxFee amount to getmempoolinfo and ↵Wladimir J. van der Laan
updating help aad3090 [rpc] Adding ::minRelayTxFee amount to getmempoolinfo and updating mempoolminfee help description (Jeff Rade) Pull request description: These are RPC document changes from #11475 which is now merged. Took into consideration comments from #11475 and #6941 for this PR. Biggest change here is when calling `getmempoolinfo`, will now show the `minrelaytxfee` in the JSON reponse (see below): ``` $ bitcoin-cli getmempoolinfo { "size": 50, "bytes": 13102, "usage": 70480, "maxmempool": 300000000, "mempoolminfee": 0.00001000, "minrelaytxfee": 0.00001000 } ``` Fixes #8953 Tree-SHA512: 5ca583961365ee1cfe6e0d19afb0b41d542e179efee3b3c5f3fcf7d3ebca9cc3eedfd1434a0da40c5eed84fba98b35646fda201e6e61c689b58bee9cbea44b9e
2018-01-03Merge #12062: Increment MIT Licence copyright header year on files modified ↵Wladimir J. van der Laan
in 2017 595a7ba Increment MIT Licence copyright header year on files modified in 2017 (Akira Takizawa) Pull request description: Edited via: $ contrib/devtools/copyright_header.py update . ps) It is the same commit as #9450 Tree-SHA512: 274bfcd6cf2914315ed52f6db773a68800ce9d6bd225a3142654483f0bbc3fd865009e62f9d954f65765d038c626e55d2a64e37e16843809adc2f67abe659b6d
2018-01-03Merge #11965: qa: Note on test order in test_runnerMarcoFalke
fadf60e381 qa: Note on test order in test_runner (MarcoFalke) Pull request description: C.f. #11964 Tree-SHA512: 5f087965093722d9e7a3febddcc187e412bd0636a7ed2da60111668fe3bba6668110e25a38ddcccc0d0aae132611c56fa72f3f0c473fb3fb59e38be445edfcd5
2018-01-03[tests] Remove redundant import in blocktools.py testAnthony Towns
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa
2017-12-29[rpc] Adding ::minRelayTxFee amount to getmempoolinfo and updating ↵Jeff Rade
mempoolminfee help description
2017-12-23Merge #11475: [rpc] mempoolinfo should take ::minRelayTxFee into accountWladimir J. van der Laan
149dffd [rpc] mempoolinfo should take ::minRelayTxFee into account (Cristian Mircea Messel) Pull request description: Fixes #6941 following https://github.com/bitcoin/bitcoin/pull/11410#issuecomment-332991078 's suggestion This takes care of the mentioned ticket without changing the behavior of https://github.com/bitcoin/bitcoin/pull/11410/files#diff-24efdb00bfbe56b140fb006b562cc70bL629 By modifying https://github.com/bitcoin/bitcoin/blob/5a9da37fb3f4b53f556e1d46509b94dc3c661d75/src/txmempool.cpp#L984 the syncing mempools becomes problematic as per https://github.com/bitcoin/bitcoin/pull/11410#issuecomment-333868390 ~~Same code causes different tests to fail: https://travis-ci.org/bitcoin/bitcoin/jobs/286128241 https://travis-ci.org/bitcoin/bitcoin/jobs/286128241 . I can't reproduce the problems locally, am I doing something wrong?~~ travis sometimes fails unexpectedly Tree-SHA512: fd81628da6a3eff51bd09e5342d781bac0710f79d6b330b1df3662756ecaceb2e1682bf9768b5f8edbcba6479a3223dfa6604d37c9e9d37d00d077172da4f6ea
2017-12-21qa: Note on test order in test_runnerMarcoFalke
2017-12-21Merge #11667: Add scripts to dumpwallet RPCWladimir J. van der Laan
656fde5 Add script birthtime metadata to dump and import wallet (MeshCollider) 1bab9b2 Add script dump note to RPC help text and release notes (MeshCollider) 68c1e00 Add test for importwallet (MeshCollider) 9e1184d Add dumpwallet scripts test (MeshCollider) ef0c730 Add scripts to importwallet RPC (MeshCollider) b702ae8 Add CScripts to dumpwallet RPC (MeshCollider) cdc260a Add GetCScripts to CBasicKeyStore (MeshCollider) Pull request description: As discussed in https://github.com/bitcoin/bitcoin/pull/11289#issuecomment-334600457, adds the CScripts from the wallet to the `dumpwallet` RPC and then allows them to be imported with the `importwallet` RPC. Includes a basic test, and modifies the helptext of the dumpwallet RPC. Notes: - Reviewers: use `?w=1` to avoid the indentation-only change in commit `Add scripts to importwallet RPC ` - currently the scripts are followed with `# addr=` comments just as the other keys are, unsure if this might confuse users into thinking all the scripts are for valid P2SH addresses though, but I don't think that should be an issue. - there are no birthtimes for scripts, so script imports don't affect rescans - `importwallet` imports the CScripts but I'm not sure how to approach specifying whether scripts are for P2SH addresses, BIP173 addresses, etc. whether that matters or not. Otherwise the RPC helptext might just need modification. Fixes #11715 Tree-SHA512: 36c55837b3a58b9d3499d4c0c2ae82153d62aa71919e751574651b63a1d2b8ecc83796db4553cc65dad9b5341c3a42ae2fcf4d62598c30af267f8e1461ba8272
2017-12-20Merge #11726: Cleanups + nit fixes for walletdir PRMarcoFalke
aac6b3f067 Update files.md for new wallets/ subdirectory (MeshCollider) b67342906c Cleanups for walletdir PR (MeshCollider) Pull request description: This addresses the remaining nits from https://github.com/bitcoin/bitcoin/pull/11466 - Updates `doc/files.md` with respect to the new default wallet directory - Fixes @promag and @laanwj's error message nit, and Jonas' release notes nit - ~Addresses @laanwj's net-specific wallet subdirectory concern in the case that a walletdir is specified~ - Changes the #includes from "" to <> style after #11651 Tree-SHA512: b86bf5fdc4de54c1b0f65b60a83af3cf82b35d216ce9c0de724803bfba6934796238b6c412659dcc29ae2e3e856d4eb97ae777c80f36f4089d8acecfddefe9aa
2017-12-20Merge #11883: Add configuration file/argument testingWladimir J. van der Laan
be9a13c Add configuration/argument testing (MeshCollider) Pull request description: Adds a new functional test for testing various command line and configuration file argument interactions, that aren't specific enough to other functionality to be placed in other tests. Currently this tests the error messages for non-existent datadir, which would have caught the bug fixed in https://github.com/bitcoin/bitcoin/pull/11829. It also tests that command line arguments override the ones in the config file. I plan on working on a fix for https://github.com/bitcoin/bitcoin/issues/11819 / https://github.com/bitcoin/bitcoin/issues/1044 and then expanding this test with cases for that. Tree-SHA512: 97aea18c67d331db3ca3d0c99c79267cf012df67fddafc9fac63d392f5c3a6469aa14d93b5865c3bbe561461648d2485367978a77446483b8df53d1916f1c8e8
2017-12-20Add test for importwalletMeshCollider
2017-12-20Add dumpwallet scripts testMeshCollider
2017-12-20Add configuration/argument testingMeshCollider
2017-12-19[tests] refactor node_network_limitedJohn Newbery
2017-12-19[tests] remove redundant duplicate tests from node_network_limitedJohn Newbery
2017-12-19[tests] node_network_limited - remove race conditionJohn Newbery
node_network_limited had a race condition, since wait_for_block() doesn't do what you might expect. It only checks the most recent block received over the P2P interface (perhaps we should rename the method wait_for_most_recent_block() to avoid future confusion). The test can fail if the node sends us invs for other blocks, we respond with a getdata, and the node sends us one of those blocks in the 0.05 second wait_until loop window. Fix this by not responding to inv messages with getdata messages.
2017-12-19[tests] define NODE_NETWORK_LIMITED in test frameworkJohn Newbery
2017-12-19[tests] fix flake8 warnings in node_network_limited.pyJohn Newbery
2017-12-19Merge #11946: tests: Remove unused variable (firstAddrnServices)MarcoFalke
bdaed47558 tests: Remove unused variable (firstAddrnServices) (practicalswift) Pull request description: Remove unused variable (`firstAddrnServices`). Tree-SHA512: 7075952b392227c00fcb22adb1fd3f7ef31d7fd7101fbeff632beeea814c70beaef5c9957736eff2451976c8b43b950fc949642e608b610c5fefd150282eafb0
2017-12-19test: Fix rawtransactions testWladimir J. van der Laan
Looks like another `assert_raises_jsonrpc` snuck in with #11178. Change it to `assert_raises_rpc_error`.
2017-12-19tests: Remove unused variable (firstAddrnServices)practicalswift
2017-12-19Merge #11178: Add iswitness parameter to decode- and fundrawtransaction RPCsWladimir J. van der Laan
6f39ac0 Add test for decoderawtransaction bool (MeshCollider) bbdbe80 Add iswitness parameter to decode- and fundrawtransaction RPCs (MeshCollider) Pull request description: Suggested in https://github.com/bitcoin/bitcoin/pull/10481#issuecomment-325244946, this adds the option to explicitly choose whether a serialized transaction should be decoded as a witness or non-witness transaction rather than relying on the heuristic checks in #10481. The parameter defaults to relying on #10481 if not included, but it overrides that if included. Tree-SHA512: d4846a5bb7d64dc19c516445488b00af329fc1f4181d9dfdf9f2382a086568edc98250a4ac7594e24a1bc231dfdee53c699b12c8380c355b920a67cc6770b7a9
2017-12-13test: Add createrawtransaction functional testsJoão Barbosa
2017-12-13test: Add multidict to support dictionary with duplicate key (laanwj)João Barbosa
2017-12-13Cleanups for walletdir PRMeshCollider
2017-12-12Merge #11849: [tests] Assert that only one NetworkThread existsWladimir J. van der Laan
5c8ff26 [tests] Add NetworkThread assertions (John Newbery) 34e08b3 [tests] Fix network threading in functional tests (John Newbery) 74e64f2 [tests] Use network_thread_start() in tests. (John Newbery) 5fc6e71 [tests] Add network_thread_ utility functions. (John Newbery) Pull request description: Add assert that only one NetworkThread exists at any time in functional tests, and fix cases where that wasn't true. fixes #11776 Tree-SHA512: fe5d1c59005f94bf66e11bb23ccf274b1cd9913741b56ea11dbcd21db4cc0b53b4413c0c4c16dbcd6ac611adad5e5cc2baaa39720598ce7b6393889945d06298
2017-12-11Merge #11839: don't attempt mempool entry for wallet transactions on startup ↵Wladimir J. van der Laan
if alr… 6697a70 add test for unconfirmed balance between restarts (Gregory Sanders) 6ba8f30 don't attempt mempool entry for wallet transactions on startup if already in mempool (Gregory Sanders) Pull request description: …eady in mempool Mempool loads first, wallet second. Second attempt fails, marking that transaction !fInMempool. Those funds will disappear until confirmation is reached. Tree-SHA512: 955f0565ec1dc1ba395e0b803a98c07b7cd00c8cac5ec618ed832fed259a856fb7bbbe41310cf6a4e43c0435e09b156109d2a4467d403811dc8379d2caebeede
2017-12-11[tests] Add NetworkThread assertionsJohn Newbery
Check that P2PConnections aren't created after the NetworkThread has started and that at any time only one NetworkThread is running.
2017-12-11[tests] Fix network threading in functional testsJohn Newbery
assumevalid.py, example_test.py and p2p-acceptblocks.py add p2p_connections after the NetworkThread has been started. This isn't permitted. Fix test to restart the network thread when adding new connections. p2p-leaktest.py had a potential race condition if the NetworkThread hadn't terminated by the time we tried to restart it.
2017-12-11[tests] Use network_thread_start() in tests.John Newbery
2017-12-11[tests] Add network_thread_ utility functions.John Newbery
Add network thread_start(), network_thread_running() and network_thread_join() utility functions in mininode.py and use network_thread_running() in network thread assertions.
2017-12-11add test for unconfirmed balance between restartsGregory Sanders