aboutsummaryrefslogtreecommitdiff
path: root/src/bank-lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-08-23 09:32:51 +0200
committerChristian Grothoff <christian@grothoff.org>2023-08-23 09:32:51 +0200
commitfc461d11a86bd33ca70259b85a4aa7d6875e12c9 (patch)
tree014fa96fe1d89431891e80e352ad3f81bf42084c /src/bank-lib
parent373d9df0d6c3448ae8d72071ba96f7e3f45b4272 (diff)
shellcheck fixes
Diffstat (limited to 'src/bank-lib')
-rwxr-xr-xsrc/bank-lib/test_bank.sh37
1 files changed, 27 insertions, 10 deletions
diff --git a/src/bank-lib/test_bank.sh b/src/bank-lib/test_bank.sh
index 7d72497ea..686f78dde 100755
--- a/src/bank-lib/test_bank.sh
+++ b/src/bank-lib/test_bank.sh
@@ -1,20 +1,20 @@
#!/bin/bash
# This file is in the public domain.
-
+# shellcheck disable=SC2317
set -eu
# Exit, with status code "skip" (no 'real' failure)
function exit_skip() {
- echo $1
+ echo "$1"
exit 77
}
# Cleanup to run whenever we exit
function cleanup()
{
- for n in `jobs -p`
+ for n in $(jobs -p)
do
- kill $n 2> /dev/null || true
+ kill "$n" 2> /dev/null || true
done
wait
}
@@ -24,21 +24,30 @@ trap cleanup EXIT
echo -n "Launching bank..."
-taler-fakebank-run -c test_bank.conf -L DEBUG &> bank.log &
+taler-fakebank-run \
+ -c test_bank.conf \
+ -L DEBUG &> bank.log &
# Wait for bank to be available (usually the slowest)
-for n in `seq 1 50`
+for n in $(seq 1 50)
do
echo -n "."
sleep 0.2
OK=0
# bank
- wget --tries=1 --timeout=1 http://localhost:8899/ -o /dev/null -O /dev/null >/dev/null || continue
+ wget \
+ --tries=1 \
+ --timeout=1 \
+ http://localhost:8899/ \
+ -o /dev/null \
+ -O /dev/null \
+ >/dev/null \
+ || continue
OK=1
break
done
-if [ 1 != $OK ]
+if [ 1 != "$OK" ]
then
exit_skip "Failed to launch services (bank)"
fi
@@ -56,7 +65,11 @@ echo " OK"
echo -n "Requesting exchange incoming transaction list ..."
-./taler-exchange-wire-gateway-client -b http://localhost:8899/exchange/ -i | grep TESTKUDOS:4 > /dev/null
+./taler-exchange-wire-gateway-client \
+ -b http://localhost:8899/exchange/ \
+ -i \
+ | grep TESTKUDOS:4 \
+ > /dev/null
echo " OK"
@@ -73,7 +86,11 @@ echo " OK"
echo -n "Requesting exchange's outgoing transaction list..."
-./taler-exchange-wire-gateway-client -b http://localhost:8899/exchange/ -o | grep TESTKUDOS:2 > /dev/null
+./taler-exchange-wire-gateway-client \
+ -b http://localhost:8899/exchange/ \
+ -o \
+ | grep TESTKUDOS:2 \
+ > /dev/null
echo " OK"