From 766fd9b746bf5b4ae9c82fe9988865ddc79455c8 Mon Sep 17 00:00:00 2001 From: niftynei Date: Mon, 22 Jun 2020 20:01:53 -0500 Subject: [PATCH] tests: use chain's directory for finding sqlite3 file (works for liquid-regtests) Move hardcoded 'regtest' to chainparams one --- tests/test_closing.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_closing.py b/tests/test_closing.py index 8eb8df019..eea3cf6c7 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -703,7 +703,7 @@ def test_penalty_outhtlc(node_factory, bitcoind, executor, chainparams): @unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1") @unittest.skipIf(SLOW_MACHINE and VALGRIND, "slow test") @unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Makes use of the sqlite3 db") -def test_penalty_htlc_tx_fulfill(node_factory, bitcoind): +def test_penalty_htlc_tx_fulfill(node_factory, bitcoind, chainparams): """ Test that the penalizing node claims any published HTLC transactions @@ -774,8 +774,8 @@ def test_penalty_htlc_tx_fulfill(node_factory, bitcoind): # make database snapshot of l2 l2.stop() - l2_db_path = os.path.join(l2.daemon.lightning_dir, 'regtest', 'lightningd.sqlite3') - l2_db_path_bak = os.path.join(l2.daemon.lightning_dir, 'regtest', 'lightningd.sqlite3.bak') + l2_db_path = os.path.join(l2.daemon.lightning_dir, chainparams['name'], 'lightningd.sqlite3') + l2_db_path_bak = os.path.join(l2.daemon.lightning_dir, chainparams['name'], 'lightningd.sqlite3.bak') copyfile(l2_db_path, l2_db_path_bak) l2.start() sync_blockheight(bitcoind, [l2]) @@ -845,7 +845,7 @@ def test_penalty_htlc_tx_fulfill(node_factory, bitcoind): @unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1") @unittest.skipIf(SLOW_MACHINE and VALGRIND, "slow test") @unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Makes use of the sqlite3 db") -def test_penalty_htlc_tx_timeout(node_factory, bitcoind): +def test_penalty_htlc_tx_timeout(node_factory, bitcoind, chainparams): """ Test that the penalizing node claims any published HTLC transactions @@ -933,8 +933,8 @@ def test_penalty_htlc_tx_timeout(node_factory, bitcoind): # make database snapshot of l2 l2.stop() - l2_db_path = os.path.join(l2.daemon.lightning_dir, 'regtest', 'lightningd.sqlite3') - l2_db_path_bak = os.path.join(l2.daemon.lightning_dir, 'regtest', 'lightningd.sqlite3.bak') + l2_db_path = os.path.join(l2.daemon.lightning_dir, chainparams['name'], 'lightningd.sqlite3') + l2_db_path_bak = os.path.join(l2.daemon.lightning_dir, chainparams['name'], 'lightningd.sqlite3.bak') copyfile(l2_db_path, l2_db_path_bak) l2.start() sync_blockheight(bitcoind, [l2])