chantools/itest
2026-02-10 16:28:01 +01:00
..
docker itest: add integration test for forceclose command 2026-02-10 16:28:01 +01:00
bitcoind_harness.go itest: add Golang based integration tests 2025-10-10 12:52:41 +02:00
chantools_harness.go itest: add Golang based integration tests 2025-10-10 12:52:41 +02:00
cmd_forceclose_test.go itest: add integration test for forceclose command 2026-02-10 16:28:01 +01:00
cmd_scbforceclose_test.go itest: add integration test for scbforceclose 2025-11-06 15:24:46 +01:00
cmd_sweepremoteclosed_test.go itest: add Golang based integration tests 2025-10-10 12:52:41 +02:00
cmd_triggerforceclose_test.go itest: add Golang based integration tests 2025-10-10 12:52:41 +02:00
cmd_zombierecovery_test.go itest: add Golang based integration tests 2025-10-10 12:52:41 +02:00
helpers.go itest: add integration test for forceclose command 2026-02-10 16:28:01 +01:00
integration_test.go itest: add integration test for forceclose command 2026-02-10 16:28:01 +01:00
itest.sh make+itest: add docker-based itest setup script 2025-10-10 12:52:41 +02:00
log.go itest: add itest framework and basic tests 2025-07-14 10:35:06 +02:00
README.md itest: add integration test for forceclose command 2026-02-10 16:28:01 +01:00
standalone_test.go itest: add Golang based integration tests 2025-10-10 12:52:41 +02:00

Chantools Integration Test (itest)

This directory contains the integration test (itest) setup and test cases for chantools. The test network is created using Docker Compose scripts and consists of multiple Lightning Network nodes connected in a specific topology to create multiple channels with non-zero channel update indexes (by sending some payments around the network).

Test Network Topology

The network is set up as follows:

    Alice ◄──► Bob ◄──► Charlie ◄──► Dave*
       └───────►└──► Rusty ◄──┘
       |────► Nifty ◄──┘      |
       └► Snyke* ◄────────────┘
  • Channel Alice - Bob: Remains open, used by runZombieRecoveryLndLnd.
  • Channel Alice - Rusty: Is force closed by Alice, used by runSweepRemoteClosedCln.
  • Channel Alice - Nifty: Is force closed by Alice, used by runForceClose.
  • Channel Alice - Snyke: Remains open, used by runTriggerForceCloseCln.
  • Channel Bob - Charlie: Is force closed by Bob, used by runSweepRemoteClosedLnd.
  • Channel Charlie - Dave: Remains open, used by runTriggerForceCloseLnd.
  • Channel Charlie - Snyke: Remains open, used by runSCBForceClose.
  • Channel Bob - Rusty: Remains open, used by runZombieRecoveryLndCln.
  • Channel Rusty - Charlie: Remains open, used by runZombieRecoveryClnLnd.
  • Channel Rusty - Nifty: Remains open, used by runZombieRecoveryClnCln.
  • *: Node is kept running after initial test setup.

All nodes except for Dave and Snyke are stopped before the integration tests are run.

Multiple channels are opened between the nodes, and several multi-hop payments are executed to ensure the network is fully operational and synchronized. After the setup, each node's channel information is exported to a JSON file in the node-data/chantools/ directory.

Running the Integration Tests

To start the integration tests, run the following command from the project root:

make itest

Which executes the script itest/itest.sh.

This script will:

  • Build and start the Docker-based test network.
  • Set up the channels and perform payments between nodes.
  • Export channel data for each node.
  • Run the Go integration tests against the prepared network.

Debugging the Test Network

By default, the test network is torn down automatically after the tests finish or if an error occurs. If you want to keep the Docker containers running for debugging purposes, set the DEBUG environment variable before running the script:

make itest DEBUG=1

With DEBUG set, the containers will not be stopped automatically, allowing you to inspect the state of the network and containers for troubleshooting and run the Golang based integration tests manually several times.


For more details on the network setup, see docker/setup-test-network.sh.