gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] 06/06: passing the "paygen" control to CMD


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 06/06: passing the "paygen" control to CMDs.
Date: Fri, 04 May 2018 16:19:50 +0200

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

marcello pushed a commit to branch master
in repository merchant.

commit 72e7044ff6a947d9df53de0143bf65b01334cceb
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri May 4 14:24:38 2018 +0200

    passing the "paygen" control to CMDs.
---
 .../taler-merchant-generate-payments_new.c         | 84 ++++++++++++++++++----
 1 file changed, 70 insertions(+), 14 deletions(-)

diff --git a/src/merchant-tools/taler-merchant-generate-payments_new.c 
b/src/merchant-tools/taler-merchant-generate-payments_new.c
index 0e47cc7..fb5939e 100644
--- a/src/merchant-tools/taler-merchant-generate-payments_new.c
+++ b/src/merchant-tools/taler-merchant-generate-payments_new.c
@@ -57,6 +57,15 @@ unsigned int payments_number;
  */
 unsigned int tracks_number;
 
+/**
+ * Merchant base URL.
+ */
+static char *merchant_url;
+
+/**
+ * Fakebank URL.
+ */
+static char *fakebank_url;
 
 /**
  * Actual commands collection.
@@ -65,6 +74,16 @@ static void
 run_commands (void *cls,
               struct TALER_TESTING_Interpreter *is)
 {
+
+
+  struct TALER_TESTING_Command commands[] = {
+
+    TALER_TESTING_cmd_end ()
+  };
+
+  TALER_TESTING_run_with_fakebank (is,
+                                   commands,
+                                   fakebank_url);
   return;
 }
 
@@ -86,13 +105,34 @@ run (void *cls,
 {
   TALER_LOG_DEBUG ("Using configuration file: %s\n", cfgfile);
 
-  if (NULL == (merchantd = TALER_TESTING_run_merchant (cfgfile)))
+  if (NULL == merchant_url)
   {
-    TALER_LOG_ERROR ("Failed to launch the merchant\n");
+    TALER_LOG_ERROR ("Option -m is mandatory!\n");
     result = 2;
     return;
   }
 
+  if (NULL == (merchantd = TALER_TESTING_run_merchant
+    (cfgfile, merchant_url)))
+  {
+    TALER_LOG_ERROR ("Failed to launch the merchant\n");
+    result = 3;
+    return;
+  }
+
+  result = 0;
+
+  if (NULL == (fakebank_url = TALER_TESTING_prepare_fakebank
+        (cfgfile, "account-1")))
+  {
+    TALER_LOG_ERROR ("Failed to prepare the fakebank\n");
+    result = 4;
+    GNUNET_OS_process_kill (merchantd, SIGTERM);
+    GNUNET_OS_process_wait (merchantd);
+    GNUNET_OS_process_destroy (merchantd);
+    return;
+  }
+
   /* Blocks.. */
   result = TALER_TESTING_setup_with_exchange (&run_commands,
                                               NULL,
@@ -101,7 +141,6 @@ run (void *cls,
   GNUNET_OS_process_kill (merchantd, SIGTERM);
   GNUNET_OS_process_wait (merchantd);
   GNUNET_OS_process_destroy (merchantd);
-
 }
 
 
@@ -119,17 +158,34 @@ main (int argc,
 
   struct GNUNET_GETOPT_CommandLineOption options[] = {
 
-    GNUNET_GETOPT_option_uint ('n',
-                               "payments-number",
-                               "PN",
-                               "will generate PN payments",
-                               &payments_number),
-
-    GNUNET_GETOPT_option_uint ('t',
-                               "tracks-number",
-                               "TN",
-                               "will perform TN /track operations",
-                               &tracks_number),
+    GNUNET_GETOPT_option_uint
+      ('n',
+       "payments-number",
+       "PN",
+       "will generate PN payments, defaults to 1",
+       &payments_number),
+
+    GNUNET_GETOPT_option_uint
+      ('t',
+       "tracks-number",
+       "TN",
+       "will perform TN /track operations, defaults to 1",
+       &tracks_number),
+
+    /**
+     * NOTE: useful when the setup serves merchant
+     * backends via unix domain sockets, since there
+     * is no way - yet? - to get the merchant base url.
+     * Clearly, we could introduce a merchant_base_url
+     * value into the configuration.
+     */
+    GNUNET_GETOPT_option_string
+      ('m',
+       "merchant-url",
+       "MU",
+       "merchant base url, mandatory",
+       &merchant_url),
+
     GNUNET_GETOPT_OPTION_END
   };
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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