From 776be1370dbdfe9dc1f3c05c24036a72cfc9d505 Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Tue, 21 Sep 2021 21:37:33 +0100 Subject: [PATCH] Improve existing systests --- systest/.gitignore | 1 + systest/RUNALL | 9 +++++++ systest/set_bandwidth_params.sh | 47 ++++++++++++++++++++++----------- 3 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 systest/.gitignore create mode 100755 systest/RUNALL diff --git a/systest/.gitignore b/systest/.gitignore new file mode 100644 index 00000000..72d072be --- /dev/null +++ b/systest/.gitignore @@ -0,0 +1 @@ +/data.systest diff --git a/systest/RUNALL b/systest/RUNALL new file mode 100755 index 00000000..b53cb0a6 --- /dev/null +++ b/systest/RUNALL @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +for script in *.sh; do + ./$script; +done + +echo All systest passed. diff --git a/systest/set_bandwidth_params.sh b/systest/set_bandwidth_params.sh index 4c02291a..e6905c34 100755 --- a/systest/set_bandwidth_params.sh +++ b/systest/set_bandwidth_params.sh @@ -1,24 +1,40 @@ #!/bin/sh +set -e + +DATADIR=data.systest + +clean_data_dir() { + rm -f "$DATADIR"/log/log_*.log + rm -f "$DATADIR"/wallets.ldb* + rm -f "$DATADIR"/data.ldb* + rm -f "$DATADIR"/config-*.toml +} + +msg() { + : + #echo "$@" +} + # the caller should set the env var NANO_NODE_EXE to point to the nano_node executable -# if NANO_NODE_EXE is unser ot empty then "../../build/nano_node" is used +# if NANO_NODE_EXE is unset ot empty then "../../build/nano_node" is used NANO_NODE_EXE=${NANO_NODE_EXE:-../../build/nano_node} -mkdir -p data/log -rm data/log/log_*.log +mkdir -p "$DATADIR/log" +clean_data_dir # start nano_node and store its pid so we can later send it # the SIGHUP signal and so we can terminate it -echo start nano_node -$NANO_NODE_EXE --daemon --data_path data & +msg start nano_node +$NANO_NODE_EXE --daemon --data_path "$DATADIR" >/dev/null & pid=$! -echo pid=$pid +msg pid=$pid # wait for the node to start-up sleep 2 # set bandwidth params 42 and 43 in the config file -cat > data/config-node.toml < "$DATADIR/config-node.toml" < data/config-node.toml < "$DATADIR/config-node.toml" <