gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] 05/06: Explicit merchant URL.


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 05/06: Explicit merchant URL.
Date: Fri, 04 May 2018 16:19:49 +0200

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

marcello pushed a commit to branch master
in repository merchant.

commit 323d84d4eb6228e036d96726b7715f9a024df682
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri May 4 11:24:54 2018 +0200

    Explicit merchant URL.
    
    Merchant launcher for tests now takes the merchant
    URL among its parameters.  This gives more flexibility,
    as it is now possible to run a merchant which listens
    on unix sockets.
---
 src/include/taler_merchant_testing_lib.h |  3 ++-
 src/lib/test_merchant_api_new.c          |  2 +-
 src/lib/test_merchant_api_twisted.c      |  2 +-
 src/lib/testing_api_helpers.c            | 31 ++++++-------------------------
 4 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/src/include/taler_merchant_testing_lib.h 
b/src/include/taler_merchant_testing_lib.h
index 67ca40a..8394fc4 100644
--- a/src/include/taler_merchant_testing_lib.h
+++ b/src/include/taler_merchant_testing_lib.h
@@ -62,7 +62,8 @@ TALER_TESTING_prepare_merchant (const char *config_filename);
  *         be started.
  */
 struct GNUNET_OS_Process *
-TALER_TESTING_run_merchant (const char *config_filename);
+TALER_TESTING_run_merchant (const char *config_filename,
+                            const char *merchant_url);
 
 /* ******************* Generic interpreter logic ************ */
 
diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c
index 7f2452f..9e5ebde 100644
--- a/src/lib/test_merchant_api_new.c
+++ b/src/lib/test_merchant_api_new.c
@@ -856,7 +856,7 @@ main (int argc,
   case GNUNET_OK:
 
     if (NULL == (merchantd =
-        TALER_TESTING_run_merchant (CONFIG_FILE)))
+        TALER_TESTING_run_merchant (CONFIG_FILE, merchant_url)))
       return 1;
 
     ret = TALER_TESTING_setup_with_exchange (&run,
diff --git a/src/lib/test_merchant_api_twisted.c 
b/src/lib/test_merchant_api_twisted.c
index e17a4d2..5ff2109 100644
--- a/src/lib/test_merchant_api_twisted.c
+++ b/src/lib/test_merchant_api_twisted.c
@@ -854,7 +854,7 @@ main (int argc,
   case GNUNET_OK:
 
     if (NULL == (merchantd = TALER_TESTING_run_merchant
-        (CONFIG_FILE)))
+        (CONFIG_FILE, merchant_url)))
       // 1 is fine; after all this is merchant test cases.
       return 1;
 
diff --git a/src/lib/testing_api_helpers.c b/src/lib/testing_api_helpers.c
index 43ace62..9bccd4d 100644
--- a/src/lib/testing_api_helpers.c
+++ b/src/lib/testing_api_helpers.c
@@ -41,33 +41,13 @@
  *         be started.
  */
 struct GNUNET_OS_Process *
-TALER_TESTING_run_merchant (const char *config_filename)
+TALER_TESTING_run_merchant (const char *config_filename,
+                            const char *merchant_url)
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg;
   struct GNUNET_OS_Process *merchant_proc;
   unsigned int iter;
-  unsigned long long port;
   char *wget_cmd;
 
-  cfg = GNUNET_CONFIGURATION_create ();
-  if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_load (cfg,
-                                 config_filename))
-    MERCHANT_FAIL ();
-  if (GNUNET_OK !=
-      GNUNET_CONFIGURATION_get_value_number (cfg,
-                                             "merchant",
-                                             "PORT",
-                                             &port))
-  {
-    GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
-                               "merchant",
-                               "PORT");
-    GNUNET_CONFIGURATION_destroy (cfg);
-    MERCHANT_FAIL ();
-  }
-  GNUNET_CONFIGURATION_destroy (cfg);
-
   merchant_proc
     = GNUNET_OS_start_process (GNUNET_NO,
                                GNUNET_OS_INHERIT_STD_ALL,
@@ -80,9 +60,9 @@ TALER_TESTING_run_merchant (const char *config_filename)
     MERCHANT_FAIL ();
 
   GNUNET_asprintf (&wget_cmd,
-                   "wget -q -t 1 -T 1 http://127.0.0.1:%llu/";
+                   "wget -q -t 1 -T 1 %s"
                    " -o /dev/null -O /dev/null",
-                   port);
+                   merchant_url);
 
   /* give child time to start and bind against the socket */
   fprintf (stderr,
@@ -93,7 +73,8 @@ TALER_TESTING_run_merchant (const char *config_filename)
       if (10 == iter)
       {
        fprintf (stderr,
-                 "Failed to launch `taler-merchant-httpd' (or `wget')\n");
+                 "Failed to launch"
+                 " `taler-merchant-httpd' (or `wget')\n");
        GNUNET_OS_process_kill (merchant_proc,
                                SIGTERM);
        GNUNET_OS_process_wait (merchant_proc);

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



reply via email to

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