diff options
Diffstat (limited to 'src/testing/test_merchant_instance_creation.sh')
-rwxr-xr-x | src/testing/test_merchant_instance_creation.sh | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/testing/test_merchant_instance_creation.sh b/src/testing/test_merchant_instance_creation.sh index 1fc65ff5..ed868b96 100755 --- a/src/testing/test_merchant_instance_creation.sh +++ b/src/testing/test_merchant_instance_creation.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,7 +17,10 @@ # <http://www.gnu.org/licenses/> # -. initialize_taler_system.sh +. setup.sh + +# Launch only the merchant. +setup -c test_template.conf -m echo -n "Configuring a merchant instance before configuring the default instance ..." @@ -29,7 +32,7 @@ STATUS=$(curl -H "Content-Type: application/json" -X POST \ if [ "$STATUS" != "204" ] then - echo 'should respond ok, instance created. got:' $STATUS + echo "Expected 204, instance created. got: $STATUS" exit 1 fi @@ -43,9 +46,9 @@ STATUS=$(curl -H "Content-Type: application/json" -X POST \ -d '{"auth":{"method":"external"},"accounts":[{"payto_uri":"payto://x-taler-bank/localhost/43"}],"id":"default","name":"default","user_type":"business","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}}' \ -w "%{http_code}" -s -o /dev/null) -if [ "$STATUS" != "204" ] +if [ "$STATUS" != "401" ] then - echo 'should respond ok, instance created. got:' $STATUS + echo "Expected 401, permission denied. got: $STATUS" exit 1 fi @@ -58,13 +61,12 @@ STATUS=$(curl -H "Content-Type: application/json" -X POST \ -d '{"auth":{"method":"token","token":"secret-token:other_secret"},"accounts":[{"payto_uri":"payto://x-taler-bank/localhost/43"}],"id":"second","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}}' \ -w "%{http_code}" -s -o /dev/null) -if [ "$STATUS" != "204" ] +if [ "$STATUS" != "401" ] then - echo 'should respond ok, instance created. got:' $STATUS + echo "Expected 401, permission denied. got: $STATUS" exit 1 fi echo " OK" - exit 0 |