aboutsummaryrefslogtreecommitdiff
path: root/integrationtests/common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'integrationtests/common.sh')
-rw-r--r--integrationtests/common.sh30
1 files changed, 21 insertions, 9 deletions
diff --git a/integrationtests/common.sh b/integrationtests/common.sh
index 8036b825b..57dc1a863 100644
--- a/integrationtests/common.sh
+++ b/integrationtests/common.sh
@@ -109,8 +109,7 @@ function wait_for_services() {
echo -n "."
sleep 0.2
OK=0
- # bank
- wget http://localhost:8082/ -o /dev/null -O /dev/null >/dev/null || continue
+ wget "$BANK_URL" -o /dev/null -O /dev/null >/dev/null || continue
OK=1
break
done
@@ -119,12 +118,9 @@ function wait_for_services() {
echo -n "."
sleep 0.1
OK=0
- # exchange
- wget http://localhost:8081/ -o /dev/null -O /dev/null >/dev/null || continue
- # merchant
- wget http://localhost:9966/ -o /dev/null -O /dev/null >/dev/null || continue
- # Auditor
- wget http://localhost:8083/ -o /dev/null -O /dev/null >/dev/null || continue
+ wget "$EXCHANGE_URL" -o /dev/null -O /dev/null >/dev/null || continue
+ wget "$MERCHANT_URL" -o /dev/null -O /dev/null >/dev/null || continue
+ wget "$AUDITOR_URL" -o /dev/null -O /dev/null >/dev/null || continue
OK=1
break
done
@@ -142,6 +138,17 @@ function normal_start_and_wait() {
wait_for_services
}
+# provide the service URL as first parameter
+function wait_for_service() {
+ for _ in $(seq 1 50); do
+ echo -n "."
+ sleep 0.1
+ wget "$1" -o /dev/null -O /dev/null >/dev/null || continue
+ echo " DONE"
+ break
+ done
+}
+
function shutdown_services() {
echo "Shutting down services"
jobs -p | xargs --no-run-if-empty kill || true
@@ -164,6 +171,11 @@ function exit_skip() {
}
function exit_error() {
- echo "Error: $1"
+ echo "\033[0;31mError: $1\033[0m"
exit 1
}
+
+function exit_success() {
+ echo -e "\033[0;32mSUCCESS \o/\033[0m"
+ exit 0
+}