summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-03 21:58:36 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-03 21:58:36 +0200
commitba3f70390a1e7210195c41e3afa3e7fe1511eb96 (patch)
tree8828877b90b208e0ccd85a9c013ef61829b3c33c /src/testing
parent06676e72cb063c7abb264cbfd527f5c2d414dc7c (diff)
downloadexchange-ba3f70390a1e7210195c41e3afa3e7fe1511eb96.tar.gz
exchange-ba3f70390a1e7210195c41e3afa3e7fe1511eb96.tar.bz2
exchange-ba3f70390a1e7210195c41e3afa3e7fe1511eb96.zip
restructure configuration, move bank account credentials from exchange-account-XXX to exchange-accountcredentials-XXX
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test-taler-exchange-aggregator-postgres.conf8
-rw-r--r--src/testing/test-taler-exchange-wirewatch-postgres.conf9
-rw-r--r--src/testing/test_auditor_api.conf9
-rw-r--r--src/testing/test_bank_api.c9
-rw-r--r--src/testing/test_bank_api_fakebank.conf2
-rw-r--r--src/testing/test_bank_api_nexus.conf3
-rw-r--r--src/testing/test_bank_api_pybank.conf3
-rw-r--r--src/testing/test_bank_api_pybank_twisted.conf9
-rw-r--r--src/testing/test_exchange_api.conf10
-rw-r--r--src/testing/test_exchange_api_keys_cherry_picking.conf8
-rw-r--r--src/testing/test_exchange_api_twisted.conf8
-rw-r--r--src/testing/testing_api_helpers_bank.c64
12 files changed, 94 insertions, 48 deletions
diff --git a/src/testing/test-taler-exchange-aggregator-postgres.conf b/src/testing/test-taler-exchange-aggregator-postgres.conf
index 2c03c5db..7f277629 100644
--- a/src/testing/test-taler-exchange-aggregator-postgres.conf
+++ b/src/testing/test-taler-exchange-aggregator-postgres.conf
@@ -70,13 +70,15 @@ LEGAL_RESERVE_EXPIRATION_TIME = 7 years
# What is the account URL?
PAYTO_URI = "payto://x-taler-bank/localhost/2"
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-1]
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
PASSWORD = x
-ENABLE_DEBIT = YES
-ENABLE_CREDIT = YES
-TALER_BANK_AUTH_METHOD = NONE
+
[bank]
HTTP_PORT = 8082
diff --git a/src/testing/test-taler-exchange-wirewatch-postgres.conf b/src/testing/test-taler-exchange-wirewatch-postgres.conf
index 6a963989..d42f9d44 100644
--- a/src/testing/test-taler-exchange-wirewatch-postgres.conf
+++ b/src/testing/test-taler-exchange-wirewatch-postgres.conf
@@ -56,17 +56,16 @@ BASE_URL = "http://localhost:8083/"
PORT = 8083
[exchange-account-1]
-
# What is the account URL?
PAYTO_URI = "payto://x-taler-bank/localhost/2"
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-1]
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
PASSWORD = x
-PLUGIN = "taler_bank"
-ENABLE_DEBIT = YES
-ENABLE_CREDIT = YES
-TALER_BANK_AUTH_METHOD = NONE
[bank]
HTTP_PORT = 8082
diff --git a/src/testing/test_auditor_api.conf b/src/testing/test_auditor_api.conf
index 4140aeb4..03a5e245 100644
--- a/src/testing/test_auditor_api.conf
+++ b/src/testing/test_auditor_api.conf
@@ -57,6 +57,8 @@ CONFIG = "postgres:///talercheck"
[exchange-account-1]
# What is the URL of our account?
PAYTO_URI = "payto://x-taler-bank/localhost/42"
+
+[exchange-accountcredentials-1]
WIRE_GATEWAY_URL = "http://localhost:8082/42/"
[bank]
@@ -66,17 +68,18 @@ HTTP_PORT = 8082
[exchange-account-2]
# What is the bank account (with the "Taler Bank" demo system)?
-WIRE_GATEWAY_URL = "http://localhost:8082/2/"
PAYTO_URI = "payto://x-taler-bank/localhost/2"
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
# Authentication information for basic authentication
+[exchange-accountcredentials-2]
+WIRE_GATEWAY_URL = "http://localhost:8082/2/"
WIRE_GATEWAY_AUTH_METHOD = "basic"
USERNAME = user
PASSWORD = pass
-ENABLE_DEBIT = YES
-ENABLE_CREDIT = YES
# Sections starting with "coin_" specify which denominations
diff --git a/src/testing/test_bank_api.c b/src/testing/test_bank_api.c
index 68c12aff..e5a12589 100644
--- a/src/testing/test_bank_api.c
+++ b/src/testing/test_bank_api.c
@@ -216,10 +216,11 @@ main (int argc,
TALER_LOG_DEBUG ("Running with Nexus.\n");
with_libeufin = GNUNET_YES;
cfgfile = CONFIG_FILE_NEXUS;
- if (GNUNET_OK != TALER_TESTING_prepare_nexus (CONFIG_FILE_NEXUS,
- GNUNET_YES,
- "exchange-account-2",
- &bc))
+ if (GNUNET_OK !=
+ TALER_TESTING_prepare_nexus (CONFIG_FILE_NEXUS,
+ GNUNET_YES,
+ "exchange-account-2",
+ &bc))
{
GNUNET_break (0);
return 77;
diff --git a/src/testing/test_bank_api_fakebank.conf b/src/testing/test_bank_api_fakebank.conf
index 78f9ecbd..b9742398 100644
--- a/src/testing/test_bank_api_fakebank.conf
+++ b/src/testing/test_bank_api_fakebank.conf
@@ -5,6 +5,8 @@ currency = KUDOS
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/2
+
+[exchange-accountcredentials-2]
WIRE_GATEWAY_URL = "http://localhost:8081/2/"
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
diff --git a/src/testing/test_bank_api_nexus.conf b/src/testing/test_bank_api_nexus.conf
index e9a64e2a..c514170e 100644
--- a/src/testing/test_bank_api_nexus.conf
+++ b/src/testing/test_bank_api_nexus.conf
@@ -5,7 +5,8 @@ currency = KUDOS
[exchange-account-2]
PAYTO_URI = payto://iban/BIC/ES9121000418450200051332?receiver-name=Exchange
-METHOD = iban
+
+[exchange-accountcredentials-2]
WIRE_GATEWAY_URL = http://localhost:5001/facades/my-facade/taler/
WIRE_GATEWAY_AUTH_METHOD = basic
# the exchange authenticates as the 'admin' user,
diff --git a/src/testing/test_bank_api_pybank.conf b/src/testing/test_bank_api_pybank.conf
index 93169d2f..6603ba8a 100644
--- a/src/testing/test_bank_api_pybank.conf
+++ b/src/testing/test_bank_api_pybank.conf
@@ -5,7 +5,8 @@ currency = KUDOS
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
-METHOD = x-taler-bank
+
+[exchange-accountcredentials-2]
WIRE_GATEWAY_URL = "http://localhost:8081/taler-wire-gateway/Exchange/"
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
diff --git a/src/testing/test_bank_api_pybank_twisted.conf b/src/testing/test_bank_api_pybank_twisted.conf
index 3a7b08c9..d89cf046 100644
--- a/src/testing/test_bank_api_pybank_twisted.conf
+++ b/src/testing/test_bank_api_pybank_twisted.conf
@@ -18,31 +18,26 @@ UNIXPATH = /tmp/taler-service-twister.sock
UNIX_MATCH_UID = NO
UNIX_MATCH_GID = YES
-
[auditor]
BASE_URL = "http://localhost:8083/"
[taler]
currency = KUDOS
-
[bank]
serve = http
http_port = 8081
database = postgres:///talercheck
-
[exchange-account-1]
PAYTO_URI = payto://x-taler-bank/localhost/1
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
+
+[exchange-accountcredentials-2]
WIRE_GATEWAY_URL = "http://localhost:8888/taler-wire-gateway/Exchange/"
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
PASSWORD = x
-
-
-[bank]
-HTTP_PORT = 8081
diff --git a/src/testing/test_exchange_api.conf b/src/testing/test_exchange_api.conf
index 8c883c49..a1b74365 100644
--- a/src/testing/test_exchange_api.conf
+++ b/src/testing/test_exchange_api.conf
@@ -57,18 +57,22 @@ CONFIG = "postgres:///talercheck"
[exchange-account-1]
# What is the URL of our account?
PAYTO_URI = "payto://x-taler-bank/localhost/42"
-WIRE_GATEWAY_URL = "http://localhost:9081/42/"
# ENABLE_CREDIT = YES
+[exchange-accountcredentials-1]
+WIRE_GATEWAY_URL = "http://localhost:9081/42/"
+
[exchange-account-2]
# What is the bank account (with the "Taler Bank" demo system)?
PAYTO_URI = "payto://x-taler-bank/localhost/2"
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-2]
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
PASSWORD = x
WIRE_GATEWAY_URL = "http://localhost:9081/2/"
-ENABLE_DEBIT = YES
-ENABLE_CREDIT = YES
[bank]
HTTP_PORT = 9081
diff --git a/src/testing/test_exchange_api_keys_cherry_picking.conf b/src/testing/test_exchange_api_keys_cherry_picking.conf
index e7a56f3c..d7dd9535 100644
--- a/src/testing/test_exchange_api_keys_cherry_picking.conf
+++ b/src/testing/test_exchange_api_keys_cherry_picking.conf
@@ -57,18 +57,22 @@ CONFIG = "postgres:///talercheck"
[exchange-account-1]
PAYTO_URI = payto://x-taler-bank/localhost/42
+
+[exchange-accountcredentials-1]
WIRE_GATEWAY_URL = "http://localhost:9082/42/"
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/2
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-2]
WIRE_GATEWAY_URL = "http://localhost:9082/2/"
# Authentication information for basic authentication
TALER_BANK_AUTH_METHOD = "basic"
USERNAME = user
PASSWORD = pass
-ENABLE_DEBIT = YES
-ENABLE_CREDIT = YES
[bank]
HTTP_PORT=8082
diff --git a/src/testing/test_exchange_api_twisted.conf b/src/testing/test_exchange_api_twisted.conf
index 2d4fc517..a41cfd43 100644
--- a/src/testing/test_exchange_api_twisted.conf
+++ b/src/testing/test_exchange_api_twisted.conf
@@ -49,17 +49,21 @@ CONFIG = "postgres:///talercheck"
[exchange-account-1]
# What is the URL of our account?
PAYTO_URI = "payto://x-taler-bank/localhost/42"
+
+[exchange-accountcredentials-1]
WIRE_GATEWAY_URL = "http://localhost:9081/42/"
WIRE_GATEWAY_AUTH_METHOD = NONE
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/2
+ENABLE_DEBIT = YES
+ENABLE_CREDIT = YES
+
+[exchange-accountcredentials-2]
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
WIRE_GATEWAY_AUTH_METHOD = BASIC
USERNAME = user
PASSWORD = pass
-ENABLE_DEBIT = YES
-ENABLE_CREDIT = YES
[bank]
HTTP_PORT = 8082
diff --git a/src/testing/testing_api_helpers_bank.c b/src/testing/testing_api_helpers_bank.c
index a82bcbfe..d7cce01b 100644
--- a/src/testing/testing_api_helpers_bank.c
+++ b/src/testing/testing_api_helpers_bank.c
@@ -292,10 +292,14 @@ TALER_TESTING_prepare_nexus (const char *config_filename,
char *database = NULL; // silence compiler
char *exchange_payto_uri;
+ GNUNET_assert (0 ==
+ strncasecmp (config_section,
+ "exchange-account-",
+ strlen ("exchange-account-")));
cfg = GNUNET_CONFIGURATION_create ();
-
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_load (cfg, config_filename))
+ GNUNET_CONFIGURATION_load (cfg,
+ config_filename))
{
GNUNET_CONFIGURATION_destroy (cfg);
GNUNET_break (0);
@@ -357,14 +361,25 @@ TALER_TESTING_prepare_nexus (const char *config_filename,
}
}
- if (GNUNET_OK !=
- TALER_BANK_auth_parse_cfg (cfg,
- config_section,
- &bc->exchange_auth))
{
- GNUNET_break (0);
- GNUNET_CONFIGURATION_destroy (cfg);
- return GNUNET_SYSERR;
+ char *csn;
+
+ GNUNET_asprintf (&csn,
+ "exchange-accountcredentials-%s",
+ &config_section[strlen ("exchange-account-")]);
+
+
+ if (GNUNET_OK !=
+ TALER_BANK_auth_parse_cfg (cfg,
+ csn,
+ &bc->exchange_auth))
+ {
+ GNUNET_break (0);
+ GNUNET_CONFIGURATION_destroy (cfg);
+ GNUNET_free (csn);
+ return GNUNET_SYSERR;
+ }
+ GNUNET_free (csn);
}
GNUNET_CONFIGURATION_destroy (cfg);
bc->exchange_payto = exchange_payto_uri;
@@ -400,10 +415,15 @@ TALER_TESTING_prepare_bank (const char *config_filename,
char *database;
char *exchange_payto_uri;
+ GNUNET_assert (0 ==
+ strncasecmp (config_section,
+ "exchange-account-",
+ strlen ("exchange-account-")));
cfg = GNUNET_CONFIGURATION_create ();
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_load (cfg, config_filename))
+ GNUNET_CONFIGURATION_load (cfg,
+ config_filename))
{
GNUNET_CONFIGURATION_destroy (cfg);
GNUNET_break (0);
@@ -522,14 +542,24 @@ TALER_TESTING_prepare_bank (const char *config_filename,
}
GNUNET_OS_process_destroy (dbreset_proc);
}
- if (GNUNET_OK !=
- TALER_BANK_auth_parse_cfg (cfg,
- config_section,
- &bc->exchange_auth))
{
- GNUNET_break (0);
- GNUNET_CONFIGURATION_destroy (cfg);
- return GNUNET_SYSERR;
+ char *csn;
+
+ GNUNET_asprintf (&csn,
+ "exchange-accountcredentials-%s",
+ &config_section[strlen ("exchange-account-")]);
+
+ if (GNUNET_OK !=
+ TALER_BANK_auth_parse_cfg (cfg,
+ csn,
+ &bc->exchange_auth))
+ {
+ GNUNET_break (0);
+ GNUNET_free (csn);
+ GNUNET_CONFIGURATION_destroy (cfg);
+ return GNUNET_SYSERR;
+ }
+ GNUNET_free (csn);
}
GNUNET_CONFIGURATION_destroy (cfg);
bc->exchange_payto = exchange_payto_uri;