diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-01-12 17:13:21 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-01-12 17:13:21 +0100 |
commit | 1037add35d361c5b0bf60041496f8d2a23bd1722 (patch) | |
tree | 562f7b4b0645847140ce9fb20781bb90a17b526e /src | |
parent | fbc9aadace3d65d02bdd0dce608b0af3b9aab863 (diff) |
fix test by adding now required secret-token: prefix
Diffstat (limited to 'src')
-rwxr-xr-x | src/testing/test_merchant_instance_auth.sh | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/testing/test_merchant_instance_auth.sh b/src/testing/test_merchant_instance_auth.sh index 7dec5de9..f4534b9a 100755 --- a/src/testing/test_merchant_instance_auth.sh +++ b/src/testing/test_merchant_instance_auth.sh @@ -17,6 +17,12 @@ # <http://www.gnu.org/licenses/> # +# Exit, with status code "skip" (no 'real' failure) +function exit_skip() { + echo $1 + exit 77 +} + . initialize_taler_system.sh @@ -39,7 +45,7 @@ echo " OK" kill $MERCHANT_HTTPD_PID wait $MERCHANT_HTTPD_PID -NEW_SECRET=different_value +NEW_SECRET=secret-token:different_value taler-merchant-httpd -a "${NEW_SECRET}" -c "${CONF}" -L DEBUG 2> taler-merchant-httpd.log & MERCHANT_HTTPD_PID=$! @@ -58,10 +64,15 @@ do break done +if [ "x$OK" != "x1" ] +then + exit_skip "Failed to start merchant backend" +fi + echo -n "Creating order to test auth is ok..." STATUS=$(curl -H "Content-Type: application/json" -X POST \ 'http://localhost:9966/instances/default/private/orders' \ - -H 'Authorization: Bearer secret-token:'$NEW_SECRET \ + -H 'Authorization: Bearer '$NEW_SECRET \ -d '{"order":{"amount":"TESTKUDOS:1","summary":"payme"}}' \ -w "%{http_code}" -s -o $LAST_RESPONSE) @@ -75,7 +86,7 @@ ORDER_ID=`jq -e -r .order_id < $LAST_RESPONSE` TOKEN=`jq -e -r .token < $LAST_RESPONSE` STATUS=$(curl "http://localhost:9966/instances/default/private/orders/${ORDER_ID}" \ - -H 'Authorization: Bearer secret-token:'$NEW_SECRET \ + -H 'Authorization: Bearer '$NEW_SECRET \ -w "%{http_code}" -s -o $LAST_RESPONSE) if [ "$STATUS" != "200" ] @@ -91,7 +102,7 @@ echo OK order $ORDER_ID with $TOKEN echo -n "Configuring 'second' instance ..." STATUS=$(curl -H "Content-Type: application/json" -X POST \ - -H 'Authorization: Bearer secret-token:'$NEW_SECRET \ + -H 'Authorization: Bearer '$NEW_SECRET \ http://localhost:9966/management/instances \ -d '{"auth":{"method":"token","token":"secret-token:second"},"payto_uris":["payto://x-taler-bank/localhost/43"],"id":"second","name":"second","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) @@ -107,7 +118,7 @@ echo "OK" echo -n "Updating 'second' instance token using the 'default' auth token..." STATUS=$(curl -H "Content-Type: application/json" -X POST \ - -H 'Authorization: Bearer secret-token:'$NEW_SECRET \ + -H 'Authorization: Bearer '$NEW_SECRET \ http://localhost:9966/management/instances/second/auth \ -d '{"method":"token","token":"secret-token:new_one"}' \ -w "%{http_code}" -s -o /dev/null) |