summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2021-09-02 17:31:25 -0300
committerSebastian <sebasjm@gmail.com>2021-09-02 17:31:25 -0300
commitbe1b6bd6f0fe257d248afca3e6cc2b1d3f753bf0 (patch)
tree9bad3097f604bfa767ac19fc988126975f31ae5f
parentd1a2ee8dcf991e02f1d89496fe1f84240907cc53 (diff)
downloadmerchant-be1b6bd6f0fe257d248afca3e6cc2b1d3f753bf0.tar.gz
merchant-be1b6bd6f0fe257d248afca3e6cc2b1d3f753bf0.tar.bz2
merchant-be1b6bd6f0fe257d248afca3e6cc2b1d3f753bf0.zip
correct test for issue #6912
-rwxr-xr-xsrc/testing/initialize_taler_system.sh2
-rwxr-xr-xsrc/testing/test_merchant_transfer_tracking.sh65
2 files changed, 63 insertions, 4 deletions
diff --git a/src/testing/initialize_taler_system.sh b/src/testing/initialize_taler_system.sh
index 55cad2a9..f17ec2b5 100755
--- a/src/testing/initialize_taler_system.sh
+++ b/src/testing/initialize_taler_system.sh
@@ -140,7 +140,7 @@ echo " OK"
echo -n "Waiting for the bank"
# Wait for bank to be available (usually the slowest)
-for n in `seq 1 10`
+for n in `seq 1 30`
do
echo -n "."
sleep 1
diff --git a/src/testing/test_merchant_transfer_tracking.sh b/src/testing/test_merchant_transfer_tracking.sh
index 764e3d71..5a2a29e0 100755
--- a/src/testing/test_merchant_transfer_tracking.sh
+++ b/src/testing/test_merchant_transfer_tracking.sh
@@ -182,7 +182,7 @@ STATUS=$(curl 'http://localhost:9966/instances/default/private/transfers' \
-m 3 \
-w "%{http_code}" -s -o $LAST_RESPONSE)
-if [ "$STATUS" != "404" ]
+if [ "$STATUS" != "200" ]
then
jq . < $LAST_RESPONSE
exit_fail "Expected response ok, after providing transfer data. got: $STATUS"
@@ -203,10 +203,10 @@ fi
TRANSFERS_LIST_SIZE=`jq -r '.transfers | length' < $LAST_RESPONSE`
-if [ "$TRANSFERS_LIST_SIZE" != "0" ]
+if [ "$TRANSFERS_LIST_SIZE" != "1" ]
then
jq . < $LAST_RESPONSE
- exit_fail "Expected response ok. got: $STATUS"
+ exit_fail "Expected one transfer. got: $TRANSFERS_LIST_SIZE"
fi
echo "OK"
@@ -248,10 +248,69 @@ WAS_WIRED=`jq -r .wired < $LAST_RESPONSE`
if [ "$WAS_WIRED" == "true" ]
then
+ jq . < $LAST_RESPONSE
echo '.wired true, expected false'
exit 1
fi
echo " OK"
+echo -n "Notifying merchant of correct wire transfer in the correct instance..."
+#this time in the correct instance so the order will be marked as wired...
+
+STATUS=$(curl 'http://localhost:9966/instances/test/private/transfers' \
+ -d '{"credit_amount":"'$CREDIT_AMOUNT'","wtid":"'$WTID'","payto_uri":"'$TARGET_PAYTO'","exchange_url":"'$WURL'"}' \
+ -m 3 \
+ -w "%{http_code}" -s -o $LAST_RESPONSE)
+
+if [ "$STATUS" != "200" ]
+then
+ jq . < $LAST_RESPONSE
+ exit_fail "Expected response ok, after providing transfer data. got: $STATUS"
+fi
+echo " OK"
+
+echo -n "Fetching wire transfers of TEST instance ..."
+
+STATUS=$(curl 'http://localhost:9966/instances/test/private/transfers' \
+ -w "%{http_code}" -s -o $LAST_RESPONSE)
+
+if [ "$STATUS" != "200" ]
+then
+ jq . < $LAST_RESPONSE
+ exit_fail "Expected response 200 Ok. got: $STATUS"
+fi
+
+TRANSFERS_LIST_SIZE=`jq -r '.transfers | length' < $LAST_RESPONSE`
+
+if [ "$TRANSFERS_LIST_SIZE" != "1" ]
+then
+ jq . < $LAST_RESPONSE
+ exit_fail "Expected one transfer. got: $TRANSFERS_LIST_SIZE"
+fi
+
+echo "OK"
+
+echo -n "Checking order status ..."
+STATUS=$(curl "http://localhost:9966/instances/test/private/orders/${ORDER_ID}?transfer=YES" \
+ -w "%{http_code}" -s -o $LAST_RESPONSE)
+
+if [ "$STATUS" != "200" ]
+then
+ jq . < $LAST_RESPONSE
+ exit_fail 'should response ok, after order inquiry. got:' $STATUS `cat $LAST_RESPONSE`
+ exit 1
+fi
+
+WAS_WIRED=`jq -r .wired < $LAST_RESPONSE`
+
+if [ "$WAS_WIRED" != "true" ]
+then
+ jq . < $LAST_RESPONSE
+ echo '.wired false, expected true'
+ exit 1
+fi
+
+echo " OK"
+
exit 0