diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-05-11 17:34:02 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-05-11 17:34:02 +0200 |
commit | b4697925f1bff4f735345de153a51b20a2288389 (patch) | |
tree | 662166c6fd2805cd4194b2c235631d4dd6383470 | |
parent | 5ab6a385f191a85eef24076ecc6a307665598f19 (diff) | |
parent | 332630ca9d99edf69b0525dfe1e62137df346a11 (diff) | |
download | merchant-b4697925f1bff4f735345de153a51b20a2288389.tar.gz merchant-b4697925f1bff4f735345de153a51b20a2288389.tar.bz2 merchant-b4697925f1bff4f735345de153a51b20a2288389.zip |
Merge branch 'master' of git+ssh://git.taler.net/merchant
-rwxr-xr-x | src/testing/test_merchant_order_creation.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/testing/test_merchant_order_creation.sh b/src/testing/test_merchant_order_creation.sh index 13966879..5bc8c649 100755 --- 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 ..." |