Skip to content

Commit

Permalink
tests: skip tests incompatible with VLS
Browse files Browse the repository at this point in the history
  • Loading branch information
ksedgwic committed Nov 23, 2023
1 parent 36d4ce8 commit 6c66ec8
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_bookkeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ def test_bookkeeping_rbf_withdraw(node_factory, bitcoind):
assert len(fees) == 1


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "hsmd_sign_option_will_fund_offer not supported")
@pytest.mark.openchannel('v2')
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "turns off bookkeeper at start")
@unittest.skipIf(TEST_NETWORK != 'regtest', "network fees hardcoded")
Expand Down Expand Up @@ -408,6 +409,7 @@ def _check_events(node, channel_id, exp_events):

@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "turns off bookkeeper at start")
@unittest.skipIf(TEST_NETWORK != 'regtest', "network fees hardcoded")
@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")
@pytest.mark.openchannel('v1', 'Uses push-msat')
def test_bookkeeping_missed_chans_pushed(node_factory, bitcoind):
"""
Expand Down Expand Up @@ -599,6 +601,7 @@ def test_bookkeeping_onchaind_txs(node_factory, bitcoind):
assert outs == only_one(wallet_bal['balances'])['balance_msat']


#@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "invoice from offer: Invalid bech32: invalid checksum")
def test_bookkeeping_descriptions(node_factory, bitcoind, chainparams):
"""
When an 'invoice' type event comes through, we look up the description details
Expand Down
16 changes: 16 additions & 0 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ def test_closing_negotiation_step_700sat(node_factory, bitcoind, chainparams):
closing_negotiation_step(node_factory, bitcoind, chainparams, opts)


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "dev_sign_last_tx causes subsequent validate_holder_commitment_tx failure")
@pytest.mark.parametrize("anchors", [False, True])
def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams, anchors):
"""Test penalty transaction with an incoming HTLC"""
Expand Down Expand Up @@ -614,6 +615,7 @@ def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams, anchors):
check_utxos_channel(l2, [channel_id], expected_2, tags)


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "dev_sign_last_tx causes subsequent validate_holder_commitment_tx failure")
@pytest.mark.parametrize("anchors", [False, True])
def test_penalty_outhtlc(node_factory, bitcoind, executor, chainparams, anchors):
"""Test penalty transaction with an outgoing HTLC"""
Expand Down Expand Up @@ -750,6 +752,7 @@ def test_penalty_outhtlc(node_factory, bitcoind, executor, chainparams, anchors)


@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "handle_sign_option_will_fund_offer unimplemented")
@pytest.mark.openchannel('v2')
@pytest.mark.slow_test
def test_channel_lease_falls_behind(node_factory, bitcoind):
Expand Down Expand Up @@ -791,6 +794,7 @@ def test_channel_lease_falls_behind(node_factory, bitcoind):


@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "handle_sign_option_will_fund_offer unimplemented")
@pytest.mark.openchannel('v2')
@pytest.mark.slow_test
def test_channel_lease_post_expiry(node_factory, bitcoind, chainparams):
Expand Down Expand Up @@ -892,6 +896,7 @@ def test_channel_lease_post_expiry(node_factory, bitcoind, chainparams):


@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "handle_sign_option_will_fund_offer unimplemented")
@pytest.mark.openchannel('v2')
@pytest.mark.slow_test
def test_channel_lease_unilat_closes(node_factory, bitcoind):
Expand Down Expand Up @@ -1004,6 +1009,7 @@ def test_channel_lease_unilat_closes(node_factory, bitcoind):


@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "handle_sign_option_will_fund_offer unimplemented")
@pytest.mark.openchannel('v2')
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Makes use of the sqlite3 db")
def test_channel_lease_lessor_cheat(node_factory, bitcoind, chainparams):
Expand Down Expand Up @@ -1080,6 +1086,7 @@ def test_channel_lease_lessor_cheat(node_factory, bitcoind, chainparams):


@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "handle_sign_option_will_fund_offer unimplemented")
@pytest.mark.openchannel('v2')
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Makes use of the sqlite3 db")
def test_channel_lease_lessee_cheat(node_factory, bitcoind, chainparams):
Expand Down Expand Up @@ -1155,6 +1162,8 @@ def test_channel_lease_lessee_cheat(node_factory, bitcoind, chainparams):
'Unknown spend of OUR_UNILATERAL/DELAYED_OUTPUT_TO_US by'])


# VLS_PERMISSIVE generates invalid signature bassed on bad commitnum
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "invalid next holder commitment number: 4 != 6")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Makes use of the sqlite3 db")
@pytest.mark.slow_test
@pytest.mark.parametrize("anchors", [False, True])
Expand Down Expand Up @@ -1339,6 +1348,8 @@ def test_penalty_htlc_tx_fulfill(node_factory, bitcoind, chainparams, anchors):
check_balance_snaps(l2, expected_bals_2)


# VLS_PERMISSIVE generates invalid signature bassed on bad commitnum
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "invalid next holder commitment number: 4 != 6")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Makes use of the sqlite3 db")
@pytest.mark.slow_test
@pytest.mark.parametrize("anchors", [False, True])
Expand Down Expand Up @@ -1568,6 +1579,7 @@ def test_penalty_htlc_tx_timeout(node_factory, bitcoind, chainparams, anchors):
assert acc['resolved_at_block'] > 0


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "exceeds max fee policy")
@pytest.mark.parametrize("anchors", [False, True])
def test_penalty_rbf_normal(node_factory, bitcoind, executor, chainparams, anchors):
'''
Expand Down Expand Up @@ -2859,6 +2871,7 @@ def route_to_l1(src):


@pytest.mark.slow_test
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "frequently flakes")
def test_onchain_multihtlc_our_unilateral(node_factory, bitcoind):
"""Node pushes a channel onchain with multiple HTLCs with same payment_hash """
h, l1, l2, l3, l4, l5, l6, l7 = setup_multihtlc_test(node_factory, bitcoind)
Expand Down Expand Up @@ -2914,6 +2927,7 @@ def test_onchain_multihtlc_our_unilateral(node_factory, bitcoind):


@pytest.mark.slow_test
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "frequently flakes")
def test_onchain_multihtlc_their_unilateral(node_factory, bitcoind):
"""Node pushes a channel onchain with multiple HTLCs with same payment_hash """
h, l1, l2, l3, l4, l5, l6, l7 = setup_multihtlc_test(node_factory, bitcoind)
Expand Down Expand Up @@ -3077,6 +3091,7 @@ def test_permfail_htlc_out(node_factory, bitcoind, executor):
wait_for(lambda: l2.rpc.listpeers()['peers'] == [])


#@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "policy: can't withdraw to non-wallet address") # FIXME - should work with auto-approve
def test_permfail(node_factory, bitcoind):
l1, l2 = node_factory.line_graph(2)

Expand Down Expand Up @@ -3176,6 +3191,7 @@ def test_shutdown(node_factory):
l1.rpc.stop()


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "validate_setup_channel: holder_shutdown_script is not in wallet or allowlist")
def test_option_upfront_shutdown_script(node_factory, bitcoind, executor, chainparams):
l1 = node_factory.get_node(start=False, allow_warning=True)
# Insist on upfront script we're not going to match.
Expand Down
14 changes: 14 additions & 0 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,7 @@ def test_v2_open(node_factory, bitcoind, chainparams):
result = l1.rpc.waitsendpay(p['payment_hash'])
assert(result['status'] == 'complete')


# policy failed: policy-onchain-no-channel-push validate_onchain_tx: channel push not allowed: dual-funding not supported yet
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_SKIP_SPLICE_TESTS') == '1', "test expected to fail before VLS dual-funding / splicing support")
@pytest.mark.openchannel('v1')
Expand Down Expand Up @@ -1643,6 +1644,7 @@ def test_funding_v2_cancel_race(node_factory, bitcoind, executor):
executor.map(lambda n: n.stop(), node_factory.nodes)


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "validate_setup_channel: holder_shutdown_script is not in wallet or allowlist")
@pytest.mark.openchannel('v1')
@pytest.mark.openchannel('v2')
@unittest.skipIf(TEST_NETWORK != 'regtest', "External wallet support doesn't work with elements yet.")
Expand Down Expand Up @@ -1793,6 +1795,7 @@ def test_funding_external_wallet(node_factory, bitcoind):

@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
@pytest.mark.openchannel('v1') # We manually turn on dual-funding for select nodes
#@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "commit c0cc285a causes: channel stub can only return point for commitment number zero")
def test_multifunding_v1_v2_mixed(node_factory, bitcoind):
'''
Simple test for multifundchannel, using v1 + v2
Expand Down Expand Up @@ -2055,6 +2058,7 @@ def test_multifunding_wumbo(node_factory):
l1.rpc.multifundchannel(destinations)


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "flakes too frequently w/ VLS")
@unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "Fees on elements are different")
@pytest.mark.openchannel('v1') # v2 the weight calculation is off by 3
@pytest.mark.parametrize("anchors", [False, True])
Expand Down Expand Up @@ -2448,6 +2452,7 @@ def test_update_fee(node_factory, bitcoind):
l2.daemon.wait_for_log('onchaind complete, forgetting peer')


@pytest.mark.developer
def test_fee_limits(node_factory, bitcoind):
l1, l2, l3, l4 = node_factory.get_nodes(4, opts=[{'dev-max-fee-multiplier': 5, 'may_reconnect': True,
'allow_warning': True},
Expand Down Expand Up @@ -3581,6 +3586,9 @@ def test_channel_features(node_factory, bitcoind, anchors):
assert only_one(l2.rpc.listpeerchannels()['channels'])['features'] == chan['features']


# Still fails w/ VLS_PERMISSIVE with "recomposed tx mismatch"
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "Legacy channel type not supported")
@pytest.mark.developer("need dev-force-features")
def test_nonstatic_channel(node_factory, bitcoind):
"""Smoke test for a channel without option_static_remotekey"""
l1, l2 = node_factory.line_graph(2,
Expand Down Expand Up @@ -3696,6 +3704,8 @@ def test_openchannel_init_alternate(node_factory, executor):
print("nothing to do")


# Still fails w/ VLS_PERMISSIVE with "recomposed tx mismatch"
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "Legacy channel type not supported")
def test_upgrade_statickey(node_factory, executor):
"""l1 doesn't have option_static_remotekey, l2 offers it."""
l1, l2 = node_factory.line_graph(2, opts=[{'may_reconnect': True,
Expand Down Expand Up @@ -3726,6 +3736,8 @@ def test_upgrade_statickey(node_factory, executor):
l2.daemon.wait_for_log(r"They sent desired_channel_type \[12\]")


# Still fails w/ VLS_PERMISSIVE with "recomposed tx mismatch"
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "Legacy channel type not supported")
def test_upgrade_statickey_onchaind(node_factory, executor, bitcoind):
"""We test penalty before/after, and unilateral before/after"""
l1, l2 = node_factory.line_graph(2, opts=[{'may_reconnect': True,
Expand Down Expand Up @@ -3860,6 +3872,8 @@ def test_upgrade_statickey_onchaind(node_factory, executor, bitcoind):
wait_for(lambda: len(l2.rpc.listpeerchannels()['channels']) == 0)


# Still fails w/ VLS_PERMISSIVE with "recomposed tx mismatch"
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "Legacy channel type not supported")
def test_upgrade_statickey_fail(node_factory, executor, bitcoind):
"""We reconnect at all points during retransmit, and we won't upgrade."""
l1_disconnects = ['-WIRE_COMMITMENT_SIGNED',
Expand Down
6 changes: 6 additions & 0 deletions tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def test_max_channel_id(node_factory, bitcoind):
@unittest.skipIf(not COMPAT, "needs COMPAT to convert obsolete db")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
@unittest.skipIf(TEST_NETWORK != 'regtest', "The network must match the DB snapshot")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd doesn't like channel_nonce changing")
def test_scid_upgrade(node_factory, bitcoind):
bitcoind.generate_block(1)

Expand Down Expand Up @@ -167,6 +168,7 @@ def test_scid_upgrade(node_factory, bitcoind):
@unittest.skipIf(not COMPAT, "needs COMPAT to convert obsolete db")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
@unittest.skipIf(TEST_NETWORK != 'regtest', "The network must match the DB snapshot")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd doesn't like channel_nonce changing")
def test_last_tx_inflight_psbt_upgrade(node_factory, bitcoind):
bitcoind.generate_block(12)

Expand All @@ -185,6 +187,7 @@ def test_last_tx_inflight_psbt_upgrade(node_factory, bitcoind):
@unittest.skipIf(not COMPAT, "needs COMPAT to convert obsolete db")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
@unittest.skipIf(TEST_NETWORK != 'regtest', "The network must match the DB snapshot")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd doesn't like channel_nonce changing")
def test_last_tx_psbt_upgrade(node_factory, bitcoind):
bitcoind.generate_block(12)

Expand Down Expand Up @@ -219,6 +222,7 @@ def test_last_tx_psbt_upgrade(node_factory, bitcoind):
@pytest.mark.slow_test
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
@unittest.skipIf(TEST_NETWORK != 'regtest', "The network must match the DB snapshot")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd doesn't support backfill yet")
def test_backfill_scriptpubkeys(node_factory, bitcoind):
bitcoind.generate_block(214)

Expand Down Expand Up @@ -352,6 +356,7 @@ def get_dsn(self):
os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3',
"This test is based on a sqlite3 snapshot"
)
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd doesn't support DB migration")
def test_local_basepoints_cache(bitcoind, node_factory):
"""XXX started caching the local basepoints as well as the remote ones.
Expand Down Expand Up @@ -440,6 +445,7 @@ def test_sqlite3_builtin_backup(bitcoind, node_factory):


@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Don't know how to swap dbs in Postgres")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "vlsd chokes on allowlist when started on wrong network")
def test_db_sanity_checks(bitcoind, node_factory):
l1, l2 = node_factory.get_nodes(2, opts=[{'allow_broken_log': True,
'may_fail': True}, {}])
Expand Down
1 change: 1 addition & 0 deletions tests/test_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def test_announce_dns_suppressed(node_factory, bitcoind):
assert addresses[0]['port'] == 1236


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "trouble with IPv6 in VLS CI runner")
def test_announce_and_connect_via_dns(node_factory, bitcoind):
""" Test that DNS annoucements propagate and can be used when connecting.
Expand Down
2 changes: 2 additions & 0 deletions tests/test_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def test_invoice_weirdstring(node_factory):
l1.rpc.delinvoice(weird_label, "unpaid")


# Can't be filtered with VLS_PERMISSIVE, re-using preimage corrupts internal data ...
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "already have a different invoice for same secret")
def test_invoice_preimage(node_factory):
"""Test explicit invoice 'preimage'.
"""
Expand Down
6 changes: 6 additions & 0 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,7 @@ def test_cli_commando(node_factory):
assert only_one(j['invoices'])['label'] == 'l"[]{}'


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd integration test job control fails here")
def test_daemon_option(node_factory):
"""
Make sure --daemon at least vaguely works!
Expand Down Expand Up @@ -2173,6 +2174,7 @@ def test_bitcoind_feerate_floor(node_factory, bitcoind, anchors):


@unittest.skipIf(TEST_NETWORK != 'regtest', "Addresses are network specific")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd doesn't support forced secrets")
def test_dev_force_bip32_seed(node_factory):
l1 = node_factory.get_node(options={'dev-force-bip32-seed': '0000000000000000000000000000000000000000000000000000000000000001'})
# First is m/0/0/1 ..
Expand Down Expand Up @@ -2511,6 +2513,7 @@ def test_regtest_upgrade(node_factory):

@unittest.skipIf(VALGRIND, "valgrind files can't be written since we rmdir")
@unittest.skipIf(TEST_NETWORK != "regtest", "needs bitcoin mainnet")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd doesn't create hsm_secret file")
def test_new_node_is_mainnet(node_factory):
"""Test that an empty directory causes us to be on mainnet"""
l1 = node_factory.get_node(start=False, may_fail=True)
Expand Down Expand Up @@ -2674,6 +2677,7 @@ def test_sendcustommsg(node_factory):
])


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd doesn't support dev-force-privkey")
def test_makesecret(node_factory):
"""
Test makesecret command.
Expand Down Expand Up @@ -2711,6 +2715,7 @@ def test_staticbackup(node_factory):
and l1.rpc.staticbackup()["scb"][0][16: 16 + 64] == _["channel_id"])


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd says no such channel")
def test_recoverchannel(node_factory):
"""
Test recoverchannel
Expand Down Expand Up @@ -3744,6 +3749,7 @@ def test_setconfig(node_factory, bitcoind):
assert len(lines) == 3


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "remote_hsmd doesn't support this command")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "deletes database, which is assumed sqlite3")
def test_recover_command(node_factory, bitcoind):
l1, l2 = node_factory.get_nodes(2)
Expand Down
Loading

0 comments on commit 6c66ec8

Please sign in to comment.