From 99543152e9ddb1aab29d4e69dffb26c97d36040a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 22 Jun 2023 16:30:55 +0200 Subject: -clean up test scripts --- src/testing/test_merchant_instance_purge.sh | 40 +++++++++++++---------------- 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'src/testing/test_merchant_instance_purge.sh') 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 @@ # # -. 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 -- cgit v1.2.3