diff --git a/configure b/configure index 85066278c..a887a5eb5 100755 --- a/configure +++ b/configure @@ -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. diff --git a/tests/fixtures.py b/tests/fixtures.py index 0b38b2de2..d2fcac667 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -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: diff --git a/tests/utils.py b/tests/utils.py index 1c7f7f997..5e5bcfd55 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -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'],