gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] 03/04: do not force reset of bank in benchmark, allow s


From: gnunet
Subject: [taler-merchant] 03/04: do not force reset of bank in benchmark, allow skipping instance creation
Date: Sat, 31 Oct 2020 00:50:57 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

commit 152438820f015259726874b4695500e69f41a8a5
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Oct 30 23:39:24 2020 +0100

    do not force reset of bank in benchmark, allow skipping instance creation
---
 src/merchant-tools/taler-merchant-benchmark.c | 37 ++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/src/merchant-tools/taler-merchant-benchmark.c 
b/src/merchant-tools/taler-merchant-benchmark.c
index 349de80..b17fe83 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
@@ -105,6 +107,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).
  */
@@ -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);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]