Browse Source

tests: use chain's directory for finding sqlite3 file (works for liquid-regtests)

Move hardcoded 'regtest' to chainparams one
nifty/pset-pre
niftynei 5 years ago
parent
commit
766fd9b746
No known key found for this signature in database GPG Key ID: BFF0F67810C1EED1
  1. 12
      tests/test_closing.py

12
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])

Loading…
Cancel
Save