diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/cli/test_iban.sh | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/cli/test_iban.sh b/src/cli/test_iban.sh index a7695e5..d5bceda 100755 --- a/src/cli/test_iban.sh +++ b/src/cli/test_iban.sh @@ -2,6 +2,31 @@ set -eu +# Exit, with status code "skip" (no 'real' failure) +function exit_skip() { + echo " SKIP: $1" + exit 77 +} + +# Exit, with error message (hard failure) +function exit_fail() { + echo " FAIL: $1" + exit 1 +} + +# Cleanup to run whenever we exit +function cleanup() +{ + for n in `jobs -p` + do + kill $n 2> /dev/null || true + done + wait +} + +# Install cleanup handler (except for kill -9) +trap cleanup EXIT + # Script's guidelines: #* uses 'CURRENCY=TESTKUDOS' and uses $CURRENCY for all @@ -86,8 +111,6 @@ echo "Sandbox started." #libeufin-sandbox serve &> sandbox.log & #sandbox_pid=$! # -# FIXME: not always both services get killed. -trap "echo Terminating services.; kill $nexus_pid; kill $sandbox_pid" EXIT # #curl -s --retry 5 --retry-connrefused $NEXUS_URL > /dev/null #curl -s --retry 5 --retry-connrefused $SANDBOX_URL > /dev/null |