diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-10-30 23:39:24 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-10-30 23:39:24 +0100 |
commit | 152438820f015259726874b4695500e69f41a8a5 (patch) | |
tree | 5be8353e615b964c920095495e901f2bdee896ee /src/merchant-tools | |
parent | e0a86681bd00f5146a393167187239711fa33f5f (diff) |
do not force reset of bank in benchmark, allow skipping instance creation
Diffstat (limited to 'src/merchant-tools')
-rw-r--r-- | src/merchant-tools/taler-merchant-benchmark.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c index 349de80f..b17fe83b 100644 --- a/src/merchant-tools/taler-merchant-benchmark.c +++ b/src/merchant-tools/taler-merchant-benchmark.c @@ -36,6 +36,8 @@ #include <taler/taler_error_codes.h> #include "taler_merchant_testing_lib.h" +#define PAYTO_I1 "payto://x-taler-bank/localhost/3" + /** * Maximum length of an amount (value plus currency string) needed by the test. * We have a 32-bit and a 64-bit value (~48 characters), plus the currency, plus @@ -106,6 +108,11 @@ static unsigned int payments_number = 1; static unsigned int tracks_number = 1; /** + * Skip instance creation? + */ +static int skip_instance = 0; + +/** * Config filename to give to commands (like wirewatch). */ static char *cfg_filename; @@ -192,6 +199,12 @@ run (void *cls, if (ordinary) { struct TALER_TESTING_Command ordinary_commands[] = { + TALER_TESTING_cmd_merchant_post_instances ("instance-create-default", + merchant_url, + "default", + PAYTO_I1, + "EUR", + MHD_HTTP_NO_CONTENT), TALER_TESTING_cmd_admin_add_incoming ("create-reserve-1", CURRENCY_10_02, &bc.exchange_auth, @@ -222,7 +235,7 @@ run (void *cls, CURRENCY_4_99, NULL), TALER_TESTING_cmd_rewind_ip ("rewind-payments", - "create-reserve", + "create-reserve-1", payments_number), /* Next proposal-pay cycle will be used by /track CMDs * and so it will not have to be looped over, only /track @@ -268,13 +281,19 @@ run (void *cls, }; TALER_TESTING_run (is, - ordinary_commands); + &ordinary_commands[skip_instance]); return; } if (corner) /* should never be 'false' here */ { struct TALER_TESTING_Command corner_commands[] = { + TALER_TESTING_cmd_merchant_post_instances ("instance-create-default", + merchant_url, + "default", + PAYTO_I1, + "EUR", + MHD_HTTP_NO_CONTENT), TALER_TESTING_cmd_admin_add_incoming ("create-reserve-1", CURRENCY_5_01, &bc.exchange_auth, @@ -341,7 +360,7 @@ run (void *cls, }; TALER_TESTING_run (is, - corner_commands); + &corner_commands[skip_instance]); return; } } @@ -375,8 +394,8 @@ main (int argc, { char *loglev = "INFO"; char *logfile = NULL; - char *exchange_account; - char *alt_instance_id; + char *exchange_account = NULL; + char *alt_instance_id = NULL; struct GNUNET_OS_Process *bankd; struct GNUNET_OS_Process *merchantd; struct GNUNET_GETOPT_CommandLineOption *options; @@ -395,6 +414,10 @@ main (int argc, "UN", "will generate UN unaggregated payments, defaults to 1", &unaggregated_number), + GNUNET_GETOPT_option_flag ('s', + "skip-instance", + "skip creating the backend default instance (use if the instance already exists with the backend)", + &skip_instance), GNUNET_GETOPT_option_uint ('t', "two-coins", "TC", @@ -547,7 +570,7 @@ main (int argc, } if (GNUNET_OK != TALER_TESTING_prepare_bank (cfg_filename, - GNUNET_YES, + GNUNET_NO, exchange_account, &bc)) { @@ -573,7 +596,7 @@ main (int argc, { int result; - result = TALER_TESTING_setup_with_exchange (run, + result = TALER_TESTING_setup_with_exchange (&run, NULL, cfg_filename); terminate_process (merchantd); |