aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
AgeCommit message (Collapse)Author
2018-08-08Merge #13780: 0.17: Pre-branch maintenanceWladimir J. van der Laan
3fc20632a3ad30809356a58d2cf0ea4a4ad4cec3 qt: Set BLOCK_CHAIN_SIZE = 220 (DrahtBot) 2b6a2f4a28792f2fe9dc1be843b1ff1ecae35e8a Regenerate manpages (DrahtBot) eb7daf4d600eeb631427c018a984a77a34aca66e Update copyright headers to 2018 (DrahtBot) Pull request description: Some trivial maintenance to avoid having to do it again after the 0.17 branch off. (The scripts to do this are in `./contrib/`) Tree-SHA512: 16b2af45e0351b1c691c5311d48025dc6828079e98c2aa2e600dc5910ee8aa01858ca6c356538150dc46fe14c8819ed8ec8e4ec9a0f682b9950dd41bc50518fa
2018-08-02Merge #13823: qa: quote path in authproxy for external multiwalletsWladimir J. van der Laan
fa67505e1ea007bdc081bc7425fb83d5455d8308 qa: Quote wallet name for rpc path (MarcoFalke) Pull request description: When using external multiwallets they are specified by their full path which might contain non-ascii characters (e.g. umlauts or emojis). Fix this by url-quoting the path. Tree-SHA512: 7cc66514579d9f602f88a6817c5ab43a44c6d3711df452dc904173f0bc34e2c0b2c34877497f06b61f6720c532fa183053f54622dc454e316c89cee7eaa72463
2018-08-02qa: Quote wallet name for rpc pathMarcoFalke
2018-08-01qa: Extract rpc_timewait as test paramMarcoFalke
Also increase it for wallet_dump and wallet_groups
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-23Skip is_closing() check when not available.Daniel Kraft
https://github.com/bitcoin/bitcoin/pull/13715 introduced a new check for _transport.is_closing() in mininode's P2PConnection's. This function is only available from Python 3.4.4, though, while Bitcoin is supposed to support all Python 3.4 versions. In this change, we make the check conditional on is_closing() being available. If it is not, then we revert to the behaviour before the check was introduced; this means that https://github.com/bitcoin/bitcoin/issues/13579 is not fixed for old systems, but at least the tests work as they used to do before. This includes a small refactoring from a one-line lambda to an inline function, because this makes the code easier to read with more and more conditions being added. Fixes https://github.com/bitcoin/bitcoin/issues/13745.
2018-07-20Merge #11637: p2p: Remove dead service bits codeWladimir J. van der Laan
fa4bf92be9420919c74cdde9a973f7327d01ac88 Remove dead service bits code (MarcoFalke) Pull request description: Seems fine to remove for the upcoming 0.17 release Fixes #10993 Tree-SHA512: 3a4664b787e3da399bcaaba693619bd384826df14f469dbdfbbfffc540d9da3f2b322cda262b43388376785f77907c2540541c239ab0fca82bd7eb69d02b6b7a
2018-07-20Merge #9662: Add createwallet "disableprivatekeys" option: a sane mode for ↵Wladimir J. van der Laan
watchonly-wallets a3fa4d6a6acf19d640a1d5879a00aa1f059e2380 QA: Fix bug in -usecli logic that converts booleans to non-lowercase strings (Jonas Schnelli) 4704e5f074e57782d058404a594a7313cf170cf0 [QA] add createwallet disableprivatekey test (Jonas Schnelli) c7b8f343e99d9d53ea353ddce9a977f1886caf30 [Qt] Disable creating receive addresses when private keys are disabled (Jonas Schnelli) 2f15c2bc20d583b4c1788da78c9c635c36e03ed0 Add disable privatekeys option to createwallet (Jonas Schnelli) cebefba0855cee7fbcb9474b34e6779369e8e9ce Add option to disable private keys during internal wallet creation (Jonas Schnelli) 9995a602a639b64a749545b7c3bafbf67f97324f Add facility to store wallet flags (64 bits) (Jonas Schnelli) Pull request description: This mode ('createwallet {"disableprivatekeys": true}') is intended for a sane pure watch-only mode, ideal for a use-case where one likes to use Bitcoin-Core in conjunction with a hardware-wallet or another solutions for cold-storage. Since we have support for custom change addresses in `fundrawtransaction`, pure watch-only wallets including coin-selection are possible and do make sense for some use cases. This new mode disables all forms of private key generation and ensure that no mix between hot and cold keys are possible. Tree-SHA512: 3ebe7e8d54c4d4e5f790c348d4c292d456f573960a5b04d69ca5ef43a9217c7e7671761c6968cdc56f9a8bc235f3badd358576651af9f10855a0eb731f3fc508
2018-07-19tests: fixes mininode's P2PConnection sending messages on closing transportmarcoagner
- checks if _transport.is_closing() (added in python3.4.4/python3.5.1) before attempting to send messages on P2PConnection's send_message method.
2018-07-12QA: Fix bug in -usecli logic that converts booleans to non-lowercase stringsJonas Schnelli
2018-07-12[tests] skip rpc_zmq functional test when python3 zmq lib is not presentJames O'Beirne
Also refactors zmq-related test skipping logic into distinct functions.
2018-07-11Remove dead service bits codeMarcoFalke
2018-07-09Merge #13452: rpc: have verifytxoutproof check the number of txns in proof ↵Wladimir J. van der Laan
structure d280617bf569f84457eaea546541dc74c67cd1e4 [qa] Add a test for merkle proof malleation (Suhas Daftuar) ed82f1700006830b6fe34572b66245c1487ccd29 have verifytxoutproof check the number of txns in proof structure (Gregory Sanders) Pull request description: Recent publication of a weakness in Bitcoin's merkle tree construction demonstrates many SPV applications vulnerable to an expensive to pull off yet still plausible attack: https://bitslog.wordpress.com/2018/06/09/leaf-node-weakness-in-bitcoin-merkle-tree-design/ This change would at least allow `verifytxoutproof` to properly validate that the proof matches a known block, with known number of transactions any time after the full block is processed. This should neuter the attack entirely. The negative is that a header-only processed block/future syncing mode would cause this to fail until the node has imported the data required. related: #13451 `importprunedfunds` needs this check as well. Can expand it to cover this if people like the idea. Tree-SHA512: 0682ec2b622a38b29f3f635323e0a8b6fc071e8a6fd134c954579926ee7b516e642966bafa667016744ce49c16e19b24dbc8801f982a36ad0a6a4aff6d93f82b
2018-06-25qa: Avoid start/stop of the network thread mid-testMarcoFalke
2018-06-22[qa] mininode: Expose connection state through is_connectedMarcoFalke
2018-06-22[qa] Add a test for merkle proof malleationSuhas Daftuar
2018-06-12Explicitly specify encoding when opening text files in Python codepracticalswift
2018-06-11qa: Log as utf-8MarcoFalke
2018-05-30qa: Fixup setting of PATH env varMarcoFalke
2018-05-10Merge #13201: [qa] Handle disconnect_node raceMarcoFalke
09c6699900 [qa] Handle disconnect_node race (Suhas Daftuar) Pull request description: Several tests call disconnect_nodes() on each node-pair in rapid succession, resulting in a race condition if a node disconnects a peer in-between the calculation of the nodeid's to disconnect and the invocation of the disconnectnode rpc call. Handle this. Tree-SHA512: 3078cea0006fcb507c812004a777c505eb1e9dda7c6df12dbbe72395a73ff6f6760f597b6492054f5487b34534417ddef5fbad30553c135c288c4b7cfce79223
2018-05-09[qa] Handle disconnect_node raceSuhas Daftuar
Several tests call disconnect_nodes() on each node-pair in rapid succession, resulting in a race condition if a node disconnects a peer in-between the calculation of the nodeid's to disconnect and the invocation of the disconnectnode rpc call. Handle this.
2018-05-09[qa] Avoid printing to console during cache creationSuhas Daftuar
2018-05-09[tests] Allow stderr to be tested against specified stringJohn Newbery
Allow bitcoind's stderr to be tested against a specified string on shutdown.
2018-05-09[Tests] Use LIBC_FATAL_STDERR_=1 in testsJohn Newbery
By default, libc will print fatal errors to /dev/tty instead of stderr. Adding the LIBC_FATAL_STDERR_ to the environment variables allows us to catch libc errors in stderr and test for them.
2018-05-09[Tests] Write stdout/stderr to datadir instead of temp file.John Newbery
2018-05-09Merge #13188: qa: Remove unused option --srcdirWladimir J. van der Laan
fac1e1f qa: Remove unused option --srcdir (MarcoFalke) Pull request description: The `srcdir` option was both unused and misleading; It should have been called `builddir`. So remove it. Tree-SHA512: 2c24dcf2aa82219158b8cbbf03dd3f0f51f805f1f5f670faa1fd59e5a8d60fda120ffddadeccb058d8d3f20583b4952be7afd2df6bbefb9367d35c0f0a9fda3c
2018-05-09Merge #12265: [test] fundrawtransaction: lock watch-only shared addressWladimir J. van der Laan
891beb0 [test] fundrawtransaction: lock watch-only shared address (Karl-Johan Alm) Pull request description: `self.nodes[0]` creates an address which is watch-only-shared with `self.nodes[3]`. If `nodes[0]` spends the associated UTXO during any of its sends later, the watchonly test will fail, as `nodes[3]` now has insufficient funds. I ran into this in #12257 and this commit is in that PR as well, but I figured I'd split it out (and remove from there once/if merged). Tree-SHA512: d04a04b1ecebe82127cccd47c1b3de311bf07f4b51dff80db20ea2f142e1d5c4a85ed6180c5c0b081d550e238c742e119b953f60f487deac5a3f3536e1a8d9fe
2018-05-08qa: Remove unused option --srcdirMarcoFalke
2018-04-26Merge #13003: qa: Add test for orphan handlingWladimir J. van der Laan
fa02c5b qa: Clarify documentation for send_txs_and_test (MarcoFalke) fadfbd3 qa: Add test for orphan handling (MarcoFalke) Pull request description: Tree-SHA512: e0932d6bd03c73e3113f5457a3ffa3bbfc7b6075dfca8de95224d9df875e60ca6eb15cd8baa226f13de965483006559556191630a83c3bb431e79c53a85ef73f
2018-04-25Merge #13051: qa: Normalize executable locationWladimir J. van der Laan
fa811b0 qa: Normalize executable location (MarcoFalke) Pull request description: This removes the need to override the executable locations by just reading them from the config file. Beside making the code easier to read, running individual test on Windows is now possible by default (without providing further command line arguments). Note: Of course, it is still possible to manually specify the location through the `BITCOIND` environment variable, e.g. `bitcoin-qt`. Tree-SHA512: bee6d22246796242d747120ca18aaab089f73067de213c9111182561985c5912228a0b0f7f9eec025ecfdb44db031f15652f30d67c489d481c995bb3232a7ac7
2018-04-24qa: Clarify documentation for send_txs_and_testMarcoFalke
2018-04-24Merge #13022: [qa] Attach node index to test_node AssertionError and print ↵Wladimir J. van der Laan
messages 80a5e59 [qa] Attach node index to test_node AssertionError and print messages (James O'Beirne) Pull request description: In the midst of fighting with https://github.com/bitcoin/bitcoin/pull/12873 it became apparent that there're a number of assertions and print statements which are emitted by test nodes but don't identify the node in question. This change makes debugging a bit easier by adding identifying information to non-logger test_node-related error messages. Tree-SHA512: 7cc86f2c81f4b3fdba15ec9a2d21a84c4b083629e845e82288087c3affbbdc5c68e74067621856cc97fe84fbc8cb4f5ca4977a51ef381e5d74515df8eb001239
2018-04-21qa: Normalize executable locationMarcoFalke
2018-04-20[tests] tidy up blocktools.pyJohn Newbery
Moves function comments to docstrings, and moves the module-level constant to the top of the file.
2018-04-20[tests] Fix flake8 warnings in blocktools.pyJohn Newbery
2018-04-20[doc][trivial] no retargeting in regtest modeJesse Cohen
2018-04-19[qa] Attach node index to test_node AssertionError and print messagesJames O'Beirne
to aid debugging. Feedback incorporated from @Empact.
2018-04-17Print to console by default when not run with -daemonEvan Klitzke
Printing to the debug log file can be disabled with -nodebulogfile
2018-04-16qa: Add test for orphan handlingMarcoFalke
2018-04-16Merge #11862: Network specific conf sectionsWladimir J. van der Laan
c25321f Add config changes to release notes (Anthony Towns) 5e3cbe0 [tests] Unit tests for -testnet/-regtest in [test]/[regtest] sections (Anthony Towns) 005ad26 ArgsManager: special handling for -regtest and -testnet (Anthony Towns) 608415d [tests] Unit tests for network-specific config entries (Anthony Towns) 68797e2 ArgsManager: Warn when ignoring network-specific config setting (Anthony Towns) d1fc4d9 ArgsManager: limit some options to only apply on mainnet when in default section (Anthony Towns) 8a9817d [tests] Use regtest section in functional tests configs (Anthony Towns) 30f9407 [tests] Unit tests for config file sections (Anthony Towns) 95eb66d ArgsManager: support config file sections (Anthony Towns) 4d34fcc ArgsManager: drop m_negated_args (Anthony Towns) 3673ca3 ArgsManager: keep command line and config file arguments separate (Anthony Towns) Pull request description: The weekly meeting on [2017-12-07](http://www.erisian.com.au/meetbot/bitcoin-core-dev/2017/bitcoin-core-dev.2017-12-07-19.00.log.html) discussed allowing options to bitcoin to have some sensitivity to what network is in use. @theuni suggested having sections in the config file: <cfields> an alternative to that would be sections in a config file. and on the cmdline they'd look like namespaces. so, [testnet] port=5. or -testnet::port=5. This approach is (more or less) supported by `boost::program_options::detail::config_file_iterator` -- when it sees a `[testnet]` section with `port=5`, it will treat that the same as "testnet.port=5". So `[testnet] port=5` (or `testnet.port=5` without the section header) in bitcoin.conf and `-testnet.port=5` on the command line. The other aspect to this question is possibly limiting some options so that there is no possibility of accidental cross-contamination across networks. For example, if you're using a particular wallet.dat on mainnet, you may not want to accidentally use the same wallet on testnet and risk reusing keys. I've set this up so that the `-addnode` and `-wallet` options are `NETWORK_ONLY`, so that if you have a bitcoin.conf: wallet=/secret/wallet.dat upnp=1 and you run `bitcoind -testnet` or `bitcoind -regtest`, then the `wallet=` setting will be ignored, and should behave as if your bitcoin.conf had specified: upnp=1 [main] wallet=/secret/wallet.dat For any `NETWORK_ONLY` options, if you're using `-testnet` or `-regtest`, you'll have to add the prefix to any command line options. This was necessary for `multiwallet.py` for instance. I've left the "default" options as taking precedence over network specific ones, which might be backwards. So if you have: maxmempool=200 [regtest] maxmempool=100 your maxmempool will still be 200 on regtest. The advantage of doing it this way is that if you have `[regtest] maxmempool=100` in bitcoin.conf, and then say `bitcoind -regtest -maxmempool=200`, the same result is probably in line with what you expect... The other thing to note is that I'm using the chain names from `chainparamsbase.cpp` / `ChainNameFromCommandLine`, so the sections are `[main]`, `[test]` and `[regtest]`; not `[mainnet]` or `[testnet]` as might be expected. Thoughts? Ping @MeshCollider @laanwj @jonasschnelli @morcos Tree-SHA512: f00b5eb75f006189987e5c15e154a42b66ee251777768c1e185d764279070fcb7c41947d8794092b912a03d985843c82e5189871416995436a6260520fb7a4db
2018-04-16Merge #12996: tests: Remove redundant bytes(…) callsMarcoFalke
9db48c5634 tests: Remove redundant bytes² (practicalswift) Pull request description: This is a follow-up to #12993. As @jnewbery noted `bytes()` is idempotent. Tree-SHA512: 0eb25e0c2c46f9abaac30f964c5eb422bece1414c840a717d86794424294cb19d995a6db7c8df2a2f4ec84776b05274a637f2c111738f397051f510e57184752
2018-04-16tests: Remove redundant bytes²practicalswift
2018-04-16Minor Python cleanups to make flake8 pass with the new rules enabledpracticalswift
2018-04-16tests: Remove compatibility code not needed now when we're on Python 3practicalswift
2018-04-11[tests] Use regtest section in functional tests configsAnthony Towns
2018-04-09Merge #12902: [qa] Handle potential cookie race when starting nodeMarcoFalke
75d0e4c544 [qa] Delete cookie file before starting node (Suhas Daftuar) Pull request description: When a node is restarted during a test after an unclean shutdown (such as with -dbcrashratio), it's possible an old cookie file was left behind. This can cause a race condition when restarting the node, where the test framework might try to connect using credentials from the old cookie file, just as the node will generate new credentials and overwrite the old file. Delete any such cookie file if present prior to startup. Tree-SHA512: ae1e8bf8fd20e07c32b0715025693bb28b0e3dd34f328cae4346abf579b0c97b5db1c02782e1c46b7a3b6058d268b6d46b668e847658a6eed0be857ffb0d65dc
2018-04-09[qa] Delete cookie file before starting nodeSuhas Daftuar
If a cookie file exists in a datadir prior to node startup, it must have been leftover from a prior unclean shutdown. As bitcoind will overwrite it anyway, delete it before starting up to prevent the test framework from inadvertently trying to connect using stale credentials.
2018-04-08Merge #12856: Tests: Add Metaclass for BitcoinTestFrameworkWladimir J. van der Laan
c9cce0a Tests: Add Metaclass for BitcoinTestFramework (Will Ayd) Pull request description: BitcoinTestFramework instructs developers in its docstring to override `set_test_params` and `run_test` in subclasses while being sure NOT to override `__init__` and `main` . This change adds a metaclass to ensure that developers adhere to that protocol, raising a ``TypeError`` in instances where they have not. closes #12835 Tree-SHA512: 5a47a7ead1f18361138cad4374747c4a8f29d25506f7b2c2a8c1c966a0b65e5ccf7317f9a078df8680fdab5d3fb71fee46a159c9f381878a3683c1e9f874abbe
2018-04-08Merge #12904: [qa] Ensure bitcoind processes are cleaned up when tests endWladimir J. van der Laan
e36a0c0 [qa] Ensure bitcoind processes are cleaned up when tests end (Suhas Daftuar) Pull request description: When tests fail (such as due to a bug in the test, race condition, etc), it's possible that we could follow code paths that bypass our normal node shutdown that occurs in `TestNode.stop_node`. Add a destructor to `TestNode` that cleans this up. Tree-SHA512: 72e04bc21462ebd0cb346fd1fe0540da454acfbad41923a0b06ea2317e9045b68e58f9adb02d8200891aca89a9d03a022eb72282aeb31a3b3afe7c6843a4b450
2018-04-08[qa] Ensure bitcoind processes are cleaned up when tests endSuhas Daftuar