v31.1-roots.1 · Commit 17: [PATCH 17/17] fix(release): preserve notice bytes and integrate nightly fixes
test/functional/p2p_disconnect_ban.py
Before: test/functional/p2p_disconnect_ban.py · After: test/functional/p2p_disconnect_ban.py
File metadata
index a829e316faf41d3827484fbef43803b4ba7e53bd..8a4ba48ac87bdfe083c4c535abbb26a8b22dc8b2 100755
Download original patch · Release notes
Diff rows 1–25 of 25. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
test/functional/p2p_disconnect_ban.py
CHANGED
|
@@ -11,6 +11,8 @@ from test_framework.test_framework import BitcoinTestFramework
|
|
|
11
11
|
from test_framework.util import (
|
|
12
12
|
assert_equal,
|
|
13
13
|
assert_raises_rpc_error,
|
|
14
|
+
get_rpc_proxy,
|
|
15
|
+
rpc_url,
|
|
14
16
|
)
|
|
15
17
|
|
|
16
18
|
class DisconnectBanTest(BitcoinTestFramework):
|
|
@@ -129,6 +131,17 @@ class DisconnectBanTest(BitcoinTestFramework):
|
|
|
129
131
|
self.log.info("disconnectnode: fail to disconnect when calling with junk address")
|
|
130
132
|
assert_raises_rpc_error(-29, "Node not found in connected nodes", self.nodes[0].disconnectnode, address="221B Baker Street")
|
|
131
133
|
|
|
134
|
+
self.log.info("disconnectnode: fail to disconnect when calling with invalid subnet containing NUL")
|
|
135
|
+
# Process arguments cannot carry NUL bytes, so use JSON-RPC for this input even with --usecli.
|
|
136
|
+
node = self.nodes[0]
|
|
137
|
+
rpc = get_rpc_proxy(
|
|
138
|
+
rpc_url(node.datadir_path, node.index, self.chain, node.rpchost),
|
|
139
|
+
node.index,
|
|
140
|
+
timeout=node.rpc_timeout,
|
|
141
|
+
coveragedir=node.coverage_dir,
|
|
142
|
+
)
|
|
143
|
+
assert_raises_rpc_error(-8, "Invalid subnet", rpc.disconnectnode, address="1.2.3.0/24\0")
|
|
144
|
+
|
|
132
145
|
self.log.info("disconnectnode: successfully disconnect node by address")
|
|
133
146
|
address1 = self.nodes[0].getpeerinfo()[0]['addr']
|
|
134
147
|
self.nodes[0].disconnectnode(address=address1)
|