From f1c1104ecc6f34e418a11f5ef52ae88e57a7a619 Mon Sep 17 00:00:00 2001 From: Ursula Date: Sat, 21 Dec 2024 22:26:01 +0200 Subject: [PATCH] fix: Improved Script Efficiency and Readability Signed-off-by: Ursula --- docker/test.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docker/test.sh b/docker/test.sh index 2cc49bdb2c3..a22d1b80a9c 100755 --- a/docker/test.sh +++ b/docker/test.sh @@ -15,6 +15,7 @@ ## export TEST_PATH=./tests +export architecture=$(uname -m) export GOSS_PATH=$TEST_PATH/goss-linux-${architecture} export GOSS_OPTS="$GOSS_OPTS --format junit" export GOSS_FILES_STRATEGY=cp @@ -26,9 +27,10 @@ i=0 ## Checks on the Dockerfile GOSS_FILES_PATH=$TEST_PATH/00 \ bash $TEST_PATH/dgoss dockerfile $DOCKER_IMAGE $DOCKER_FILE \ -> ./reports/00.xml || i=`expr $i + 1` +> ./reports/00.xml || ((i++)) + # fail fast if we dont pass static checks -if [[ $i != 0 ]]; then exit $i; fi +if ((i != 0)); then exit $i; fi # Test for normal startup with ports opened # we test that things listen on the right interface/port, not what interface the advertise @@ -39,14 +41,14 @@ bash $TEST_PATH/dgoss run --sysctl net.ipv6.conf.all.disable_ipv6=1 $DOCKER_IMAG --rpc-http-enabled \ --rpc-ws-enabled \ --graphql-http-enabled \ -> ./reports/01.xml || i=`expr $i + 1` +> ./reports/01.xml || ((i++)) -if [[ $i != 0 ]]; then exit $i; fi +if ((i != 0)); then exit $i; fi # Test for directory permissions GOSS_FILES_PATH=$TEST_PATH/02 \ bash $TEST_PATH/dgoss run --sysctl net.ipv6.conf.all.disable_ipv6=1 -v besu-data:/var/lib/besu $DOCKER_IMAGE --data-path=/var/lib/besu \ --network=dev \ -> ./reports/02.xml || i=`expr $i + 1` +> ./reports/02.xml || ((i++)) exit $i