gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] 04/06: merchant gets launched but wget fai


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 04/06: merchant gets launched but wget fails to detect it.
Date: Fri, 04 May 2018 16:19:48 +0200

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

marcello pushed a commit to branch master
in repository merchant.

commit 0bc6d5162438fc0b333c6b052337023f74268d3d
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri May 4 11:15:58 2018 +0200

    merchant gets launched but wget fails to detect it.
---
 src/lib/test_merchant_api_new.c                    |  5 +-
 .../taler-merchant-generate-payments_new.c         | 76 +++++++++++++++++-----
 2 files changed, 61 insertions(+), 20 deletions(-)

diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c
index 0559a63..7f2452f 100644
--- a/src/lib/test_merchant_api_new.c
+++ b/src/lib/test_merchant_api_new.c
@@ -834,8 +834,9 @@ main (int argc,
                     NULL);
 
   if (NULL ==
-      (fakebank_url = TALER_TESTING_prepare_fakebank (CONFIG_FILE,
-                                                      "account-exchange")))
+      (fakebank_url = TALER_TESTING_prepare_fakebank
+        (CONFIG_FILE,
+         "account-exchange")))
     return 77;
   if (NULL ==
       (merchant_url = TALER_TESTING_prepare_merchant (CONFIG_FILE)))
diff --git a/src/merchant-tools/taler-merchant-generate-payments_new.c 
b/src/merchant-tools/taler-merchant-generate-payments_new.c
index b29dae4..0e47cc7 100644
--- a/src/merchant-tools/taler-merchant-generate-payments_new.c
+++ b/src/merchant-tools/taler-merchant-generate-payments_new.c
@@ -2,16 +2,19 @@
   This file is part of TALER
   (C) 2014-2018 Taler Systems SA
 
-  TALER is free software; you can redistribute it and/or modify it under the
-  terms of the GNU Affero General Public License as published by the Free 
Software
-  Foundation; either version 3, or (at your option) any later version.
+  TALER is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Affero General Public License as
+  published by the Free Software Foundation; either version 3, or
+  (at your option) any later version.
 
-  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
-  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+  TALER is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
 
-  You should have received a copy of the GNU General Public License along with
-  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+  You should have received a copy of the GNU General Public License
+  along with TALER; see the file COPYING.  If not,
+  see <http://www.gnu.org/licenses/>
 */
 
 /**
@@ -35,6 +38,16 @@
 #include "taler_merchant_testing_lib.h"
 
 /**
+ * Exit code.
+ */
+unsigned int result = 1;
+
+/**
+ * Merchant process.
+ */
+static struct GNUNET_OS_Process *merchantd;
+
+/**
  * How many payments we want to generate.
  */
 unsigned int payments_number;
@@ -44,13 +57,25 @@ unsigned int payments_number;
  */
 unsigned int tracks_number;
 
+
 /**
- * Main function that will be run by the scheduler.
+ * Actual commands collection.
+ */
+static void
+run_commands (void *cls,
+              struct TALER_TESTING_Interpreter *is)
+{
+  return;
+}
+
+/**
+ * Main function that will be run by the scheduler,
+ * mainly needed to get the configuration filename to use.
  *
  * @param cls closure
  * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be
- *        NULL!)
+ * @param cfgfile name of the configuration file
+ *        used (for saving, can be NULL!)
  * @param config configuration
  */
 static void
@@ -60,6 +85,23 @@ run (void *cls,
      const struct GNUNET_CONFIGURATION_Handle *config)
 {
   TALER_LOG_DEBUG ("Using configuration file: %s\n", cfgfile);
+
+  if (NULL == (merchantd = TALER_TESTING_run_merchant (cfgfile)))
+  {
+    TALER_LOG_ERROR ("Failed to launch the merchant\n");
+    result = 2;
+    return;
+  }
+
+  /* Blocks.. */
+  result = TALER_TESTING_setup_with_exchange (&run_commands,
+                                              NULL,
+                                              cfgfile);
+
+  GNUNET_OS_process_kill (merchantd, SIGTERM);
+  GNUNET_OS_process_wait (merchantd);
+  GNUNET_OS_process_destroy (merchantd);
+
 }
 
 
@@ -91,11 +133,9 @@ main (int argc,
     GNUNET_GETOPT_OPTION_END
   };
 
-  if (GNUNET_OK !=
-      GNUNET_PROGRAM_run (argc, argv,
-                          "taler-merchant-generate-payments-new",
-                          "Populate the database with payments",
-                          options, &run, NULL))
-    return 1;
-  return 0;
+  GNUNET_PROGRAM_run (argc, argv,
+                      "taler-merchant-generate-payments-new",
+                      "Populate the database with payments",
+                      options, &run, NULL);
+  return result;
 }

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



reply via email to

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