aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
AgeCommit message (Collapse)Author
2018-01-09[test] Serialize CTransaction with witness by defaultPieter Wuille
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] 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-10Remove unused Python importspracticalswift
2017-11-30Merge #11791: [tests] Rename NodeConn and NodeConnCBMarcoFalke
873beca6d [tests] Rename NodeConn and NodeConnCB (John Newbery) Pull request description: Final step in #11518 NodeConn -> P2PConnection NodeConnCB -> P2PInterface This is basically just a rename. Should be an easy review. Tree-SHA512: fe1204b2b3d8182c5e324ffa7cb4099a47ef8536380e0bb9d37a5fccf76a24f548d1f1a7988ab8f830986a3058b670696de3fc891af5e5f75dbeb4e3273005d7
2017-11-30Merge #11789: [tests] [travis-ci] Combine logs on failureWladimir J. van der Laan
ff8a9b0 [tests] Add combinedlogslen argument to test_runner.py (John Newbery) dba94ea [tests] [travis-ci] Move Travis functional test log post processing to test_runner (John Newbery) bba1c54 [tests] Improve logging shutdown and add hint for combine_logs (John Newbery) Pull request description: Replaces #11779 . Notes from that PR: > Currently, when a functional test fails, the debug logs are printed sequentially to the travis log. This makes debugging race conditions based on the travis log hard. Instead, all logs events should be combined and sorted by their timestamp, then appended to the travis log. @MarcoFalke Tree-SHA512: 56c80067d6a2c92f7e6a35e3ae5160637a0de052d9da593c7be6e02233544a93c66d62456f903f85e2edc09e31ab4bdafd1aed1d9897ae48c634f82631f856f7
2017-11-29[tests] Rename NodeConn and NodeConnCBJohn Newbery
NodeConn -> P2PConnection NodeConnCB -> P2PInterface
2017-11-29Merge #11712: [tests] Split NodeConn from NodeConnCBMarcoFalke
e9dfa9bcc [tests] Move version message sending from NodeConn to NodeConnCB (John Newbery) dad596fc3 [tests] Make NodeConnCB a subclass of NodeConn (John Newbery) e30d40438 [tests] Move only: move NodeConnCB below NodeConn (John Newbery) 4d5059856 [tests] Tidy up mininode (John Newbery) f2ae6f32a [tests] Remove mininode periodic (half-hour) ping messages (John Newbery) ec59523c5 [tests] Remove rpc property from TestNode in p2p-segwit.py. (John Newbery) Pull request description: This is the final step in #11518, except for possibly renaming - for motivation, please see that PR. If this is merged, then migrating the test framework from asyncore to asyncio should be easier (I say should because I haven't dug too deeply into what would be required). Requesting review from @ryanofsky , since he always has good feedback on these refactor PRs, and I'd appreciate his take on this refactor. Note particularly that I've reverted the change suggested here: https://github.com/bitcoin/bitcoin/pull/11182#discussion_r148859555 . The idea, as always, is to present a simple interface to the test writer. Tree-SHA512: 94dd467a13ec799b101108cf47d4dccb6f6240b601e375e3d785313333bbb389c26072a50759aca663bbf3d6c8b867b99e36ae8800ab8ea115e0496c151926ce
2017-11-29[tests] [travis-ci] Move Travis functional test log post processing to ↵John Newbery
test_runner
2017-11-29[tests] Improve logging shutdown and add hint for combine_logsJohn Newbery
2017-11-28[tests] Move version message sending from NodeConn to NodeConnCBJohn Newbery
This commit moves the logic that sends a version message on connection from NodeConn to NodeConnCB. NodeConn should not be aware of the semantics or meaning of the P2P payloads.
2017-11-28[tests] Make NodeConnCB a subclass of NodeConnJohn Newbery
This makes NodeConnCB a subclass of NodeConn, and removes the need for the client code to know anything about the implementation details of NodeConnCB. NodeConn can now be swapped out for any other implementation of a low-level connection without changing client code.
2017-11-28[tests] Move only: move NodeConnCB below NodeConnJohn Newbery
This is required since NodeConnCB will inherit from NodeConn after the next commit.
2017-11-28[tests] Tidy up mininodeJohn Newbery
Add docstrings and renames some methods. Also removes the redundant NodeConn.readable() method override.
2017-11-25Merge #11683: tests: Remove unused mininode functions ↵MarcoFalke
{ser,deser}_int_vector(...). Remove unused imports. f522fb7c9 tests: Remove unused mininode functions deser_int_vector(f) and ser_int_vector(l) (practicalswift) 0f3b752ec Remove unused imports (practicalswift) Pull request description: * Remove unused mininode functions `deser_int_vector(f)` and `ser_int_vector(l)`. Last use removed in 3858aabbd084b2cc4534c40a178bbcc22fb82968. Friendly ping @jnewbery :-) * Remove unused imports. Tree-SHA512: 840c5623eae9f929561f6e86816883c5904ec1af82fc8d5e56dee1c0b1fe22e8600c10f7358ed8b556b3aec8c65c4910f6eee30e8015a573c4df8bef91124d3e
2017-11-23[tests] Remove mininode periodic (half-hour) ping messagesJohn Newbery
2017-11-18Merge #11466: Specify custom wallet directory with -walletdir paramWladimir J. van der Laan
c1e5d40 Make debugging test crash easier (MeshCollider) 8263f6a Create walletdir if datadir doesn't exist and fix tests (MeshCollider) 9587a9c Default walletdir is wallets/ if it exists (MeshCollider) d987889 Add release notes for -walletdir and wallets/ dir (MeshCollider) 80c5cbc Add test for -walletdir (MeshCollider) 0530ba0 Add -walletdir parameter to specify custom wallet dir (MeshCollider) Pull request description: Closes #11348 Adds a `-walletdir` parameter which specifies a directory to use for wallets, allowing them to be stored separately from the 'main' data directory. Creates a new `wallets/` directory in datadir if this is the first time running, and defaults to using it if it exists. Includes tests and release notes. Things which might need to be considered more: - there is no 'lock' on the wallets directory, which might be needed? - because this uses a new wallets/ directory by default, downgrading to an earlier version won't see the wallets in that directory (not a big deal though, users can just copy them up to the main dir) - jnewbery suggested putting each wallet in its own directory, which is a good idea, but out of scope for this PR IMO. EDIT: this is being done in https://github.com/bitcoin/bitcoin/pull/11687 - doc/files.md needs updating (will do soon) I also considered including a cleanup by removing caching of data directory paths and instead just initialise them once on startup (c.f. #3073), but decided it wasn't super relevant here will just complicate review. Tree-SHA512: c8ac04bfe9a810c32055f2c8b8fa0d535e56125ceb8d96f12447dd3538bf3e5ee992b60b1cd2173bf5f3fa023a9feab12c9963593bf27ed419df929bb413398d
2017-11-17tests: Remove unused mininode functions deser_int_vector(f) and ↵practicalswift
ser_int_vector(l)
2017-11-17Merge #11648: [tests] Add messages.pyWladimir J. van der Laan
1135c79 [tests] Tidy up mininode.py module (John Newbery) f9cd9b1 [tests] Move test_framework Bitcoin primitives into separate module (John Newbery) Pull request description: Second part of #11518. Moves the primitive Bitcoin datastructures and message classes into their own module, and tidies up the mininode.py module. - First commit is almost entirely move-only - Second commit is mostly move-only, but also does a little tidying. Tree-SHA512: 5d74802677f1ab788e43188653106a96fffd9ab1fe3aa6a4eb94e5807de5dd5c8ee212296f45e8d16c7e3d95cfc4891677e812b7944bd3ab604e04b3b88aa06e
2017-11-18Create walletdir if datadir doesn't exist and fix testsMeshCollider
2017-11-14Merge #11677: qa: Remove unused NodeConn membersMarcoFalke
fafdad0d4 qa: Remove unused NodeConn members (MarcoFalke) Pull request description: * `ver_send` and `ver_recv` were completely unused * `rpc` was only used once, in p2p-segwit. Imo better only pass it to the constructor in that single test Tree-SHA512: 7f85554d6d0fd2096516ca3c608811d5370da66cde35d8031bdc921607a7a4efdb26355896012f75f713f8df09e28d46ba46be69fd96a5898fabb1a25cbcb8ad
2017-11-14Merge #11641: qa: Only allow disconnecting all NodeConnsWladimir J. van der Laan
faaa7db qa: Only allow disconnecting all NodeConns (MarcoFalke) Pull request description: Disconnecting the connection with `index=0` makes no sense when there are more than one connections, as the list "rotates around" and populates index 0 after `del`. Just disconnect all NodeConns in any case. Tree-SHA512: e5cf540823fccb31634b5a11501f54222be89862e80ccafc28bc06726480f8d2153b8c1b6f859fa6a6d087876251d48a6c6035bccdaaf16831e300bc17ff613d
2017-11-13qa: Remove unused NodeConn membersMarcoFalke
2017-11-13qa: Only allow disconnecting all NodeConnsMarcoFalke
2017-11-10[tests] Tidy up mininode.py moduleJohn Newbery
Mostly move only. Adds a few extra comments.
2017-11-10[tests] Move test_framework Bitcoin primitives into separate moduleJohn Newbery
mininode.py wildcard imports all names from primitives.py. This is to avoid having to change all test scripts that import from mininode.py.
2017-11-10Merge #11468: [tests] Make comp test framework more debuggableMarcoFalke
748157913 [tests] Make comp test framework more debuggable (John Newbery) Pull request description: We should remove the comparison test framework entirely (see #10603). Until we do that, let's make it a bit more debuggable. Currently, if there's an assert in the framework, it's very difficult to track down where we are in the test generator. Make the logging a bit better to help with debugging. Before this PR: ``` → ./p2p-fullblocktest.py 2017-10-09 14:05:11.302000 TestFramework (INFO): Initializing test directory /tmp/user/1000/testzdnax_yr 2017-10-09 14:05:11.557000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:11975 2017-10-09 14:05:11.712000 TestFramework.comptool (INFO): Test 1: PASS 2017-10-09 14:05:11.947000 TestFramework.comptool (INFO): Test 2: PASS 2017-10-09 14:05:12.057000 TestFramework.comptool (INFO): Test 3: PASS 2017-10-09 14:05:12.058000 TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 117, in main self.run_test() File "./p2p-fullblocktest.py", line 72, in run_test self.test.run() File "/home/ubuntu/bitcoin/test/functional/test_framework/comptool.py", line 306, in run assert test_number != 4 AssertionError 2017-10-09 14:05:12.059000 TestFramework (INFO): Stopping nodes 2017-10-09 14:05:14.203000 TestFramework (WARNING): Not cleaning up dir /tmp/user/1000/testzdnax_yr 2017-10-09 14:05:14.204000 TestFramework (ERROR): Test failed. Test logging available at /tmp/user/1000/testzdnax_yr/test_framework.log ``` With this PR: ``` → ./p2p-fullblocktest.py 2017-10-09 14:03:54.069000 TestFramework (INFO): Initializing test directory /tmp/user/1000/testuey7t3tf 2017-10-09 14:03:54.329000 TestFramework.mininode (INFO): Connecting to Bitcoin Node: 127.0.0.1:11783 2017-10-09 14:03:54.383000 TestFramework.comptool (INFO): Running test 1: ./p2p-fullblocktest.py line 184 2017-10-09 14:03:54.496000 TestFramework.comptool (INFO): Running test 2: ./p2p-fullblocktest.py line 193 2017-10-09 14:03:54.758000 TestFramework.comptool (INFO): Running test 3: ./p2p-fullblocktest.py line 205 2017-10-09 14:03:54.867000 TestFramework.comptool (INFO): Running test 4: ./p2p-fullblocktest.py line 208 2017-10-09 14:03:54.867000 TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 117, in main self.run_test() File "./p2p-fullblocktest.py", line 72, in run_test self.test.run() File "/home/ubuntu/bitcoin/test/functional/test_framework/comptool.py", line 309, in run assert test_number != 4 AssertionError 2017-10-09 14:03:54.868000 TestFramework (INFO): Stopping nodes 2017-10-09 14:03:56.950000 TestFramework (WARNING): Not cleaning up dir /tmp/user/1000/testuey7t3tf 2017-10-09 14:03:56.950000 TestFramework (ERROR): Test failed. Test logging available at /tmp/user/1000/testuey7t3tf/test_framework.log ``` Tree-SHA512: 5525958b0098d661c281bd955c92c72bf81359464376e96d44e6c88f18aea57ba08270ecd564edda4b47d674e3b27d20e5b1060544bf8dd5c6a68103d2bb35b8
2017-11-08[tests] Explicitly disallow support for p2p versions below 60001John Newbery
The mininode module includes code to support p2p versions below 60001. However, the test_framework does not support versions of Bitcoin Core before V0.13.0. Remove code supporting p2p versions before 60001 (which has never been run).
2017-11-08[tests] Remove support for p2p alert messagesJohn Newbery
Alert messages were removed in p2p version 70013 (Bitcoin Core V0.13.0)
2017-11-08[tests] Remove support for bre-BIP31 ping messagesJohn Newbery
BIP31 support was added to Bitcoin Core in version 0.6.1. Our test framework is incompatible with Bitcoin Core versions that old, so remove all special logic for handling pre-BIP31 pings.
2017-11-08[tests] Remove dead code from mininode.pyJohn Newbery
Removes the dead deliver_sleep_time and EarlyDisconnectError code
2017-11-08[tests] Add p2p connection to TestNodeJohn Newbery
p2p connections can now be added to TestNode instances. This commit also updates the example test to use the new p2p interface in TestNode to demonstrate usage. A future commit will update the existing tests to use p2p through the TestNode.
2017-11-08[tests] fix TestNode.__getattr__() methodJohn Newbery
2017-11-06Have SegWit active by defaultPieter Wuille
2017-10-18Merge #11472: qa: Make tmpdir option an absolute path, misc cleanupWladimir J. van der Laan
fafa003 qa: Remove never used return value of sync_with_ping (MarcoFalke) fa9de37 qa: Make tmpdir option an absolute path (MarcoFalke) Pull request description: This should fix issues with the multiwallet test and its symlinks when the tmpdir is a relative path. Rather than fixing os.symlink to work with paths relative to a directory descriptor, which does not work on Windows, normalize the path instead. Tree-SHA512: 189690f3d065ea2f0f48e06775c86d513d0916c7c86312432e8e16df160e65539e288c2bd53d49a4180735fa940f6fcd52b506ccd7d9815651a9b1a69850dda6
2017-10-16[tests] Don't subclass from object for Python 3John Newbery
2017-10-16[tests] authproxy.py: tidy up __init__()John Newbery
2017-10-16[tests] fix flake8 warnings in authproxy.pyJohn Newbery
2017-10-16[tests] use python3 for authproxy.pyJohn Newbery
2017-10-13qa: Remove never used return value of sync_with_pingMarcoFalke
2017-10-13qa: Make tmpdir option an absolute pathMarcoFalke
This should fix issues with the multiwallet test and symlinks when the tmpdir is a relative path. Rather than fixing os.symlink to work with paths relative to a directory descriptor, which does not work on Windows, normalize the path instead.
2017-10-12Merge #11277: Fix uninitialized URI in batch RPC requestsWladimir J. van der Laan
4526d21 Add test for multiwallet batch RPC calls (Russell Yanofsky) 74182f2 Add missing batch rpc calls to python coverage logs (Russell Yanofsky) 505530c Add missing multiwallet rpc calls to python coverage logs (Russell Yanofsky) 9f67646 Make AuthServiceProxy._batch method usable (Russell Yanofsky) e02007a Limit AuthServiceProxyWrapper.__getattr__ wrapping (Russell Yanofsky) edafc71 Fix uninitialized URI in batch RPC requests (Russell Yanofsky) Pull request description: This fixes "Wallet file not specified" errors when making batch wallet RPC calls with more than one wallet loaded. This issue was reported by @NicolasDorier in https://github.com/bitcoin/bitcoin/issues/11257 Request URI is not used for anything except multiwallet request dispatching, so this change has no other effect. Tree-SHA512: b3907af48a6323f864bb045ee2fa56b604188b835025ef82ba3d81673244c04228d796323cec208a676e7cd578a95ec7c7ba1e84d0158b93844d5dda8f6589b9
2017-10-11Merge #11113: [net] Ignore getheaders requests for very old side blocksWladimir J. van der Laan
eff4bd8 [test] P2P functional test for certain fingerprinting protections (Jim Posen) a2be3b6 [net] Ignore getheaders requests for very old side blocks (Jim Posen) Pull request description: Sending a getheaders message with an empty locator and a stop hash is a request for a single header by hash. The node will respond with headers for blocks not in the main chain as well as those in the main chain. To avoid fingerprinting, the node should, however, ignore requests for headers on side branches that are too old. This replicates the logic that currently exists for `getdata` requests for blocks. Tree-SHA512: e04ef61e2b73945be6ec5977b3c5680b6dc3667246f8bfb67afae1ecaba900c0b49b18bbbb74869f7a37ef70b6ed99e78ebe0ea0a1569369fad9e447d720ffc4
2017-10-09[tests] Make comp test framework more debuggableJohn Newbery
Add logging so that each test prints the line number of the yield statement that generated the test.
2017-10-05scripted-diff: rename assert_raises_jsonrpc to assert_raises_rpc errorJohn Newbery
-BEGIN VERIFY SCRIPT- sed -i 's/assert_raises_jsonrpc/assert_raises_rpc_error/g' test/functional/*py test/functional/test_framework/*py -END VERIFY SCRIPT-
2017-10-05[tests] do not allow assert_raises_message to be called with JSONRPCExceptionJohn Newbery
2017-10-05[tests] remove direct testing on JSONRPCException from individual test casesJohn Newbery
2017-10-04Add missing batch rpc calls to python coverage logsRussell Yanofsky
Without this change, batch RPC calls are not included in coverage logs.
2017-10-04Add missing multiwallet rpc calls to python coverage logsRussell Yanofsky
This fixes a bug in coverage logging that's been around since the logging was introduced.
2017-10-03Make AuthServiceProxy._batch method usableRussell Yanofsky
Split off AuthServiceProxy.get_request method to make it easier to batch RPC requests without duplicating code and remove leading underscore from _batch method. This does not change any existing behavior.