summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-05-16 14:30:38 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-05-16 14:30:38 +0200
commit1d62aeb1991cd886732646ab5810a91afdc8f1ce (patch)
tree754bba83302c2689dec8f758cf0b46e72cd1302c
parent91c56d8df80ce3900828c831316673fd5440d92e (diff)
downloadmerchant-1d62aeb1991cd886732646ab5810a91afdc8f1ce.tar.gz
merchant-1d62aeb1991cd886732646ab5810a91afdc8f1ce.tar.bz2
merchant-1d62aeb1991cd886732646ab5810a91afdc8f1ce.zip
addressing FIXME_MARCELLOs.
-rw-r--r--src/lib/Makefile.am4
-rw-r--r--src/lib/test_merchant_api.conf2
-rw-r--r--src/lib/test_merchant_api_twisted.c20
-rw-r--r--src/lib/test_merchant_api_twisted.conf9
-rw-r--r--src/lib/testing_api_cmd_track.c48
5 files changed, 39 insertions, 44 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 6e885689..c96ead54 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -79,11 +79,9 @@ check_PROGRAMS = \
test_merchant_api_new \
test_merchant_api
-if HAVE_EXPERIMENTAL
if HAVE_TWISTER
# See FIXME_MARCELLO -- had some issues (FTBFS, etc.)
-# check_PROGRAMS += test_merchant_api_twisted
-endif
+check_PROGRAMS += test_merchant_api_twisted
endif
endif
diff --git a/src/lib/test_merchant_api.conf b/src/lib/test_merchant_api.conf
index 32039c05..7f1d086f 100644
--- a/src/lib/test_merchant_api.conf
+++ b/src/lib/test_merchant_api.conf
@@ -112,8 +112,8 @@ ACTIVE_dtip = YES
# (by the merchant)
[exchange-kudos]
MASTER_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG
-BASE_URL = "http://localhost:8081/"
CURRENCY = KUDOS
+URL = http://localhost:8081/
# Auditors must be in sections "auditor-", the rest of the section
diff --git a/src/lib/test_merchant_api_twisted.c b/src/lib/test_merchant_api_twisted.c
index 5ff2109e..6417b716 100644
--- a/src/lib/test_merchant_api_twisted.c
+++ b/src/lib/test_merchant_api_twisted.c
@@ -546,12 +546,10 @@ run (void *cls,
MHD_HTTP_OK,
"create-proposal-6",
GNUNET_YES),
-
CMD_EXEC_AGGREGATOR ("run-aggregator"),
-
TALER_TESTING_cmd_check_bank_transfer
("check_bank_transfer-1",
- twister_exchange_url,
+ twister_exchange_url, /* has the 8888-port thing. */
/* paid, 1.97 =
brutto 2.00 -
deposit fee 0.01 * 2 -
@@ -561,16 +559,13 @@ run (void *cls,
EXCHANGE_ACCOUNT_NO,
MERCHANT_ACCOUNT_NO),
- /* Should instead change the response body somehow! */
TALER_TESTING_cmd_modify_object ("hack-0",
PROXY_EXCHANGE_CONFIG_FILE,
"total",
"EUR:0.98"),
-
TALER_TESTING_cmd_delete_object ("hack-1",
PROXY_EXCHANGE_CONFIG_FILE,
"deposits.0"),
-
TALER_TESTING_cmd_merchant_track_transaction
("track-transaction-1",
twister_merchant_url,
@@ -678,20 +673,18 @@ run (void *cls,
"deposit-simple-for-abort",
is->ctx,
0),
-#if FIXME_MARCELLO
- TALER_TESTING_cmd_flip_object
+
+ TALER_TESTING_cmd_flip_download
("hack-abort-4",
PROXY_MERCHANT_CONFIG_FILE,
"refund_permissions.0.merchant_sig"),
-#endif
+
TALER_TESTING_cmd_pay_abort ("pay-abort-4",
twister_merchant_url,
"deposit-simple-for-abort",
is->ctx,
0),
-
/* just malforming the response. */
-
TALER_TESTING_cmd_malform_response
("malform-abortion",
PROXY_MERCHANT_CONFIG_FILE),
@@ -766,12 +759,11 @@ run (void *cls,
"EUR:1.99", // no sense now
"EUR:0.01"), // no sense now
-#if FIXME_MARCELLO
- TALER_TESTING_cmd_flip_object
+ TALER_TESTING_cmd_flip_download
("hack-coin-history",
PROXY_MERCHANT_CONFIG_FILE,
"history.0.coin_sig"),
-#endif
+
/* Coin history check will fail, due to coin's bad signature. */
TALER_TESTING_cmd_pay ("deposit-simple-fail",
twister_merchant_url,
diff --git a/src/lib/test_merchant_api_twisted.conf b/src/lib/test_merchant_api_twisted.conf
index f08fc122..36b196a7 100644
--- a/src/lib/test_merchant_api_twisted.conf
+++ b/src/lib/test_merchant_api_twisted.conf
@@ -5,8 +5,11 @@
# must target the twister's http port.
URL = http://localhost:8888/
+[exchange]
+BASE_URL = http://localhost:8888/
+
# merchant: 8080
# exchange: 8081
-# bank: 8082
-# twisted-merchant: 8888
-# twisted-control: 8889
+# (Fake)bank: 8082
+# twisted-exchange: 8888
+# twisted-merchant: 8889
diff --git a/src/lib/testing_api_cmd_track.c b/src/lib/testing_api_cmd_track.c
index 18e5a5f3..f58ed169 100644
--- a/src/lib/testing_api_cmd_track.c
+++ b/src/lib/testing_api_cmd_track.c
@@ -121,30 +121,32 @@ track_transaction_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"/track/transaction, response code: %u\n",
http_status);
-
- /* Only storing first element's wtid, as this works around
- * the disability of the real bank to provide a "bank check"
- * CMD as the fakebank does. */
- if (NULL == (wtid_str = json_object_get
- (json_array_get (json, 0), "wtid")))
- {
- TALER_TESTING_interpreter_fail (tts->is);
- return;
- }
-
- if (NULL == (exchange_url = json_object_get
- (json_array_get (json, 0), "exchange")))
+ if (MHD_HTTP_OK == http_status)
{
+ /* Only storing first element's wtid, as this works around
+ * the disability of the real bank to provide a "bank check"
+ * CMD as the fakebank does. */
- TALER_TESTING_interpreter_fail (tts->is);
- return;
+ if (NULL == (wtid_str = json_object_get
+ (json_array_get (json, 0), "wtid")))
+ {
+ TALER_TESTING_interpreter_fail (tts->is);
+ return;
+ }
+
+ if (NULL == (exchange_url = json_object_get
+ (json_array_get (json, 0), "exchange")))
+ {
+
+ TALER_TESTING_interpreter_fail (tts->is);
+ return;
+ }
+
+ tts->exchange_url = GNUNET_strdup
+ (json_string_value (exchange_url));
+ tts->wtid_str = GNUNET_strdup
+ (json_string_value (wtid_str));
}
-
- tts->exchange_url = GNUNET_strdup
- (json_string_value (exchange_url));
- tts->wtid_str = GNUNET_strdup
- (json_string_value (wtid_str));
-
TALER_TESTING_interpreter_next (tts->is);
}
@@ -333,8 +335,8 @@ track_transaction_cleanup (void *cls,
}
/* Need to discard 'const' before freeing. */
- GNUNET_free ((char *) tts->exchange_url);
- GNUNET_free ((char *) tts->wtid_str);
+ GNUNET_free_non_null ((char *) tts->exchange_url);
+ GNUNET_free_non_null ((char *) tts->wtid_str);
GNUNET_free (tts);
}