summaryrefslogtreecommitdiff
path: root/src/exchange-lib/test_exchange_api_new.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange-lib/test_exchange_api_new.c')
-rw-r--r--src/exchange-lib/test_exchange_api_new.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/exchange-lib/test_exchange_api_new.c b/src/exchange-lib/test_exchange_api_new.c
index 077115a22..32e1ad37a 100644
--- a/src/exchange-lib/test_exchange_api_new.c
+++ b/src/exchange-lib/test_exchange_api_new.c
@@ -30,16 +30,17 @@
#include "taler_fakebank_lib.h"
#include "taler_testing_lib.h"
-
/**
- * Is the configuration file is set to include wire format 'test'?
+ * Configuration file we use. One (big) configuration is used
+ * for the various components for this test.
*/
-#define WIRE_TEST 1
+#define CONFIG_FILE "test_exchange_api.conf"
/**
- * Is the configuration file is set to include wire format 'sepa'?
+ * URL of the fakebank. Obtained from CONFIG_FILE's "exchange-wire-test:BANK_URI" option.
*/
-#define WIRE_SEPA 1
+static char *fakebank_url;
+
/**
* Account number of the exchange at the bank.
@@ -52,41 +53,37 @@
#define USER_ACCOUNT_NO 42
/**
- *
+ * User name. Never checked by fakebank.
*/
#define USER_LOGIN_NAME "user42"
/**
- *
+ * User password. Never checked by fakebank.
*/
#define USER_LOGIN_PASS "pass42"
/**
+ * Execute the taler-exchange-wirewatch command with
+ * our configuration file.
*
- */
-#define FAKEBANK_URL "http://localhost:8082/"
-
-/**
- *
- */
-#define CONFIG_FILE "test_exchange_api.conf"
-
-/**
- *
+ * @param label label to use for the command.
*/
#define CMD_EXEC_WIREWATCH(label) \
TALER_TESTING_cmd_exec_wirewatch (label, CONFIG_FILE)
/**
+ * Run wire transfer of funds from some user's account to the
+ * exchange.
*
+ * @param label label to use for the command.
+ * @param amount amount to transfer, i.e. "EUR:1"
*/
#define CMD_TRANSFER_TO_EXCHANGE(label,amount) \
TALER_TESTING_cmd_fakebank_transfer (label, amount, \
- FAKEBANK_URL, USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO, \
+ fakebank_url, USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO, \
USER_LOGIN_NAME, USER_LOGIN_PASS)
-
/**
* Main function that will tell the interpreter what commands to run.
*
@@ -105,7 +102,7 @@ run (void *cls,
TALER_TESTING_run_with_fakebank (is,
commands,
- FAKEBANK_URL);
+ fakebank_url);
}
@@ -119,8 +116,7 @@ main (int argc,
GNUNET_log_setup ("test-exchange-api-new",
"INFO",
NULL);
- if (GNUNET_OK !=
- TALER_TESTING_url_port_free (FAKEBANK_URL))
+ if (NULL == (fakebank_url = TALER_TESTING_prepare_fakebank (CONFIG_FILE)))
return 77;
TALER_TESTING_cleanup_files (CONFIG_FILE);
switch (TALER_TESTING_prepare_exchange (CONFIG_FILE))