aboutsummaryrefslogtreecommitdiff
path: root/test/functional/sendheaders.py
AgeCommit message (Collapse)Author
2017-12-11[tests] Use network_thread_start() in tests.John Newbery
2017-11-29[tests] Rename NodeConn and NodeConnCBJohn Newbery
NodeConn -> P2PConnection NodeConnCB -> P2PInterface
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-17[tests] address review commentsJohn Newbery
2017-11-16[tests] fix flakiness in sendheaders.pyJohn Newbery
Fixes to sources of intermittent failure in sendheaders.py - at the start of test_null_locators(), a new block is generated and then a getheaders is sent. check_last_accouncement() is called to assert that the headers message is received. However, the new block triggers an inv to be sent over both P2P connections, so there's a race. If the inv is received at the wrong time, the test fails. - test_null_locators() ends by sending a block to the node under test. At the start of test_nonnull_locators(), a block is mined and check_last_announcement() is called to assert that the inv received is for the same block. That means there's a race: if the inv from the block sent in test_null_locators() is received at the wrong time, the test fails.
2017-11-16[tests] refactor check_last_announcement() in sendheaders.pyJohn Newbery
All calls of check_last_announcement() asserted that the return value was True. Just assert inside the function instead. This gives better debug information if the assert fails. Also only check the contents of the most recent inv and header if check_last_announcement() is called with the relevant argument.
2017-11-16[tests] tidy up BaseNode in sendheaders.pyJohn Newbery
2017-11-16[tests] fix flake8 warnings in sendheaders.pyJohn Newbery
2017-11-09Merge #11580: Do not send (potentially) invalid headers in response to ↵Wladimir J. van der Laan
getheaders 725b79a [test] Verify node doesn't send headers that haven't been fully validated (Russell Yanofsky) 3788a84 Do not send (potentially) invalid headers in response to getheaders (Matt Corallo) Pull request description: Nowhere else in the protocol do we send headers which are for blocks we have not fully validated except in response to getheaders messages with a null locator. On my public node I have not seen any such request (whether for an invalid block or not) in at least two years of debug.log output, indicating that this should have minimal impact. Tree-SHA512: c1f6e0cdcdfb78ea577d555f9b3ceb1b4b60eff4f6cf313bfd8b576c9562d797bea73abc23f7011f249ae36dd539c715f3d20487ac03ace60e84e1b77c0c1e1a
2017-11-08[tests] use TestNode p2p connection in testsJohn Newbery
2017-11-07Merge #11389: Support having SegWit always active in regtest (sipa, ajtowns, ↵MarcoFalke
jnewbery) d61845818 Have SegWit active by default (Pieter Wuille) 4bd89210a Unit tests for always-active versionbits. (Anthony Towns) d07ee77ab Always-active versionbits support (Pieter Wuille) 18e071841 [consensus] Pin P2SH activation to block 173805 on mainnet (John Newbery) 526023aa7 Improve handling of BIP9Deployment limits (Anthony Towns) Pull request description: Most tests shouldn't have to deal with the now-historical SegWit activation transition (and other deployments, but SegWit is certainly the hardest one to accomodate). This PR makes a versionbits starttime of -1 equal to "always active", and enables it by default for SegWit on regtest. Individual tests can override this by using the existing `-vbparams` option. A few unit tests and functional tests are adapted to indeed override vbparams, as they specifically test the transition. This is in preparation for wallet SegWit support, but I thought having earlier eyes on it would be useful. Tree-SHA512: 3f07a7b41cf46476e6c7a5c43244e68c9f41d223482cedaa4c02a3a7b7cd0e90cbd06b84a1f3704620559636a2268f5767d4c52d09c1b354945737046f618fe5
2017-11-06Have SegWit active by defaultPieter Wuille
2017-11-02[test] Verify node doesn't send headers that haven't been fully validatedRussell Yanofsky
2017-10-23qa: Fix race condition in sendheaders.pySuhas Daftuar
2017-09-01[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.
2017-08-17qa: Move wait_until to utilMarcoFalke
2017-08-11[qa] Fix block message processing error in sendheaders.pySuhas Daftuar
2017-05-09[tests] increase timeouts in sendheaders testJohn Newbery
2017-05-02[tests] Remove is_network_split from funtional test casesJohn Newbery
2017-04-18Remove duplicate method definitions in NodeConnCB subclassesJohn Newbery
All Node classes in individual test cases subclass from NodeConnCB. Many have duplicate definitions for methods that are defined in the base class. This commit removes those duplicate definitions. This commit removes ~290 lines of duplicate code.
2017-03-28Remove SingleNodeConnCBJohn Newbery
This commit merges the NodeConnCB and SingleNodeConnCB into a single class (called NodeConnCB). The original intent for the NodeConnCB was to be able to have a python 'mininode' connect to multiple running bitcoinds. This has never been used and can be achieved more easily by having multiple NodeConns backed by a common datastore if it is ever needed. The changes in mininode.py are just code moves (and merging the two classes into a single class). The code changes in the individual test cases are changing the subclasses to subclass from NodeConnCB instead of SingleNodeConnCB. There is a lot of duplicate code in the subclasses that can be removed in future commits.
2017-03-20Rename rpc-tests directory to functionalJohn Newbery