aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_leak.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-04-15 08:26:18 -0400
committerMarcoFalke <falke.marco@gmail.com>2020-04-15 08:26:34 -0400
commit20c0e2e0f04f699d29419d52696601b76eca3124 (patch)
treedc85d5e8078801d5b1a8d31be10bbea8e4abf7af /test/functional/p2p_leak.py
parent18f11fb24b47c6762e659b4bd3413f03e2c9ec99 (diff)
parentfa4c29bc1d2425f861845bae4f3816d9817e622a (diff)
downloadbitcoin-20c0e2e0f04f699d29419d52696601b76eca3124.tar.xz
Merge #18628: test: Add various low-level p2p tests
fa4c29bc1d2425f861845bae4f3816d9817e622a test: Add various low-level p2p tests (MarcoFalke) Pull request description: ACKs for top commit: jonatack: ACK fa4c29bc1d242 Tree-SHA512: 842821b97359d4747c763398f7013415858c18a300cd882887bc812d039b5cbb67b9aa6f68434575dbc3c52f7eb8c43d1b293a59555a7242c0ca615cf44dc0aa
Diffstat (limited to 'test/functional/p2p_leak.py')
-rwxr-xr-xtest/functional/p2p_leak.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/functional/p2p_leak.py b/test/functional/p2p_leak.py
index c574c1ab9f..76f33574a2 100755
--- a/test/functional/p2p_leak.py
+++ b/test/functional/p2p_leak.py
@@ -12,7 +12,12 @@ into sending us something it shouldn't."""
import time
-from test_framework.messages import msg_getaddr, msg_ping, msg_verack
+from test_framework.messages import (
+ msg_getaddr,
+ msg_ping,
+ msg_verack,
+ msg_version,
+)
from test_framework.mininode import mininode_lock, P2PInterface
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
@@ -147,6 +152,15 @@ class P2PLeakTest(BitcoinTestFramework):
assert_equal(ver.nStartingHeight, 201)
assert_equal(ver.nRelay, 1)
+ self.log.info('Check that old nodes are disconnected')
+ p2p_old_node = self.nodes[0].add_p2p_connection(P2PInterface(), send_version=False, wait_for_verack=False)
+ old_version_msg = msg_version()
+ old_version_msg.nVersion = 31799
+ wait_until(lambda: p2p_old_node.is_connected)
+ with self.nodes[0].assert_debug_log(['peer=4 using obsolete version 31799; disconnecting']):
+ p2p_old_node.send_message(old_version_msg)
+ p2p_old_node.wait_for_disconnect()
+
if __name__ == '__main__':
P2PLeakTest().main()