def METHOD_NAME(self, allow_ips, connect_to, addresses, expected):
    '''
    Start a node with requested rpcallowip and rpcbind parameters,
    then try to connect, and check if the set of bound addresses
    matches the expected set.
    '''
    self.log.info("Bind test for %s" % str(addresses))
    expected = [(addr_to_hex(addr), port) for (addr, port) in expected]
    base_args = ['-disablewallet', '-nolisten']
    if allow_ips:
        base_args += ['-rpcallowip=' + x for x in allow_ips]
    binds = ['-rpcbind='+addr for addr in addresses]
    self.nodes[0].rpchost = connect_to
    self.start_node(0, base_args + binds)
    pid = self.nodes[0].process.pid
    assert_equal(set(get_bind_addrs(pid)), set(expected))
    self.stop_nodes()