mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 20:09:18 +01:00
pytest: add test to check we notice remote disconnects.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
eb203bf71e
commit
0cba062318
1 changed files with 13 additions and 2 deletions
|
@ -401,8 +401,19 @@ def test_disconnect_opener(node_factory):
|
|||
l1.rpc.fundchannel(l2.info['id'], 25000)
|
||||
|
||||
# Should still only have one peer!
|
||||
assert len(l1.rpc.listpeers()) == 1
|
||||
assert len(l2.rpc.listpeers()) == 1
|
||||
assert len(l1.rpc.listpeers()['peers']) == 1
|
||||
assert len(l2.rpc.listpeers()['peers']) == 1
|
||||
|
||||
|
||||
def test_remote_disconnect(node_factory):
|
||||
l1, l2 = node_factory.get_nodes(2)
|
||||
|
||||
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
||||
assert l2.rpc.listpeers()['peers'] != []
|
||||
l2.rpc.disconnect(l1.info['id'])
|
||||
|
||||
# l1 should notice!
|
||||
wait_for(lambda: l1.rpc.listpeers()['peers'] == [])
|
||||
|
||||
|
||||
@pytest.mark.developer
|
||||
|
|
Loading…
Add table
Reference in a new issue