Carla Kirk-Cohen 6e3a46ee91 itest: add more comprehensive assertions before HTLC cleared check 3 weeks ago
..
README.md 1f636ad275 itest: add readme 1 year ago
list_off_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
list_on_test.go 75d4a4c295 itest: add coverage for blinded error resolution from on-chain failure 3 weeks ago
lnd_amp_test.go e8031fdccf lnrpc: ensure parsing of the Amp flag for payments is consistent 3 weeks ago
lnd_channel_backup_test.go ab83343c87 multi: repleace ioutil.ReadFile 3 weeks ago
lnd_channel_balance_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
lnd_channel_force_close_test.go d854c80aa7 itest+lntest: fix itest re the new sweeping behavior 1 month ago
lnd_channel_funding_fund_max_test.go 519a8749ef lntest: reflect the updated fee estimator in tests 1 month ago
lnd_channel_funding_utxo_selection_test.go 351e9a68dd multi: Add tests to psbt and normal open channel flow. 3 weeks ago
lnd_channel_graph_test.go e41c65785f multi: update node announcement features in feature manager first 1 year ago
lnd_channel_policy_test.go d5af76cb29 itest+lntest: add a dedicated timeout for sending payments 1 year ago
lnd_coop_close_with_htlcs_test.go 519a8749ef lntest: reflect the updated fee estimator in tests 1 month ago
lnd_custom_features.go 019da315a8 itest: add coverage for custom features 1 year ago
lnd_custom_message_test.go ebf11bc2f1 itest: move lnd_custom_{message => message_test}.go 1 year ago
lnd_estimate_route_fee_test.go e79b8b2986 itest: estimate route fee tests 2 months ago
lnd_etcd_failover_test.go 9cd7285439 itest+lntest: use system wide unique ports everywhere 2 months ago
lnd_forward_interceptor_test.go 8288d3da8e itest: add missing topology check in tests 1 year ago
lnd_funding_test.go 351e9a68dd multi: Add tests to psbt and normal open channel flow. 3 weeks ago
lnd_hold_invoice_force_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
lnd_hold_persistence_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
lnd_htlc_test.go 20e53e85b4 itest+lntest: make sure states are cleaned when tests end 1 year ago
lnd_macaroons_test.go 9287b755d8 macaroons: reject unknown macaroon versions 6 months ago
lnd_max_channel_size_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
lnd_max_htlcs_test.go 816a70e08c multi: add new config `usestatusinitiated` for the new payment status 6 months ago
lnd_misc_test.go d0441a2a29 multi: add default conf targt in SendCoins/SendMany/OpenChannel/CloseChannel 3 weeks ago
lnd_mpp_test.go 64740e18cb itest: fix ascii 3 weeks ago
lnd_multi-hop-error-propagation_test.go a1678fa9b7 itest: multi part payments test fix. 4 months ago
lnd_multi-hop-payments_test.go 0bae781785 routing: add inbound fee support to pathfinding 1 month ago
lnd_multi-hop_test.go d854c80aa7 itest+lntest: fix itest re the new sweeping behavior 1 month ago
lnd_network_test.go 9cd7285439 itest+lntest: use system wide unique ports everywhere 2 months ago
lnd_neutrino_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
lnd_no_etcd_dummy_failover_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
lnd_nonstd_sweep_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
lnd_onchain_test.go d854c80aa7 itest+lntest: fix itest re the new sweeping behavior 1 month ago
lnd_open_channel_test.go 6f5b7a9fd3 lntest+itest: fix `testOpenChannelLockedBalance` 1 month ago
lnd_payment_test.go 221e7ff898 itest: update `testListPayments` to precisely test timestamp filters 3 months ago
lnd_psbt_test.go 9f9d1c9e0b itest: fix typo. 3 weeks ago
lnd_recovery_test.go 519a8749ef lntest: reflect the updated fee estimator in tests 1 month ago
lnd_remote_signer_test.go 6f55a7af05 itest: add new test to check `BumpFee` and `PendingSweeps` 1 month ago
lnd_res_handoff_test.go 56dba2df03 multi: update linter, fix new issues 11 months ago
lnd_rest_api_test.go f9436ec05d mod+cmd/lncli: use google.golang.org/protobuf package 1 year ago
lnd_revocation_test.go 9c34eb7a56 itest: fix revocation itest 1 month ago
lnd_route_blinding_test.go 6e3a46ee91 itest: add more comprehensive assertions before HTLC cleared check 3 weeks ago
lnd_routing_test.go 07277172f8 itest+lntest: remove temporary hacks around broken coop close in itests 3 months ago
lnd_rpc_middleware_interceptor_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
lnd_send_multi_path_payment_test.go ef069b658d itest: preparatory fee estimation changes 2 months ago
lnd_signer_test.go 519a8749ef lntest: reflect the updated fee estimator in tests 1 month ago
lnd_single_hop_invoice_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
lnd_sweep_test.go d854c80aa7 itest+lntest: fix itest re the new sweeping behavior 1 month ago
lnd_switch_test.go 0b64ba94c0 itest: cleanup channels for `testSwitchOfflineDeliveryOutgoingOffline` 1 year ago
lnd_taproot_test.go 519a8749ef lntest: reflect the updated fee estimator in tests 1 month ago
lnd_test.go 9cd7285439 itest+lntest: use system wide unique ports everywhere 2 months ago
lnd_trackpayments_test.go 99354313d5 routerrpc+itest: make sure `TrackPayments` is compatible 6 months ago
lnd_wallet_import_test.go 07277172f8 itest+lntest: remove temporary hacks around broken coop close in itests 3 months ago
lnd_watchtower_test.go 563a5caed5 itest: fix watchtower test 1 month ago
lnd_wipe_fwdpkgs_test.go 521b1fc34a itest+lntest: fix itest re the new block driven behavior 1 month ago
lnd_wumbo_channels_test.go 9d1d629001 itest+lntest: migrate `lntemp` to `lntest` 1 year ago
lnd_zero_conf_test.go 07277172f8 itest+lntest: remove temporary hacks around broken coop close in itests 3 months ago
log_check_errors.sh 0bc86a3b4b multi: move `itest` out of `lntest` 1 year ago
log_substitutions.txt d7f578b0d9 lntest/itest: adds tests for `fundmax` flag of cli:openchannel 1 year ago

README.md

Integration Test

itest is a package that houses the integration tests made for lnd. This package builds test cases using the test framework lntest.

Add New Tests

To add a new test case, create a TestFunc and add it in list_on_test.go. Ideally, the Name should just be the snake case of the name used in TestFunc without the leading test and underscores. For instance, to test lnd's exporting channel backup, we have,

{
		Name:     "export channel backup",
		TestFunc: testExportChannelBackup,
}

The place to put the code of the TestFunc is case-specific. itest package has loosely defined a list of files to test different functionalities of lnd. The new test needs to be put into one of these files, otherwise, a new file needs to be created.

Run Tests

Run a single test case

To run a single test case, use make itest icase=$case, where case is the name defined in list_on_test.go, with spaces replaced with underscores(_).

# Run `testListChannels`.
make itest icase=list_channels

Run multiple test cases

There are two ways to run multiple test cases. One way is to use make itest icase=$cases, where cases has the format cases='(case|case|...)'. The case is the name defined in list_on_test.go, with spaces replaced with underscores(_).

# Run `testListChannels` and `testListAddresses` together.
make itest icase='(list_channels|list_addresses)'

Another way to run multiple cases is similar to how Go runs its tests - by simple regex matching. For instance, the following command will run three cases since they all start with the word list,

# Run `testListChannels`, `testListAddresses`, and `testListPayments` together.
make itest icase=list

Run all tests

To run all tests, use make itest without icase flag.

# Run all test cases.
make itest

Run tests in parallel

To run tests in parallel, use make itest-parallel. This command takes two special arguments,

  • tranches, specifies the number of parts the test cases will be split into.
  • parallel, specifies the number of threads to run in parallel. This value must be smaller than or equal to tranches.
# Split the tests into 4 parts, and run them using 2 threads.
make itest-parallel tranches=4 parallel=2

By default, itest-parallel splits the tests into 4 parts and uses 4 threads to run each of them.

Additional arguments

For both make itest and make itest-parallel, the following arguments are allowed,

  • timeout, specifies the timeout value used in testing.
  • dbbackend, specifies the database backend. Must be bbolt, etcd, or postgres, default to bbolt.
  • backend, specifies the chain backend to be used. Must be one of,
    • btcd, the default value.
    • neutrino
    • bitcoind
    • bitcoind notxindex
    • bitcoind rpcpolling
# Run a single test case using bitcoind as the chain backend and etcd as the
# database backend, with a timeout of 5 minutes.
make itest icase=list_channels backend=bitcoind dbbackend=etcd timeout=5m

# Run all test cases in parallel, using bitcoind notxindex as the chain backend
# and etcd as the database backend, with a timeout of 60 minutes for each
# parallel.
make itest-parallel backend="bitcoind notxindex" dbbackend=etcd timeout=60m