MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / run_invalid_allowip_test

Method run_invalid_allowip_test

test/functional/rpc_bind.py:78–95  ·  view source on GitHub ↗

Check parameter interaction with -rpcallowip and -cjdnsreachable. RFC4193 addresses are fc00::/7 like CJDNS but have an optional "local" L bit making them fd00:: which should always be OK.

(self)

Source from the content-addressed store, hash-verified

76 self.stop_nodes()
77
78 def run_invalid_allowip_test(self):
79 '''
80 Check parameter interaction with -rpcallowip and -cjdnsreachable.
81 RFC4193 addresses are fc00::/7 like CJDNS but have an optional
82 "local" L bit making them fd00:: which should always be OK.
83 '''
84 self.log.info("Allow RFC4193 when compatible with CJDNS options")
85 # Don't rpcallow RFC4193 with L-bit=0 if CJDNS is enabled
86 self.nodes[0].assert_start_raises_init_error(
87 ["-rpcallowip=fc00:db8:c0:ff:ee::/80","-cjdnsreachable"],
88 "Invalid -rpcallowip subnet specification",
89 match=ErrorMatch.PARTIAL_REGEX)
90 # OK to rpcallow RFC4193 with L-bit=1 if CJDNS is enabled
91 self.start_node(0, ["-rpcallowip=fd00:db8:c0:ff:ee::/80","-cjdnsreachable"])
92 self.stop_nodes()
93 # OK to rpcallow RFC4193 with L-bit=0 if CJDNS is not enabled
94 self.start_node(0, ["-rpcallowip=fc00:db8:c0:ff:ee::/80"])
95 self.stop_nodes()
96
97 def run_test(self):
98 if sum([self.options.run_ipv4, self.options.run_ipv6, self.options.run_nonloopback]) > 1:

Callers 1

run_testMethod · 0.95

Calls 4

infoMethod · 0.80
start_nodeMethod · 0.80
stop_nodesMethod · 0.80

Tested by

no test coverage detected