diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-09-23 18:39:17 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-09-23 18:39:17 +0200 |
commit | 63994abe1e2780d3a43e261090d3261e8d91a854 (patch) | |
tree | 2d2fb235f05d12fcd5d9ea9c34be29c6e37b51c5 /src/merchant-tools/taler-merchant-benchmark.c | |
parent | 7d50af6651ea4e0a15960434e1d574596552ead7 (diff) |
implement instances via one base URL per instance
Previously, instances were addressed in various ways depending on then
request (GET parameter, some instance_id in the POST body). With this
commit, users of the merchant backend don't see the instance, they just
see another base URL.
Diffstat (limited to 'src/merchant-tools/taler-merchant-benchmark.c')
-rw-r--r-- | src/merchant-tools/taler-merchant-benchmark.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c index bf34a7e7..9bd80ff8 100644 --- a/src/merchant-tools/taler-merchant-benchmark.c +++ b/src/merchant-tools/taler-merchant-benchmark.c @@ -95,7 +95,12 @@ char *root_help_str = \ /** * Alternative non default instance. */ -static char *alt_instance; +static char *alt_instance_id; + +/** + * Base URL of the alternative non default instance. + */ +static char *alt_instance_url; /** * How many unaggregated payments we want to generate. @@ -349,8 +354,7 @@ run (void *cls, ("create-proposal-1", merchant_url, MHD_HTTP_OK, - order_worth_5, - NULL), + order_worth_5), TALER_TESTING_cmd_pay ("deposit-simple", @@ -375,8 +379,7 @@ run (void *cls, ("create-proposal-2", merchant_url, MHD_HTTP_OK, - order_worth_5_track, - NULL), + order_worth_5_track), TALER_TESTING_cmd_pay ("deposit-simple-2", @@ -432,10 +435,9 @@ run (void *cls, TALER_TESTING_cmd_proposal ("create-unaggregated-proposal", - merchant_url, + alt_instance_url, MHD_HTTP_OK, - order_worth_5_unaggregated, - alt_instance), + order_worth_5_unaggregated), TALER_TESTING_cmd_pay ("deposit-unaggregated", @@ -476,8 +478,7 @@ run (void *cls, ("create-twocoins-proposal", merchant_url, MHD_HTTP_OK, - order_worth_10_2coins, - NULL), + order_worth_10_2coins), TALER_TESTING_cmd_pay ("deposit-twocoins", @@ -629,7 +630,7 @@ main (int argc, " never author now-deadlined transactions," " as they would get those far future ones" " aggregated too.", - &alt_instance), + &alt_instance_id), GNUNET_GETOPT_option_string ('b', @@ -755,7 +756,7 @@ main (int argc, return 1; } - if ((GNUNET_YES == corner) && (NULL == alt_instance)) + if ((GNUNET_YES == corner) && (NULL == alt_instance_id)) { fprintf (stderr, "option '-i' is mandatory" " with sub-command 'corner'!\n"); @@ -777,6 +778,14 @@ main (int argc, return MISSING_MERCHANT_URL; } + if (NULL != alt_instance_id) + { + GNUNET_assert (0 < GNUNET_asprintf (&alt_instance_url, + "%s/instances/%s/", + merchant_url, + &alt_instance_id)); + } + if (NULL == (merchantd = TALER_TESTING_run_merchant (cfg_filename, merchant_url))) { |