pytest: test to show conflict between websocket and wildcard addresses.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-12-02 15:05:20 +10:30 committed by Michael Schmoock
parent 94cb42bee6
commit cf40e585c3
1 changed files with 7 additions and 1 deletions

View File

@ -3746,11 +3746,17 @@ def test_old_feerate(node_factory):
l1.pay(l2, 1000)
@pytest.mark.skip('Broken')
@pytest.mark.developer("needs --dev-allow-localhost")
def test_websocket(node_factory):
ws_port = reserve()
port1, port2 = reserve(), reserve()
# We need a wildcard to show the websocket bug, but we need a real
# address to give us something to announce.
l1, l2 = node_factory.line_graph(2,
opts=[{'experimental-websocket-port': ws_port,
'addr': [':' + str(port1),
'127.0.0.1: ' + str(port2)],
'dev-allow-localhost': None},
{'dev-allow-localhost': None}],
wait_for_announce=True)
@ -3804,7 +3810,7 @@ def test_websocket(node_factory):
# Check node_announcement has websocket
assert (only_one(l2.rpc.listnodes(l1.info['id'])['nodes'])['addresses']
== [{'type': 'ipv4', 'address': '127.0.0.1', 'port': l1.port}, {'type': 'websocket', 'port': ws_port}])
== [{'type': 'ipv4', 'address': '127.0.0.1', 'port': port2}, {'type': 'websocket', 'port': ws_port}])
@pytest.mark.developer("dev-disconnect required")