mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 16:14:23 +01:00
pytest: only use dev-allow-localhost when needed.
The next patches get better at reconecting, so if we use dev-allow-localhost nodes can often find each other and reconnect before shutting down; only use that option where we actually need it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
e47ac33a37
commit
329270525c
@@ -112,7 +112,8 @@ def test_announce_address(node_factory, bitcoind):
|
|||||||
'silkroad6ownowfk.onion',
|
'silkroad6ownowfk.onion',
|
||||||
'1.2.3.4:1234',
|
'1.2.3.4:1234',
|
||||||
'::'],
|
'::'],
|
||||||
'log-level': 'io'}
|
'log-level': 'io',
|
||||||
|
'dev-allow-localhost': None}
|
||||||
l1, l2 = node_factory.get_nodes(2, opts=[opts, {}])
|
l1, l2 = node_factory.get_nodes(2, opts=[opts, {}])
|
||||||
|
|
||||||
# It should warn about the collision between --addr=127.0.0.1:<ephem>
|
# It should warn about the collision between --addr=127.0.0.1:<ephem>
|
||||||
@@ -217,7 +218,10 @@ def test_gossip_timestamp_filter(node_factory, bitcoind):
|
|||||||
def test_connect_by_gossip(node_factory, bitcoind):
|
def test_connect_by_gossip(node_factory, bitcoind):
|
||||||
"""Test connecting to an unknown peer using node gossip
|
"""Test connecting to an unknown peer using node gossip
|
||||||
"""
|
"""
|
||||||
l1, l2, l3 = node_factory.get_nodes(3)
|
l1, l2, l3 = node_factory.get_nodes(3,
|
||||||
|
opts=[{'dev-allow-localhost': None},
|
||||||
|
{},
|
||||||
|
{'dev-allow-localhost': None}])
|
||||||
l2.rpc.connect(l3.info['id'], 'localhost', l3.port)
|
l2.rpc.connect(l3.info['id'], 'localhost', l3.port)
|
||||||
|
|
||||||
# Nodes are gossiped only if they have channels
|
# Nodes are gossiped only if they have channels
|
||||||
|
|||||||
@@ -538,9 +538,13 @@ def test_io_logging(node_factory, executor):
|
|||||||
|
|
||||||
|
|
||||||
def test_address(node_factory):
|
def test_address(node_factory):
|
||||||
l1 = node_factory.get_node()
|
if DEVELOPER:
|
||||||
|
opts = {'dev-allow-localhost': None}
|
||||||
|
else:
|
||||||
|
opts = None
|
||||||
|
l1 = node_factory.get_node(options=opts)
|
||||||
addr = l1.rpc.getinfo()['address']
|
addr = l1.rpc.getinfo()['address']
|
||||||
if 'dev-allow-localhost' in l1.daemon.opts:
|
if DEVELOPER:
|
||||||
assert len(addr) == 1
|
assert len(addr) == 1
|
||||||
assert addr[0]['type'] == 'ipv4'
|
assert addr[0]['type'] == 'ipv4'
|
||||||
assert addr[0]['address'] == '127.0.0.1'
|
assert addr[0]['address'] == '127.0.0.1'
|
||||||
|
|||||||
@@ -317,8 +317,6 @@ class LightningD(TailableProc):
|
|||||||
if DEVELOPER:
|
if DEVELOPER:
|
||||||
self.opts['dev-broadcast-interval'] = 1000
|
self.opts['dev-broadcast-interval'] = 1000
|
||||||
self.opts['dev-bitcoind-poll'] = 1
|
self.opts['dev-bitcoind-poll'] = 1
|
||||||
# lightningd won't announce non-routable addresses by default.
|
|
||||||
self.opts['dev-allow-localhost'] = None
|
|
||||||
self.prefix = 'lightningd-%d' % (node_id)
|
self.prefix = 'lightningd-%d' % (node_id)
|
||||||
|
|
||||||
filters = [
|
filters = [
|
||||||
|
|||||||
Reference in New Issue
Block a user