aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/mininode.py
AgeCommit message (Collapse)Author
2020-04-03test: add BIP37 remote crash bug [CVE-2013-5700] test to p2p_filter.pySebastian Falbesoner
2020-03-31test: add BIP37 'filterclear' test to p2p_filter.pySebastian Falbesoner
2020-03-25test: Add basic test for BIP 37MarcoFalke
2019-11-03Remove network_event_loop instance in close()JamesC
The asyncio.new_event_loop() instance is now removed from the NetworkThread class during shutdown. This enables a NetworkThread instance to be restarted after being closed. The current NetworkThread class guards against an existing new_event_loop during initialization.
2019-10-02p2p: Remove BIP61 reject messagesMarcoFalke
2019-08-16test: Pass down correct chain name in testsMarcoFalke
2019-07-26test: Fail early on disconnect in mininode.wait_for_*MarcoFalke
2019-05-13test: Add test for p2p_blocksonlyMarcoFalke
2019-04-29Merge #15897: QA/mininode: Send all headers upfront in send_blocks_and_test ↵MarcoFalke
to avoid sending an unconnected one 9f9db39041 QA/mininode: Send all headers upfront in send_blocks_and_test to avoid sending an unconnected one (Luke Dashjr) Pull request description: While this doesn't currently trigger any problems, the network protocol does expect headers to be sent connectable in normal circumstances, and if too many are sent out of order will disconnect the peer. ACKs for commit 9f9db3: Tree-SHA512: 25b88718e4ba3d31aed2de7ece23fab9a0737fd6536c5e618ea8eb5a3a217dab0dffaebc4892df7993bcea7efb7c4fb5085fabebe99535b8f7fdde3c19df54ff
2019-04-25QA/mininode: Send all headers upfront in send_blocks_and_test to avoid ↵Luke Dashjr
sending an unconnected one
2019-03-19qa: mininode: Clearer error message on invalid magic bytesMarcoFalke
2019-03-02scripted-diff: Update copyright in ./testMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./test/ -END VERIFY SCRIPT-
2019-03-02build: Require python 3.5MarcoFalke
2019-01-24qa: Add tests for invalid message headersMarcoFalke
2018-11-13qa: Check specific reject reasons in feature_blockMarcoFalke
2018-11-07tests: Remove unused testing codepracticalswift
2018-11-06Merge #14522: tests: add invalid P2P message testsWladimir J. van der Laan
d20a9fa13d1c13f552e879798c0508be70190e71 tests: add tests for invalid P2P messages (James O'Beirne) 62f94d39f8de88a44bb0a8a2837d864f777aaacc tests: add P2PConnection.send_raw_message (James O'Beirne) 5aa31f6ef26f51ce461c917654dd1cfbbdd1409a tests: add utility to assert node memory usage hasn't increased (James O'Beirne) Pull request description: - Adds `p2p_invalid_messages.py`: tests based on behavior for dealing with invalid and malformed P2P messages. Includes a test verifying that we can't DoS a node by spamming it with large invalid messages. - Adds `TestNode.assert_memory_usage_stable`: a context manager that allows us to ensure memory usage doesn't significantly increase on a node during some test. - Adds `P2PConnection.send_raw_message`: which allows us to construct and send messages with tweaked headers. Tree-SHA512: 720a4894c1e6d8f1551b2ae710e5b06c9e4f281524623957cb01599be9afea82671dc26d6152281de0acb87720f0c53b61e2b27d40434d30e525dd9e31fa671f
2018-11-01tests: add P2PConnection.send_raw_messageJames O'Beirne
2018-10-26[tests] Test that nodes respond to getdata with notfoundMarcoFalke
If a node has not announced a tx at all, then it should respond to getdata messages for that tx with notfound, to avoid leaking tx origination privacy.
2018-10-10test: forward timeouts properly in send_blocks_and_testJames O'Beirne
2018-08-31qa: Read reject reasons from debug log, not p2p messagesMarcoFalke
2018-08-29qa: Use named args in some testsMarcoFalke
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.