diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-08-28 18:01:50 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-08-28 18:01:50 +0200 |
commit | d089c31e5e5dcab03c6988d87c61c839e447b05b (patch) | |
tree | 00763ee455f8797ffe938b804e606458ee903992 /src/auditor/generate-auditor-basedb.sh | |
parent | 52b5428e3e72474da69737be5c92327890430eee (diff) |
fix test logic: initialize $WALLET_DB and fix cleanup logic of generate-auditor-basedb.sh
Diffstat (limited to 'src/auditor/generate-auditor-basedb.sh')
-rwxr-xr-x | src/auditor/generate-auditor-basedb.sh | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/auditor/generate-auditor-basedb.sh b/src/auditor/generate-auditor-basedb.sh index 5b4f21fe9..8678c6ca6 100755 --- a/src/auditor/generate-auditor-basedb.sh +++ b/src/auditor/generate-auditor-basedb.sh @@ -15,8 +15,19 @@ # set -eu +# 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 -trap "kill `jobs -p` &> /dev/null || true" ERR # Exit, with status code "skip" (no 'real' failure) function exit_skip() { @@ -32,6 +43,8 @@ BASEDB=${1:-"auditor-basedb"} # elsewhere TARGET_DB=taler-auditor-basedb +WALLET_DB=${BASEDB:-"wallet"}.wdb + # Configuration file will be edited, so we create one # from the template. CONF=generate-auditor-basedb-prod.conf @@ -122,8 +135,6 @@ done if [ 1 != $OK ] then - kill `jobs -p` - wait exit_skip "Failed to launch services" fi echo " DONE" @@ -148,8 +159,7 @@ taler-wallet-cli --no-throttle --wallet-db=$WALLET_DB api 'runIntegrationTest' \ echo "Shutting down services" -kill `jobs -p` -wait +cleanup # Dump database echo "Dumping database" |