Skip to content

Commit a4e64fa

Browse files
committed
pytest: write a test for --dev-no-reconnect-private.
Indeed it fails. Signed-off-by: Rusty Russell <[email protected]>
1 parent 6d142df commit a4e64fa

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/test_connection.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4754,3 +4754,30 @@ def test_onionmessage_forward_fail(node_factory, bitcoind):
47544754
l1.rpc.fetchinvoice(offer['bolt12'])
47554755

47564756
l2.daemon.is_in_log('plugin-onionmessage_forward_fail_notification.py: Received onionmessage_forward_fail')
4757+
4758+
4759+
@pytest.mark.xfail(strict=True)
4760+
def test_private_channel_no_reconnect(node_factory):
4761+
l1, l2 = node_factory.line_graph(2,
4762+
announce_channels=False,
4763+
wait_for_announce=False,
4764+
opts={'dev-no-reconnect-private': None,
4765+
'may_reconnect': True})
4766+
l3, l4 = node_factory.line_graph(2,
4767+
announce_channels=True,
4768+
wait_for_announce=False,
4769+
opts={'dev-no-reconnect-private': None,
4770+
'may_reconnect': True})
4771+
4772+
# test for 'private' flag in rpc output
4773+
assert only_one(l1.rpc.listpeerchannels(l2.info['id'])['channels'])['private']
4774+
4775+
# l1 won't even *try* to reconnect on restart.
4776+
l1.restart()
4777+
4778+
# l3 will.
4779+
l3.restart()
4780+
4781+
wait_for(lambda: only_one(l3.rpc.listpeers()['peers'])['connected'] is True)
4782+
4783+
assert only_one(l1.rpc.listpeers()['peers'])['connected'] is False

0 commit comments

Comments
 (0)