d6348c009a
- introduced `test/utils/test_lib.inc.sh` to simplify usage of sandboxed node/client in the testsuite - it reuses code from `./script/{node,client}_lib.inc.sh` - use `wait_for_the_node_to_be_ready` to properly wait for the node to be launched rather to use a fexed delay - `test_multinode.sh` now launch 8 nodes.
28 lines
569 B
Bash
Executable File
28 lines
569 B
Bash
Executable File
#! /usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
|
|
src_dir="$(dirname "$script_dir")"
|
|
cd "$src_dir"
|
|
|
|
source $script_dir/node_lib.inc.sh
|
|
|
|
if [ $# -lt 1 ] || [ "$1" -le 0 ] || [ 10 -le "$1" ]; then
|
|
echo "Small script to launch local and closed test network with a maximum of 9 nodes."
|
|
echo
|
|
echo "Usage: $0 <id>"
|
|
echo " where <id> should be an integer between 1 and 9."
|
|
exit 1
|
|
fi
|
|
|
|
cleanup () {
|
|
set +e
|
|
echo Cleaning up...
|
|
cleanup_nodes
|
|
}
|
|
trap cleanup EXIT INT
|
|
|
|
start_sandboxed_node "$@"
|
|
wait $node_pids
|