summaryrefslogtreecommitdiff
path: root/src/merchant-tools/taler-merchant-benchmark.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/merchant-tools/taler-merchant-benchmark.c')
-rw-r--r--src/merchant-tools/taler-merchant-benchmark.c49
1 files changed, 29 insertions, 20 deletions
diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c
index b17fe83b..86c2d2bb 100644
--- a/src/merchant-tools/taler-merchant-benchmark.c
+++ b/src/merchant-tools/taler-merchant-benchmark.c
@@ -36,7 +36,7 @@
#include <taler/taler_error_codes.h>
#include "taler_merchant_testing_lib.h"
-#define PAYTO_I1 "payto://x-taler-bank/localhost/3"
+#define PAYTO_I1 "payto://x-taler-bank/localhost/42"
/**
* Maximum length of an amount (value plus currency string) needed by the test.
@@ -51,7 +51,7 @@
#define MAX_ORDER_LEN (MAX_AMOUNT_LEN * 4 + 2048)
-/* Error codes. */
+/* Error codes. */
enum PaymentGeneratorError
{
PG_SUCCESS = 0,
@@ -222,7 +222,7 @@ run (void *cls,
TALER_TESTING_cmd_merchant_post_orders ("create-proposal-1",
merchant_url,
MHD_HTTP_OK,
- "order-worth-5",
+ NULL, /* random order ID please */
GNUNET_TIME_UNIT_ZERO_ABS,
GNUNET_TIME_UNIT_FOREVER_ABS,
"EUR:5.0"),
@@ -259,12 +259,14 @@ run (void *cls,
TALER_TESTING_cmd_exec_aggregator ("aggregate-1",
cfg_filename),
+ TALER_TESTING_cmd_exec_transfer ("transfer-1",
+ cfg_filename),
TALER_TESTING_cmd_merchant_post_transfer (
"post-transfer-1",
&bc.exchange_auth,
bc.exchange_auth.wire_gateway_url,
merchant_url,
- "EUR:4.98", /* FIXME: check amount! */
+ "EUR:4.98",
MHD_HTTP_OK,
"deposit-simple-2",
NULL),
@@ -272,7 +274,7 @@ run (void *cls,
merchant_url,
bc.user42_payto,
MHD_HTTP_OK,
- "post-transaction-1",
+ "post-transfer-1",
NULL),
TALER_TESTING_cmd_rewind_ip ("rewind-tracks",
"track-transfer-1",
@@ -353,6 +355,8 @@ run (void *cls,
NULL),
TALER_TESTING_cmd_exec_aggregator ("aggregate-twocoins",
cfg_filename),
+ TALER_TESTING_cmd_exec_transfer ("transfer-twocoins",
+ cfg_filename),
TALER_TESTING_cmd_rewind_ip ("rewind-twocoins",
"create-reserve-2",
twocoins_number),
@@ -392,7 +396,7 @@ int
main (int argc,
char *const *argv)
{
- char *loglev = "INFO";
+ char *loglev = NULL;
char *logfile = NULL;
char *exchange_account = NULL;
char *alt_instance_id = NULL;
@@ -404,11 +408,22 @@ main (int argc,
GNUNET_GETOPT_option_version (PACKAGE_VERSION " " VCS_VERSION),
GNUNET_GETOPT_option_help ("Runs benchmark logic against merchant backend. "
"Must be used with either 'ordinary' or 'corner' sub-commands."),
+ GNUNET_GETOPT_option_string ('l',
+ "logfile",
+ "LF",
+ "will log to file LF",
+ &logfile),
+ GNUNET_GETOPT_option_loglevel (&loglev),
GNUNET_GETOPT_OPTION_END
};
struct GNUNET_GETOPT_CommandLineOption corner_options[] = {
- GNUNET_GETOPT_option_help ("Populate databases with corner case payments"),
+ GNUNET_GETOPT_option_string ('l',
+ "logfile",
+ "LF",
+ "will log to file LF",
+ &logfile),
GNUNET_GETOPT_option_loglevel (&loglev),
+ GNUNET_GETOPT_option_help ("Populate databases with corner case payments"),
GNUNET_GETOPT_option_uint ('u',
"unaggregated-number",
"UN",
@@ -447,19 +462,19 @@ main (int argc,
" as they would get those far future ones"
" aggregated too.",
&alt_instance_id)),
+ GNUNET_GETOPT_OPTION_END
+ };
+ struct GNUNET_GETOPT_CommandLineOption ordinary_options[] = {
GNUNET_GETOPT_option_string ('l',
"logfile",
"LF",
"will log to file LF",
&logfile),
- GNUNET_GETOPT_OPTION_END
- };
- struct GNUNET_GETOPT_CommandLineOption ordinary_options[] = {
+ GNUNET_GETOPT_option_loglevel (&loglev),
GNUNET_GETOPT_option_cfgfile (&cfg_filename),
GNUNET_GETOPT_option_version (PACKAGE_VERSION " " VCS_VERSION),
GNUNET_GETOPT_option_help ("Generate Taler ordinary payments"
" to populate the databases"),
- GNUNET_GETOPT_option_loglevel (&loglev),
GNUNET_GETOPT_option_mandatory (
GNUNET_GETOPT_option_string ('e',
"exchange-account",
@@ -481,20 +496,11 @@ main (int argc,
"TN",
"will perform TN /track operations, defaults to 1",
&tracks_number),
- GNUNET_GETOPT_option_string ('l',
- "logfile",
- "LF",
- "will log to file LF",
- &logfile),
GNUNET_GETOPT_OPTION_END
};
const char *default_config_file;
default_config_file = GNUNET_OS_project_data_get ()->user_config_file;
- loglev = NULL;
- GNUNET_log_setup ("taler-merchant-benchmark",
- loglev,
- logfile);
options = root_options;
if (NULL != argv[1])
{
@@ -524,6 +530,9 @@ main (int argc,
if (0 == result)
return PG_SUCCESS;
}
+ GNUNET_log_setup ("taler-merchant-benchmark",
+ loglev,
+ logfile);
if ( (! ordinary) &&
(! corner) )
{