diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-10-31 09:03:30 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-10-31 09:03:30 +0100 |
commit | f4be55340485c862c932675d2aeae083db8ed1c0 (patch) | |
tree | bf11cd7870c23f5c2c93f35dd5ef93e53d490002 /src/merchant-tools | |
parent | 84d7b090aadde0c8d85384180feb2084744d11a7 (diff) |
integrate creation of alt instance with merchant benchmark main logic
Diffstat (limited to 'src/merchant-tools')
-rw-r--r-- | src/merchant-tools/taler-merchant-benchmark.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c index 86c2d2bb..90aa972a 100644 --- a/src/merchant-tools/taler-merchant-benchmark.c +++ b/src/merchant-tools/taler-merchant-benchmark.c @@ -68,6 +68,11 @@ enum PaymentGeneratorError /** + * ID to use for the 'alternative' instance. + */ +static const char *alt_instance_id = "alt"; + +/** * What API key should we send in the HTTP 'Authorization' header? */ static char *apikey; @@ -296,6 +301,12 @@ run (void *cls, PAYTO_I1, "EUR", MHD_HTTP_NO_CONTENT), + TALER_TESTING_cmd_merchant_post_instances ("instance-create-alt", + merchant_url, + alt_instance_id, + PAYTO_I1, + "EUR", + MHD_HTTP_NO_CONTENT), TALER_TESTING_cmd_admin_add_incoming ("create-reserve-1", CURRENCY_5_01, &bc.exchange_auth, @@ -399,7 +410,6 @@ main (int argc, char *loglev = NULL; char *logfile = NULL; char *exchange_account = NULL; - char *alt_instance_id = NULL; struct GNUNET_OS_Process *bankd; struct GNUNET_OS_Process *merchantd; struct GNUNET_GETOPT_CommandLineOption *options; @@ -423,6 +433,7 @@ main (int argc, "will log to file LF", &logfile), GNUNET_GETOPT_option_loglevel (&loglev), + GNUNET_GETOPT_option_cfgfile (&cfg_filename), GNUNET_GETOPT_option_help ("Populate databases with corner case payments"), GNUNET_GETOPT_option_uint ('u', "unaggregated-number", @@ -449,19 +460,6 @@ main (int argc, "APIKEY", "HTTP 'Authorization' header to send to the merchant", &apikey), - GNUNET_GETOPT_option_mandatory ( - GNUNET_GETOPT_option_string ('i', - "alt-instance", - "AI", - "alternative (non default) instance," - " used to provide fresh wire details to" - " make unaggregated transactions stay so." - " Note, this instance will be given far" - " future wire deadline, and so it should" - " never author now-deadlined transactions," - " as they would get those far future ones" - " aggregated too.", - &alt_instance_id)), GNUNET_GETOPT_OPTION_END }; struct GNUNET_GETOPT_CommandLineOption ordinary_options[] = { @@ -570,13 +568,12 @@ main (int argc, TALER_LOG_ERROR ("Failed to prepare for the merchant\n"); return PG_FAILED_TO_PREPARE_MERCHANT; } - if (NULL != alt_instance_id) - { - GNUNET_assert (0 < GNUNET_asprintf (&alt_instance_url, - "%s/instances/%s/", - merchant_url, - alt_instance_id)); - } + GNUNET_assert (0 < strlen (merchant_url)); + GNUNET_assert (merchant_url[strlen(merchant_url)-1] == '/'); + GNUNET_assert (0 < GNUNET_asprintf (&alt_instance_url, + "%sinstances/%s/", + merchant_url, + alt_instance_id)); if (GNUNET_OK != TALER_TESTING_prepare_bank (cfg_filename, GNUNET_NO, |