mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
scripts/bw-compatibility-test: add backwards compat test
In this commit, a new backwards compatibility test is added. See the added README.md file in this commit for all the info.
This commit is contained in:
53
scripts/bw-compatibility-test/test.sh
Executable file
53
scripts/bw-compatibility-test/test.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Stop the script if an error is returned by any step.
|
||||
set -e
|
||||
|
||||
# DIR is set to the directory of this script.
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
source "$DIR/compose.sh"
|
||||
source "$DIR/network.sh"
|
||||
source "$DIR/.env"
|
||||
|
||||
cd $DIR
|
||||
|
||||
# Spin up the network in detached mode.
|
||||
compose_up
|
||||
|
||||
# Ensure that the cluster is shut down when the script exits
|
||||
# regardless of success
|
||||
trap compose_down EXIT
|
||||
|
||||
# Set up the network.
|
||||
setup_network
|
||||
|
||||
# Print the initial version of each node.
|
||||
do_for print_version alice bob charlie dave
|
||||
|
||||
# Test that Bob can send a multi-hop payment.
|
||||
send_payment bob dave
|
||||
|
||||
# Test that Bob can receive a multi-hop payment.
|
||||
send_payment dave bob
|
||||
|
||||
# Test that Bob can route a payment.
|
||||
send_payment alice dave
|
||||
|
||||
# Upgrade the compose variables so that the Bob configuration
|
||||
# is swapped out for the PR version.
|
||||
upgrade_bob
|
||||
|
||||
# Wait for Bob to start.
|
||||
wait_for_node bob
|
||||
wait_for_active_chans bob 2
|
||||
|
||||
# Show that Bob is now running the current branch.
|
||||
do_for print_version bob
|
||||
|
||||
# Repeat the basic tests.
|
||||
send_payment bob dave
|
||||
send_payment dave bob
|
||||
send_payment alice dave
|
||||
|
||||
echo "🛡️⚔️🫡 Backwards compatibility test passed! 🫡⚔️🛡️"
|
Reference in New Issue
Block a user