aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/mininode.py
AgeCommit message (Collapse)Author
2018-10-24qa: Use named args in some testsMarcoFalke
Github-Pull: #14101 Rebased-From: fa782a308dbe7bc579c122f63c1c65666fc85e91
2018-08-13tests: Use explicit importspracticalswift
2018-08-11Merge #13915: [qa] Add test for max number of entries in locatorMarcoFalke
fa85c985ed qa: Add p2p_invalid_locator test (MarcoFalke) Pull request description: Should not be merged *before* #13907 Tree-SHA512: a67ca407854c421ed20a184d0b0dc90085aed3e3431d9652a107fa3022244767e67f67e50449b7e95721f56906836b134615875f28a21e8a012eb22cfe6a66a5
2018-08-10qa: Add p2p_invalid_locator testMarcoFalke
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-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-06-25qa: Avoid start/stop of the network thread mid-testMarcoFalke
2018-06-22[qa] mininode: Expose connection state through is_connectedMarcoFalke
2018-04-24qa: Clarify documentation for send_txs_and_testMarcoFalke
2018-04-16qa: Add test for orphan handlingMarcoFalke
2018-04-02[tests] Stop feature_block.py from blowing up memory.John Newbery
The new P2PDataStore class was sending full blocks in headers messages, which meant that calls to send_blocks_and_test() would blow up memory if called with a large number of blocks. Fix that by only sending headers in headers messages.
2018-03-21Fix typosDimitris Apostolou
2018-02-13Merge #11771: [tests] Change invalidtxrequest to use BitcoinTestFrameworkWladimir J. van der Laan
95e2e9a [tests] Change invalidtxrequest to use BitcoinTestFramework (John Newbery) 359d067 [tests] Fix flake8 warnings in invalidtxrequest (John Newbery) c32cf9f [tests] Add P2PDataStore class (John Newbery) cc046f6 [tests] Reduce NodeConn connection logging from info to debug (John Newbery) Pull request description: Next step in #10603 - first commit changes log level for an internal log from INFO to DEBUG. (Not really related, but I started finding the INFO level logging annoying when debuging test failures) - second commit introduces a `P2PStub` class - a subclass of `NodeConnCB` which has its own block and tx store and responds appropriately to getdata requests. Not all the functionality is used in `invalidtxrequest.py`, but will be used in `invalidblockrequest.py` and `p2p-fullblocktest` when those are changed to use `BitcoinTestFramework` - third commit tidies up `invalidtxrequest.py` - fourth commit removes usage of `ComparisonTestFramework` Tree-SHA512: f3085c73c15d6ce894e401490bce8a7fa7cf52b0c9d135ff7e351f1f6f517c99accab8588fcdc443f39ea8315329aaabd66b2baa32499df5a774737882030373
2018-01-30[tests] Add P2PDataStore classJohn Newbery
P2PDataStore subclasses NodeConnCB. This class keeps a store of txs and blocks and responds to getdata requests from the node-under-test.
2018-01-29[tests] Reduce NodeConn connection logging from info to debugJohn Newbery
2018-01-28Fix typospracticalswift
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa
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-11-29[tests] Rename NodeConn and NodeConnCBJohn Newbery
NodeConn -> P2PConnection NodeConnCB -> P2PInterface
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-23[tests] Remove mininode periodic (half-hour) ping messagesJohn Newbery
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-13qa: Remove unused NodeConn membersMarcoFalke
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-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-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-13qa: Remove never used return value of sync_with_pingMarcoFalke
2017-10-03[test] P2P functional test for certain fingerprinting protectionsJim Posen
2017-09-29Merge #11319: [qa] Fix error introduced into p2p-segwit.py, and prevent ↵MarcoFalke
future similar errors f97ab35fa qa: Fix bug introduced in p2p-segwit.py (Suhas Daftuar) a7820422e qa: Treat mininode p2p exceptions as fatal (Suhas Daftuar) Pull request description: #11121 inadvertently broke the constructor for the `TestNode()` object in `p2p-segwit.py`, silently breaking at least one of the tests. Although the python code was raising exceptions due to a `TestNode()` object not existing (or having the right type), mininode was masking these from anyone running the test through the test_runner (like travis), because it catches all exceptions during message delivery and just prints a log message and continues. Such "graceful" handling of errors is almost certainly something we don't want in our test suite, so the first commit here attempts to prevent that type of failure from ever being masked. The second commit fixes the particular bug in `p2p-segwit.py`. Tree-SHA512: b6646e3cb1e05c35c28e8899c44104bf2e2d0384643ca87042ab7f6ec0960d89f5bf25a7b95bab6e32d401c20a6018226160500f6ddceb923e81ffb04adb4f2f
2017-09-18Merge #11323: mininode: add an optimistic write and disable nagleMarcoFalke
1817398b3 mininode: add an optimistic write and disable nagle (Cory Fields) Pull request description: Disclaimer: I'm not familiar with asyncore, so I'm unclear how safe this is. It works for me (tm). Because the poll/select loop may pause for 100msec before actually doing a send, and we have no way to force the loop awake, try sending from the calling thread if the queue is empty. Also, disable nagle as all sends should be either full messages or unfinished sends. This shaves an average of ~1 minute or so off of my accumulated runtime, and 10-15 seconds off of actual runtime. Tree-SHA512: 6b61b8058e621dacf0b4dd353c10e3666fbda0691440eb6ebc432491ebada80a781dcd09291bf03e70112a41d3c2a0c91775ed08824b79bf8d0ebed11595c28b
2017-09-13mininode: add an optimistic write and disable nagleCory Fields
Because the poll/select loop may pause for 100msec before actually doing a send, and we have no way to force the loop awake, try sending from the calling thread if the queue is empty. Also, disable nagle as all sends should be either full messages or unfinished sends. This shaves an average of ~1 minute or so off of my accumulated runtime, and 10-15 seconds off of actual runtime.
2017-09-13Merge #11078: [tests] Make p2p-leaktests.py more robustMarcoFalke
0063d2c3d [tests] Make p2p-leaktests.py more robust (John Newbery) Pull request description: There has been an example of p2p-leaktests.py failing on travis in the new service bits test (introduced in #11001 . It appeared to me that the previous p2p connections had not been fully disconnected before attempting to add new p2p connections. I've added a sleep and restarted the NetworkThread, but I don't know whether this will fix the problem, since I'm unable to reproduce the failure locally. @MarcoFalke - not sure what you want to do here? I don't think this change could make things any worse. Tree-SHA512: f5427c26267185a903c9b75bb3925bf153b8afce70c8e493bf8f585f57d809d20643b4ee69081300b211d22e960242aecc3d719f4ddd230aa08fdc5484b55055
2017-09-13qa: Treat mininode p2p exceptions as fatalSuhas Daftuar
2017-08-28Remove unused variables and/or function callspracticalswift
2017-08-24[tests] Make p2p-leaktests.py more robustJohn Newbery
2017-08-17qa: Move wait_until to utilMarcoFalke
2017-08-07[tests] Test disconnecting unsupported service bits logic.John Newbery
In v0.15, we disconnect nodes that send us version messages with unsupported service bits (1 << 5 and 1 << 7). This commit adds a test that bitcoind will disconnect those nodes before August 1st 2018, and won't disconnect those nodes after August 1st 2018.
2017-06-22Fixed multiple typosDimitris Tsapakidis
A few "a->an" and "an->a". "Shows, if the supplied default SOCKS5 proxy" -> "Shows if the supplied default SOCKS5 proxy". Change made on 3 occurrences. "without fully understanding the ramification of a command" -> "without fully understanding the ramifications of a command". Removed duplicate words such as "the the".
2017-05-09[tests] Make wait_until timeout 60 seconds by defaultJohn Newbery