summaryrefslogtreecommitdiff
path: root/src/testing/test_merchant_instance_purge.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-06-22 16:30:55 +0200
committerChristian Grothoff <christian@grothoff.org>2023-06-22 16:30:55 +0200
commit99543152e9ddb1aab29d4e69dffb26c97d36040a (patch)
treea15f35206bf35183e986add028e684d59f31c310 /src/testing/test_merchant_instance_purge.sh
parent52c49785fe20844a52f083de4adf9fea6e0c403d (diff)
downloadmerchant-99543152e9ddb1aab29d4e69dffb26c97d36040a.tar.gz
merchant-99543152e9ddb1aab29d4e69dffb26c97d36040a.tar.bz2
merchant-99543152e9ddb1aab29d4e69dffb26c97d36040a.zip
-clean up test scripts
Diffstat (limited to 'src/testing/test_merchant_instance_purge.sh')
-rwxr-xr-xsrc/testing/test_merchant_instance_purge.sh40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/testing/test_merchant_instance_purge.sh b/src/testing/test_merchant_instance_purge.sh
index 1c3fab2b..dfebbc84 100755
--- a/src/testing/test_merchant_instance_purge.sh
+++ b/src/testing/test_merchant_instance_purge.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# This file is part of TALER
-# Copyright (C) 2014-2021 Taler Systems SA
+# Copyright (C) 2014-2023 Taler Systems SA
#
# TALER is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
@@ -17,9 +17,12 @@
# <http://www.gnu.org/licenses/>
#
-. initialize_taler_system.sh
+. setup.sh
-echo -n "Configuring default instance ..."
+# Launch only the merchant.
+setup -c test_template.conf -m
+
+echo -n "Configuring default instance ..." >&2
STATUS=$(curl -H "Content-Type: application/json" -X POST \
-H 'Authorization: Bearer secret-token:super_secret' \
@@ -29,13 +32,12 @@ STATUS=$(curl -H "Content-Type: application/json" -X POST \
if [ "$STATUS" != "204" ]
then
- echo 'should respond ok, instance created. got:' $STATUS
- exit 1
+ exit_fail "Expected 204, instance created. got: $STATUS"
fi
-echo " OK"
+echo " OK" >&2
-echo -n "Configuring merchant instance ..."
+echo -n "Configuring merchant instance ..." >&2
STATUS=$(curl -H "Content-Type: application/json" -X POST \
http://localhost:9966/management/instances \
@@ -44,28 +46,22 @@ STATUS=$(curl -H "Content-Type: application/json" -X POST \
if [ "$STATUS" != "204" ]
then
- echo 'should respond ok, instance created. got:' $STATUS
- exit 1
+ exit_fail "Expected 204, instance created. got: $STATUS"
fi
+echo " OK" >&2
-echo " OK"
-
-
-echo -n "Deleting instance ..."
-
+echo -n "Deleting instance ..." >&2
STATUS=$(curl -H "Content-Type: application/json" -X DELETE \
"http://localhost:9966/management/instances/test" \
-w "%{http_code}" -s -o /dev/null)
-
if [ "$STATUS" != "204" ]
then
- echo 'should respond ok, instance deleted. got:' $STATUS
- exit 1
+ exit_fail "Expected 204, instance deleted. got: $STATUS"
fi
-echo " OK"
-echo -n "Purging instance ..."
+echo " OK" >&2
+echo -n "Purging instance ..." >&2
STATUS=$(curl -H "Content-Type: application/json" -X DELETE \
"http://localhost:9966/management/instances/test?purge=yes" \
@@ -74,10 +70,10 @@ STATUS=$(curl -H "Content-Type: application/json" -X DELETE \
if [ "$STATUS" != "204" ]
then
- echo 'should respond ok, instance deleted. got:' $STATUS
- exit 1
+ exit_fail "Expected 204, instance deleted. got: $STATUS"
fi
-echo " OK"
+echo " OK" >&2
+echo "Test PASSED"
exit 0