| 4382 | |
| 4383 | |
| 4384 | def test_offline(node_factory): |
| 4385 | # if get_node starts it, it'll expect an address, so do it manually. |
| 4386 | l1 = node_factory.get_node(options={"offline": None}, start=False) |
| 4387 | l1.daemon.start() |
| 4388 | |
| 4389 | # we expect it to log offline mode not to listen. |
| 4390 | assert l1.daemon.is_in_log("Started in offline mode!") |
| 4391 | line = l1.daemon.is_in_log("connectd: Created listener on") |
| 4392 | port = re.search(r'connectd: Created listener on 127.0.0.1:(.*)', line).groups()[0] |
| 4393 | |
| 4394 | l2 = node_factory.get_node() |
| 4395 | |
| 4396 | # We cannot connect in! |
| 4397 | with pytest.raises(RpcError, match=f"All addresses failed: 127.0.0.1:{port}: Connection establishment: Connection refused."): |
| 4398 | l2.rpc.connect(l1.rpc.getinfo()['id'], 'localhost', int(port)) |
| 4399 | |
| 4400 | # We *can* connect out |
| 4401 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 4402 | |
| 4403 | |
| 4404 | def test_last_stable_connection(node_factory): |