diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-11-03 20:27:14 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-11-05 10:38:39 +0100 |
commit | d855a410f5ecb7b39d200f07e83253374660b5f5 (patch) | |
tree | 0c9c7a54b3e953941e3b9041463ac785ceafa4a5 | |
parent | 6608c8466e74a77de329bf928aa0a43874d4d4ca (diff) |
work on testing
-rw-r--r-- | src/testing/test_kyc_api.c | 24 | ||||
-rw-r--r-- | src/testing/test_merchant_api.c | 39 | ||||
-rw-r--r-- | src/testing/test_merchant_api_twisted.c | 37 |
3 files changed, 48 insertions, 52 deletions
diff --git a/src/testing/test_kyc_api.c b/src/testing/test_kyc_api.c index fd468537..30553f19 100644 --- a/src/testing/test_kyc_api.c +++ b/src/testing/test_kyc_api.c @@ -51,17 +51,17 @@ /** * Payto URI of the customer (payer). */ -static const char *payer_payto; +static struct TALER_FullPayto payer_payto; /** * Payto URI of the exchange (escrow account). */ -static const char *exchange_payto; +static struct TALER_FullPayto exchange_payto; /** * Payto URI of the merchant (receiver). */ -static const char *merchant_payto; +static struct TALER_FullPayto merchant_payto; /** * Credentials for the test. @@ -540,15 +540,15 @@ int main (int argc, char *const *argv) { - payer_payto = - "payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME "?receiver-name=" - USER_ACCOUNT_NAME; - exchange_payto = - "payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME "?receiver-name=" - EXCHANGE_ACCOUNT_NAME; - merchant_payto = - "payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME "?receiver-name=" - MERCHANT_ACCOUNT_NAME; + payer_payto.full_payto = + (char *) "payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME + "?receiver-name=" USER_ACCOUNT_NAME; + exchange_payto.full_payto = + (char *) "payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME + "?receiver-name=" EXCHANGE_ACCOUNT_NAME; + merchant_payto.full_payto = + (char *) "payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME + "?receiver-name=" MERCHANT_ACCOUNT_NAME; merchant_url = "http://localhost:8080/"; GNUNET_asprintf (&merchant_url_i1a, "%sinstances/i1a/", diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c index 72546e4c..d4cebcf6 100644 --- a/src/testing/test_merchant_api.c +++ b/src/testing/test_merchant_api.c @@ -60,8 +60,6 @@ */ static char *config_file; -#define PAYTO_I1 "payto://x-taler-bank/localhost/3?receiver-name=3" - /** * Exchange base URL. Could also be taken from config. */ @@ -70,17 +68,17 @@ static char *config_file; /** * Payto URI of the customer (payer). */ -static const char *payer_payto; +static struct TALER_FullPayto payer_payto; /** * Payto URI of the exchange (escrow account). */ -static const char *exchange_payto; +static struct TALER_FullPayto exchange_payto; /** * Payto URI of the merchant (receiver). */ -static const char *merchant_payto; +static struct TALER_FullPayto merchant_payto; /** * Credentials for the test. @@ -216,7 +214,7 @@ run (void *cls, TALER_TESTING_cmd_merchant_post_account ( "instance-create-default-account", merchant_url, - PAYTO_I1, + merchant_payto, NULL, NULL, MHD_HTTP_OK), TALER_TESTING_cmd_merchant_kyc_get ( @@ -490,7 +488,7 @@ run (void *cls, merchant_payto), TALER_TESTING_cmd_merchant_post_transfer ("post-transfer-1", &cred.ba, - PAYTO_I1, + merchant_payto, merchant_url, "EUR:4.98", MHD_HTTP_NO_CONTENT, @@ -500,7 +498,7 @@ run (void *cls, config_file), TALER_TESTING_cmd_merchant_post_transfer2 ("post-transfer-bad", merchant_url, - PAYTO_I1, + merchant_payto, "EUR:4.98", NULL, /*non-routable IP address @@ -510,7 +508,7 @@ run (void *cls, MHD_HTTP_NO_CONTENT), TALER_TESTING_cmd_merchant_get_transfers ("get-transfers-1", merchant_url, - PAYTO_I1, + merchant_payto, MHD_HTTP_OK, "post-transfer-1", "post-transfer-bad", @@ -977,7 +975,7 @@ run (void *cls, TALER_TESTING_cmd_merchant_post_account ( "instance-create-i1a-account", merchant_url_i1a, - PAYTO_I1, + merchant_payto, NULL, NULL, MHD_HTTP_OK), TALER_TESTING_cmd_merchant_get_product ("get-nx-product-i1a-1", @@ -1855,7 +1853,7 @@ run (void *cls, TALER_TESTING_cmd_merchant_post_account ( "instance-create-default-account", merchant_url, - PAYTO_I1, + merchant_payto, NULL, NULL, MHD_HTTP_OK), TALER_TESTING_cmd_merchant_post_instances ( @@ -1989,7 +1987,7 @@ run (void *cls, TALER_TESTING_cmd_merchant_post_account ( "instance-create-default-account-after-purge", merchant_url, - PAYTO_I1, + merchant_payto, NULL, NULL, MHD_HTTP_OK), TALER_TESTING_cmd_merchant_get_products ( @@ -2166,15 +2164,16 @@ main (int argc, cipher); GNUNET_free (cipher); } - payer_payto = - "payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME "?receiver-name=" - USER_ACCOUNT_NAME; - exchange_payto = - "payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME "?receiver-name=" + payer_payto.full_payto = + (char *) "payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME + "?receiver-name=" USER_ACCOUNT_NAME; + exchange_payto.full_payto = + (char *) "payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME + "?receiver-name=" EXCHANGE_ACCOUNT_NAME; - merchant_payto = - "payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME "?receiver-name=" - MERCHANT_ACCOUNT_NAME; + merchant_payto.full_payto = + (char *) "payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME + "?receiver-name=" MERCHANT_ACCOUNT_NAME; merchant_url = "http://localhost:8080/"; GNUNET_asprintf (&merchant_url_i1a, "%sinstances/i1a/", diff --git a/src/testing/test_merchant_api_twisted.c b/src/testing/test_merchant_api_twisted.c index 446e6eb3..b6bab685 100644 --- a/src/testing/test_merchant_api_twisted.c +++ b/src/testing/test_merchant_api_twisted.c @@ -61,23 +61,19 @@ static char *config_file; */ #define USER_ACCOUNT_NAME "62" - -#define PAYTO_I1 "payto://x-taler-bank/localhost/3?receiver-name=user3" - - /** * Configuration file for the proxy between merchant and * exchange. Not used directly here in the code (instead * used in the merchant config), but kept around for consistency. */ #define PROXY_EXCHANGE_config_file \ - "test_merchant_api_proxy_exchange.conf" + "test_merchant_api_proxy_exchange.conf" /** * Configuration file for the proxy between "lib" and merchant. */ #define PROXY_MERCHANT_config_file \ - "test_merchant_api_proxy_merchant.conf" + "test_merchant_api_proxy_merchant.conf" /** * Exchange base URL. Could also be taken from config. @@ -119,10 +115,10 @@ static struct GNUNET_OS_Process *twisterexchanged; */ static struct GNUNET_OS_Process *twistermerchantd; +static struct TALER_FullPayto payer_payto; +static struct TALER_FullPayto exchange_payto; +static struct TALER_FullPayto merchant_payto; -static const char *payer_payto; -static const char *exchange_payto; -static const char *merchant_payto; static struct TALER_TESTING_Credentials cred; /** @@ -155,8 +151,8 @@ CMD_EXEC_WIREWATCH (const char *label) * @param label label to use for the command. */ #define CMD_EXEC_AGGREGATOR(label) \ - TALER_TESTING_cmd_exec_aggregator (label "-aggregator", config_file), \ - TALER_TESTING_cmd_exec_transfer (label "-transfer", config_file) + TALER_TESTING_cmd_exec_aggregator (label "-aggregator", config_file), \ + TALER_TESTING_cmd_exec_transfer (label "-transfer", config_file) /** @@ -341,7 +337,7 @@ run (void *cls, TALER_TESTING_cmd_merchant_post_account ( "instance-create-default-account", twister_merchant_url, - PAYTO_I1, + merchant_payto, NULL, NULL, MHD_HTTP_OK), TALER_TESTING_cmd_batch ("pay", @@ -452,14 +448,15 @@ main (int argc, cipher); GNUNET_free (cipher); } - payer_payto = - "payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME "?receiver-name=user"; - exchange_payto = - "payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME - "?receiver-name=exchange"; - merchant_payto = - "payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME - "?receiver-name=merchant"; + payer_payto.full_payto = + (char *) "payto://x-taler-bank/localhost/" USER_ACCOUNT_NAME + "?receiver-name=" USER_ACCOUNT_NAME; + exchange_payto.full_payto = + (char *) "payto://x-taler-bank/localhost/" EXCHANGE_ACCOUNT_NAME + "?receiver-name=" EXCHANGE_ACCOUNT_NAME; + merchant_payto.full_payto = + (char *) "payto://x-taler-bank/localhost/" MERCHANT_ACCOUNT_NAME + "?receiver-name=" MERCHANT_ACCOUNT_NAME; merchant_url = "http://localhost:8080/"; if (NULL == (twister_exchange_url = TALER_TWISTER_prepare_twister ( PROXY_EXCHANGE_config_file))) |