test: Add various low-level p2p tests

This commit is contained in:
MarcoFalke
2020-04-13 21:39:19 -04:00
parent 6ef45bc968
commit fa4c29bc1d
5 changed files with 63 additions and 3 deletions

View File

@ -152,6 +152,10 @@ class TxDownloadTest(BitcoinTestFramework):
wait_until(lambda: p.tx_getdata_count == MAX_GETDATA_IN_FLIGHT + 2)
self.nodes[0].setmocktime(0)
def test_spurious_notfound(self):
self.log.info('Check that spurious notfound is ignored')
self.nodes[0].p2ps[0].send_message(msg_notfound(vec=[CInv(1, 1)]))
def run_test(self):
# Setup the p2p connections
self.peers = []
@ -161,6 +165,8 @@ class TxDownloadTest(BitcoinTestFramework):
self.log.info("Nodes are setup with {} incoming connections each".format(NUM_INBOUND))
self.test_spurious_notfound()
# Test the in-flight max first, because we want no transactions in
# flight ahead of this test.
self.test_in_flight_max()