commit b4697925f1bff4f735345de153a51b20a2288389
parent 5ab6a385f191a85eef24076ecc6a307665598f19
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 11 May 2021 17:34:02 +0200
Merge branch 'master' of git+ssh://git.taler.net/merchant
Diffstat:
1 file changed, 45 insertions(+), 0 deletions(-)
diff --git a/src/testing/test_merchant_order_creation.sh b/src/testing/test_merchant_order_creation.sh
@@ -269,6 +269,51 @@ then
exit_fail "Expected response ok, after providing transfer data. got: $STATUS"
fi
+
+STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \
+ -d '{"credit_amount":"'$CREDIT_AMOUNT'","wtid":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","payto_uri":"'$TARGET_PAYTO'","exchange_url":"'$WURL'"}' \
+ -w "%{http_code}" -s -o $LAST_RESPONSE)
+
+jq . < $LAST_RESPONSE
+
+if [ "$STATUS" != "502" ]
+then
+ echo `cat $LAST_RESPONSE`
+ exit_fail "Expected response invalid since the WTID is fake. got: $STATUS"
+fi
+
+STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \
+ -w "%{http_code}" -s -o $LAST_RESPONSE)
+
+jq . < $LAST_RESPONSE
+
+if [ "$STATUS" != "200" ]
+then
+ echo `cat $LAST_RESPONSE`
+ exit_fail "Expected response ok. got: $STATUS"
+fi
+
+TRANSFERS_LIST_SIZE=`jq -r '.transfers | length' < $LAST_RESPONSE`
+
+if [ "$TRANSFERS_LIST_SIZE" != "2" ]
+then
+ echo `cat $LAST_RESPONSE`
+ exit_fail "Expected response ok. got: $STATUS"
+fi
+
+#this will triger the GNUNET_break at taler-merchant-httpd_private-post-transfers.c:1030
+STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \
+ -d '{"credit_amount":"'$CREDIT_AMOUNT'","wtid":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","payto_uri":"'$TARGET_PAYTO'","exchange_url":"'$WURL'"}' \
+ -w "%{http_code}" -s -o $LAST_RESPONSE)
+
+jq . < $LAST_RESPONSE
+
+if [ "$STATUS" != "502" ]
+then
+ echo `cat $LAST_RESPONSE`
+ exit_fail "Expected response invalid since the WTID is fake. got: $STATUS"
+fi
+
echo " OK"
echo -n "Checking order status ..."