diff options
Diffstat (limited to 'src/testing/test_merchant_instance_purge.sh')
-rwxr-xr-x | src/testing/test_merchant_instance_purge.sh | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/src/testing/test_merchant_instance_purge.sh b/src/testing/test_merchant_instance_purge.sh index 60467385..f3992495 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,55 +17,51 @@ # <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' \ http://localhost:9966/management/instances \ - -d '{"auth":{"method":"external"},"payto_uris":["payto://x-taler-bank/localhost/43"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ + -d '{"auth":{"method":"external"},"id":"default","name":"default","user_type":"business","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ -w "%{http_code}" -s -o /dev/null) 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 \ - -d '{"auth":{"method":"token","token":"secret-token:other_secret"},"payto_uris":["payto://x-taler-bank/localhost/43"],"id":"test","name":"test","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ + -d '{"auth":{"method":"token","token":"secret-token:other_secret"},"id":"test","name":"test","address":{},"jurisdiction":{},"use_stefan":true,"default_wire_transfer_delay":{"d_us" : 3600000000},"default_pay_delay":{"d_us": 3600000000}}' \ -w "%{http_code}" -s -o /dev/null) 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 |