mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
pytest: Allow switching chaind depending on a config option
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
13ba5b3d20
commit
9025a3cd39
2
configure
vendored
2
configure
vendored
@ -112,6 +112,7 @@ set_defaults()
|
||||
COPTFLAGS=${COPTFLAGS-$(default_coptflags "$DEVELOPER")}
|
||||
CONFIGURATOR_CC=${CONFIGURATOR_CC-$CC}
|
||||
VALGRIND=${VALGRIND:-$(default_valgrind_setting)}
|
||||
TEST_NETWORK=${TEST_NETWORK:-regtest}
|
||||
}
|
||||
|
||||
usage()
|
||||
@ -352,6 +353,7 @@ add_var COMPAT "$COMPAT" $CONFIG_HEADER
|
||||
add_var PYTEST "$PYTEST"
|
||||
add_var STATIC "$STATIC"
|
||||
add_var ASAN "$ASAN"
|
||||
add_var TEST_NETWORK "$TEST_NETWORK"
|
||||
|
||||
# Hack to avoid sha256 name clash with libwally: will be fixed when that
|
||||
# becomes a standalone shared lib.
|
||||
|
@ -1,6 +1,6 @@
|
||||
from concurrent import futures
|
||||
from db import SqliteDbProvider, PostgresDbProvider
|
||||
from utils import NodeFactory, BitcoinD
|
||||
from utils import NodeFactory, BitcoinD, ElementsD
|
||||
|
||||
import logging
|
||||
import os
|
||||
@ -74,9 +74,17 @@ def test_name(request):
|
||||
yield request.function.__name__
|
||||
|
||||
|
||||
network_daemons = {
|
||||
'regtest': BitcoinD,
|
||||
'liquid-regtest': ElementsD,
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def bitcoind(directory, teardown_checks):
|
||||
bitcoind = BitcoinD(bitcoin_dir=directory)
|
||||
chaind = network_daemons[config.get('TEST_NETWORK', 'regtest')]
|
||||
bitcoind = chaind(bitcoin_dir=directory)
|
||||
|
||||
try:
|
||||
bitcoind.start()
|
||||
except Exception:
|
||||
|
@ -440,7 +440,7 @@ class LightningD(TailableProc):
|
||||
'lightning-dir': lightning_dir,
|
||||
'addr': '127.0.0.1:{}'.format(port),
|
||||
'allow-deprecated-apis': 'false',
|
||||
'network': 'regtest',
|
||||
'network': config.get('TEST_NETWORK', 'regtest'),
|
||||
'ignore-fee-limits': 'false',
|
||||
'bitcoin-rpcuser': BITCOIND_CONFIG['rpcuser'],
|
||||
'bitcoin-rpcpassword': BITCOIND_CONFIG['rpcpassword'],
|
||||
|
Loading…
Reference in New Issue
Block a user