summaryrefslogtreecommitdiff
path: root/src/testing/test_merchant_instance_auth.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/test_merchant_instance_auth.sh')
-rwxr-xr-xsrc/testing/test_merchant_instance_auth.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/testing/test_merchant_instance_auth.sh b/src/testing/test_merchant_instance_auth.sh
index 4ba4fc0e..b918352b 100755
--- a/src/testing/test_merchant_instance_auth.sh
+++ b/src/testing/test_merchant_instance_auth.sh
@@ -37,19 +37,20 @@ echo " OK"
kill $MERCHANT_HTTPD_PID
+wait $MERCHANT_HTTPD_PID
NEW_SECRET=different_value
-taler-merchant-httpd -a $NEW_SECRET -c $CONF -L DEBUG 2> taler-merchant-httpd.log &
+taler-merchant-httpd -a "${NEW_SECRET}" -c "${CONF}" -L DEBUG 2> taler-merchant-httpd.log &
MERCHANT_HTTPD_PID=$!
#taler-merchant-httpd -c $CONF -L DEBUG 2> taler-merchant-httpd.log &
echo -n "Waiting for the merchant..."
# Wait for merchant to be available (usually the slowest)
-for n in `seq 1 5`
+for n in `seq 1 50`
do
echo -n "."
- sleep 1
+ sleep 0.1
OK=0
# merchant
wget --waitretry=0 --timeout=1 http://localhost:9966/ -o /dev/null -O /dev/null >/dev/null || continue
@@ -61,12 +62,12 @@ echo -n "Creating order to test auth is ok..."
STATUS=$(curl -v -H "Content-Type: application/json" -X POST \
'http://localhost:9966/instances/default/private/orders' \
-H 'Authorization: Bearer secret-token:'$NEW_SECRET \
- -d '{"order":{"amount":"TESTKUDOS:1","summary":"payme"},"inventory_products":[{"product_id":"2","quantity":1}]}' \
+ -d '{"order":{"amount":"TESTKUDOS:1","summary":"payme"}}' \
-w "%{http_code}" -s -o $LAST_RESPONSE)
if [ "$STATUS" != "200" ]
then
- echo 'should response ok, order created. got:' $STATUS #`cat $LAST_RESPONSE`
+ echo 'should response ok, order created. got:' $STATUS `cat $LAST_RESPONSE`
exit 1
fi
@@ -74,7 +75,8 @@ 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}" \
- -w "%{http_code}" -s -o $LAST_RESPONSE)
+ -H 'Authorization: Bearer secret-token:'$NEW_SECRET \
+ -w "%{http_code}" -s -o $LAST_RESPONSE)
if [ "$STATUS" != "200" ]
then