Skip to content

Commit 387315c

Browse files
committed
Skip or require VLS_PERMISSIVE=1 as appropriate
1 parent dfdd098 commit 387315c

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

tests/test_bookkeeper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def test_bookkeeping_closing_subsat_htlcs(node_factory, bitcoind, chainparams):
120120

121121

122122
@unittest.skipIf(TEST_NETWORK != 'regtest', "External wallet support doesn't work with elements yet.")
123+
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "remote_hsmd doesn't allow withdrawal to non-wallet, non-allowlisted address")
123124
def test_bookkeeping_external_withdraws(node_factory, bitcoind):
124125
""" Withdrawals to an external address shouldn't be included
125126
in the income statements until confirmed"""
@@ -201,6 +202,7 @@ def test_bookkeeping_external_withdraws(node_factory, bitcoind):
201202

202203
@unittest.skipIf(TEST_NETWORK != 'regtest', "External wallet support doesn't work with elements yet.")
203204
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Depends on sqlite3 database location")
205+
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "policy: can't withdraw to non-wallet address")
204206
def test_bookkeeping_external_withdraw_missing(node_factory, bitcoind):
205207
""" Withdrawals to an external address turn up as
206208
extremely large onchain_fees when they happen before
@@ -267,6 +269,7 @@ def test_bookkeeping_external_withdraw_missing(node_factory, bitcoind):
267269

268270

269271
@unittest.skipIf(TEST_NETWORK != 'regtest', "External wallet support doesn't work with elements yet.")
272+
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "policy: can't withdraw to non-wallet address")
270273
def test_bookkeeping_rbf_withdraw(node_factory, bitcoind):
271274
""" If a withdraw to an external gets RBF'd,
272275
it should *not* show up in our income ever.
@@ -413,6 +416,7 @@ def _check_events(node, channel_id, exp_events):
413416

414417
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "turns off bookkeeper at start")
415418
@unittest.skipIf(TEST_NETWORK != 'regtest', "network fees hardcoded")
419+
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "remote_hsmd doesn't allow push of non-trivial amount")
416420
@pytest.mark.openchannel('v1', 'Uses push-msat')
417421
def test_bookkeeping_missed_chans_pushed(node_factory, bitcoind):
418422
"""

tests/test_db.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ def test_sqlite3_builtin_backup(bitcoind, node_factory):
446446

447447

448448
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Don't know how to swap dbs in Postgres")
449+
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "vlsd chokes on allowlist when started on wrong network")
449450
def test_db_sanity_checks(bitcoind, node_factory):
450451
l1, l2 = node_factory.get_nodes(2, opts=[{'allow_broken_log': True,
451452
'may_fail': True}, {}])

tests/test_misc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,6 +2594,7 @@ def test_sendcustommsg(node_factory):
25942594
])
25952595

25962596

2597+
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd doesn't support dev-force-privkey")
25972598
@pytest.mark.developer("needs --dev-force-privkey")
25982599
def test_makesecret(node_factory):
25992600
"""
@@ -2632,6 +2633,7 @@ def test_staticbackup(node_factory):
26322633
and l1.rpc.staticbackup()["scb"][0][16: 16 + 64] == _["channel_id"])
26332634

26342635

2636+
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd says no such channel")
26352637
def test_recoverchannel(node_factory):
26362638
"""
26372639
Test recoverchannel

tests/test_opening.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,7 @@ def test_zeroconf_open(bitcoind, node_factory):
14101410
l2.rpc.pay(inv)
14111411

14121412

1413+
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd inplace and socket don't generate WIRE_HSMD_CUPDATE_SIG_REQ log messages")
14131414
def test_zeroconf_public(bitcoind, node_factory, chainparams):
14141415
"""Test that we transition correctly from zeroconf to public
14151416

tests/test_wallet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ def test_utxopsbt(node_factory, bitcoind, chainparams):
739739
reservedok=True)
740740

741741

742+
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "non-beneficial value considered as fees is above maximum feerate")
742743
def test_sign_external_psbt(node_factory, bitcoind, chainparams):
743744
"""
744745
A PSBT w/ one of our inputs should be signable (we can fill

0 commit comments

Comments
 (0)