Skip to content

Commit e6b8f19

Browse files
committed
test: add coverage for whitelisting manual connections
1 parent c985eb8 commit e6b8f19

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/functional/p2p_permissions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,14 @@ def run_test(self):
8383
["-whitelist=all@127.0.0.1"],
8484
["forcerelay", "noban", "mempool", "bloomfilter", "relay", "download", "addr"])
8585

86+
for flag, permissions in [(["-whitelist=noban,out@127.0.0.1"], ["noban", "download"]), (["-whitelist=noban@127.0.0.1"], [])]:
87+
self.restart_node(0, flag)
88+
self.connect_nodes(0, 1)
89+
peerinfo = self.nodes[0].getpeerinfo()[0]
90+
assert_equal(peerinfo['permissions'], permissions)
91+
8692
self.stop_node(1)
93+
self.nodes[1].assert_start_raises_init_error(["-whitelist=in,out@127.0.0.1"], "Only direction was set, no permissions", match=ErrorMatch.PARTIAL_REGEX)
8794
self.nodes[1].assert_start_raises_init_error(["-whitelist=oopsie@127.0.0.1"], "Invalid P2P permission", match=ErrorMatch.PARTIAL_REGEX)
8895
self.nodes[1].assert_start_raises_init_error(["-whitelist=noban@127.0.0.1:230"], "Invalid netmask specified in", match=ErrorMatch.PARTIAL_REGEX)
8996
self.nodes[1].assert_start_raises_init_error(["-whitebind=noban@127.0.0.1/10"], "Cannot resolve -whitebind address", match=ErrorMatch.PARTIAL_REGEX)

0 commit comments

Comments
 (0)