Start a node with rpcallow IP, and request getnetworkinfo at a non-localhost IP.
(self, allow_ips, rpchost, rpcport)
| 43 | self.stop_nodes() |
| 44 | |
| 45 | def run_allowip_test(self, allow_ips, rpchost, rpcport): |
| 46 | ''' |
| 47 | Start a node with rpcallow IP, and request getnetworkinfo |
| 48 | at a non-localhost IP. |
| 49 | ''' |
| 50 | self.log.info("Allow IP test for %s:%d" % (rpchost, rpcport)) |
| 51 | base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips] |
| 52 | self.nodes[0].rpchost = None |
| 53 | self.start_nodes([base_args]) |
| 54 | # connect to node through non-loopback interface |
| 55 | node = get_rpc_proxy(rpc_url(self.nodes[0].datadir, 0, "%s:%d" % (rpchost, rpcport)), 0, coveragedir=self.options.coveragedir) |
| 56 | node.getnetworkinfo() |
| 57 | self.stop_nodes() |
| 58 | |
| 59 | def run_test(self): |
| 60 | # due to OS-specific network stats queries, this test works only on Linux |
no test coverage detected