aboutsummaryrefslogtreecommitdiff
path: root/src/bank-lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-12-23 11:47:16 +0100
committerChristian Grothoff <christian@grothoff.org>2019-12-23 11:47:16 +0100
commite0cf954ad9ab0c1613ab2c0f06ada581dbdb8276 (patch)
treeb6bed56bafdf3b7d6a3130ef614bc35562c9d3a8 /src/bank-lib
parentc58c5bce2be3125515e7dbcc69abd3699a568707 (diff)
make exchange test suite work with current bank
Diffstat (limited to 'src/bank-lib')
-rw-r--r--src/bank-lib/bank_api_admin.c1
-rw-r--r--src/bank-lib/test_bank_api.c32
-rw-r--r--src/bank-lib/test_bank_api_twisted.c2
-rw-r--r--src/bank-lib/testing_api_helpers.c23
4 files changed, 30 insertions, 28 deletions
diff --git a/src/bank-lib/bank_api_admin.c b/src/bank-lib/bank_api_admin.c
index cff444fb9..5240a3724 100644
--- a/src/bank-lib/bank_api_admin.c
+++ b/src/bank-lib/bank_api_admin.c
@@ -23,7 +23,6 @@
#include "bank_api_common.h"
#include <microhttpd.h> /* just for HTTP status codes */
#include "taler_signatures.h"
-// FIXME(dold): temporary hack
#include "taler_curl_lib.h"
diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c
index a7b6aef7e..d15984a9c 100644
--- a/src/bank-lib/test_bank_api.c
+++ b/src/bank-lib/test_bank_api.c
@@ -92,7 +92,7 @@ run (void *cls,
struct TALER_TESTING_Command commands[] = {
TALER_TESTING_cmd_bank_history ("history-0",
bank_url,
- BANK_ACCOUNT_NUMBER,
+ TALER_TESTING_BANK_ACCOUNT_NUMBER,
TALER_BANK_DIRECTION_BOTH,
GNUNET_YES,
NULL,
@@ -101,65 +101,65 @@ run (void *cls,
* the parameters, although it was always set as '200 OK' */
TRANSFER ("debit-1",
"KUDOS:5.01",
- EXCHANGE_ACCOUNT_NUMBER,
- BANK_ACCOUNT_NUMBER,
+ TALER_TESTING_EXCHANGE_ACCOUNT_NUMBER,
+ TALER_TESTING_BANK_ACCOUNT_NUMBER,
"subject 1"),
TALER_TESTING_cmd_bank_history ("history-1c",
bank_url,
- BANK_ACCOUNT_NUMBER,
+ TALER_TESTING_BANK_ACCOUNT_NUMBER,
TALER_BANK_DIRECTION_CREDIT,
GNUNET_YES,
NULL,
5),
TALER_TESTING_cmd_bank_history ("history-1d",
bank_url,
- BANK_ACCOUNT_NUMBER,
+ TALER_TESTING_BANK_ACCOUNT_NUMBER,
TALER_BANK_DIRECTION_DEBIT,
GNUNET_YES,
NULL,
5),
TRANSFER ("debit-2",
"KUDOS:3.21",
- EXCHANGE_ACCOUNT_NUMBER,
- USER_ACCOUNT_NUMBER,
+ TALER_TESTING_EXCHANGE_ACCOUNT_NUMBER,
+ TALER_TESTING_USER_ACCOUNT_NUMBER,
"subject 2"),
TRANSFER ("credit-2",
"KUDOS:3.22",
- USER_ACCOUNT_NUMBER,
- EXCHANGE_ACCOUNT_NUMBER,
+ TALER_TESTING_USER_ACCOUNT_NUMBER,
+ TALER_TESTING_EXCHANGE_ACCOUNT_NUMBER,
"credit 2"),
TALER_TESTING_cmd_bank_history ("history-2b",
bank_url,
- EXCHANGE_ACCOUNT_NUMBER,
+ TALER_TESTING_EXCHANGE_ACCOUNT_NUMBER,
TALER_BANK_DIRECTION_BOTH,
GNUNET_YES,
NULL,
5),
TALER_TESTING_cmd_bank_history ("history-2bi",
bank_url,
- EXCHANGE_ACCOUNT_NUMBER,
+ TALER_TESTING_EXCHANGE_ACCOUNT_NUMBER,
TALER_BANK_DIRECTION_BOTH,
GNUNET_YES,
"debit-1",
5),
TRANSFER ("credit-for-reject-1",
"KUDOS:1.01",
- BANK_ACCOUNT_NUMBER,
- EXCHANGE_ACCOUNT_NUMBER,
+ TALER_TESTING_BANK_ACCOUNT_NUMBER,
+ TALER_TESTING_EXCHANGE_ACCOUNT_NUMBER,
"subject 3"),
TALER_TESTING_cmd_bank_reject ("reject-1",
bank_url,
"credit-for-reject-1"),
TALER_TESTING_cmd_bank_history ("history-r1",
bank_url,
- BANK_ACCOUNT_NUMBER,
+ TALER_TESTING_BANK_ACCOUNT_NUMBER,
TALER_BANK_DIRECTION_BOTH,
GNUNET_YES,
NULL,
5),
TALER_TESTING_cmd_bank_history ("history-r1c",
bank_url,
- BANK_ACCOUNT_NUMBER,
+ TALER_TESTING_BANK_ACCOUNT_NUMBER,
TALER_BANK_DIRECTION_BOTH
| TALER_BANK_DIRECTION_CANCEL,
GNUNET_YES,
@@ -187,7 +187,7 @@ main (int argc,
/* These environment variables get in the way... */
unsetenv ("XDG_DATA_HOME");
unsetenv ("XDG_CONFIG_HOME");
- GNUNET_log_setup ("test-bank-api-with-(fake)bank-new",
+ GNUNET_log_setup ("test-bank-api",
"DEBUG",
NULL);
diff --git a/src/bank-lib/test_bank_api_twisted.c b/src/bank-lib/test_bank_api_twisted.c
index 2d2483d49..b926f9655 100644
--- a/src/bank-lib/test_bank_api_twisted.c
+++ b/src/bank-lib/test_bank_api_twisted.c
@@ -93,7 +93,7 @@ run (void *cls,
TWISTED_BANK_URL),
TALER_TESTING_cmd_bank_history ("history-0",
TWISTED_BANK_URL,
- EXCHANGE_ACCOUNT_NUMBER,
+ TALER_TESTING_EXCHANGE_ACCOUNT_NUMBER,
TALER_BANK_DIRECTION_BOTH,
GNUNET_NO,
NULL,
diff --git a/src/bank-lib/testing_api_helpers.c b/src/bank-lib/testing_api_helpers.c
index 2f5ea36f5..499129aeb 100644
--- a/src/bank-lib/testing_api_helpers.c
+++ b/src/bank-lib/testing_api_helpers.c
@@ -41,18 +41,18 @@ struct TALER_BANK_AuthenticationData AUTHS[] = {
/* Bank credentials */
{.method = TALER_BANK_AUTH_BASIC,
- .details.basic.username = BANK_USERNAME,
- .details.basic.password = BANK_PASSWORD},
+ .details.basic.username = TALER_TESTING_BANK_USERNAME,
+ .details.basic.password = TALER_TESTING_BANK_PASSWORD},
/* Exchange credentials */
{.method = TALER_BANK_AUTH_BASIC,
- .details.basic.username = EXCHANGE_USERNAME,
- .details.basic.password = EXCHANGE_PASSWORD },
+ .details.basic.username = TALER_TESTING_EXCHANGE_USERNAME,
+ .details.basic.password = TALER_TESTING_EXCHANGE_PASSWORD },
/* User credentials */
{.method = TALER_BANK_AUTH_BASIC,
- .details.basic.username = USER_USERNAME,
- .details.basic.password = USER_PASSWORD }
+ .details.basic.username = TALER_TESTING_USER_USERNAME,
+ .details.basic.password = TALER_TESTING_USER_PASSWORD }
};
@@ -193,10 +193,10 @@ TALER_TESTING_run_bank (const char *config_filename,
(GNUNET_NO,
GNUNET_OS_INHERIT_STD_ALL,
NULL, NULL, NULL,
- "taler-bank-manage",
- "taler-bank-manage",
- "-c", config_filename,
- "--with-db", database,
+ "taler-bank-manage-testing",
+ "taler-bank-manage-testing",
+ config_filename,
+ database,
serve_arg, NULL);
GNUNET_free (database);
if (NULL == bank_proc)
@@ -243,6 +243,9 @@ TALER_TESTING_run_bank (const char *config_filename,
* Prepare the bank execution. Check if the port is available
* and reset database.
*
+ * NOTE: resetting the database is now done by taler-bank-manage-testing
+ * and should be removed here (once it works...)! FIXME!
+ *
* @param config_filename configuration file name.
*
* @return the base url, or NULL upon errors. Must be freed