gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r21735 - gnunet/src/testing


From: gnunet
Subject: [GNUnet-SVN] r21735 - gnunet/src/testing
Date: Sun, 3 Jun 2012 11:04:50 +0200

Author: harsha
Date: 2012-06-03 11:04:50 +0200 (Sun, 03 Jun 2012)
New Revision: 21735

Modified:
   gnunet/src/testing/test_testing_new_peerstartup.c
   gnunet/src/testing/test_testing_new_servicestartup.c
   gnunet/src/testing/testing_new.c
Log:
-arm now starts childs with custom config

Modified: gnunet/src/testing/test_testing_new_peerstartup.c
===================================================================
--- gnunet/src/testing/test_testing_new_peerstartup.c   2012-06-02 23:11:22 UTC 
(rev 21734)
+++ gnunet/src/testing/test_testing_new_peerstartup.c   2012-06-03 09:04:50 UTC 
(rev 21735)
@@ -120,7 +120,7 @@
   /* LOG (GNUNET_ERROR_TYPE_ERROR, */
   /*      "Temporary directory: %s\n", tmpdir); */
   system = GNUNET_TESTING_system_create (tmpdir,
-                                         "localhost");
+                                         "127.0.0.1");
   GNUNET_assert (NULL != system);
   GNUNET_free (tmpdir);
   data_dir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);

Modified: gnunet/src/testing/test_testing_new_servicestartup.c
===================================================================
--- gnunet/src/testing/test_testing_new_servicestartup.c        2012-06-02 
23:11:22 UTC (rev 21734)
+++ gnunet/src/testing/test_testing_new_servicestartup.c        2012-06-03 
09:04:50 UTC (rev 21735)
@@ -25,6 +25,7 @@
  */
 
 #include "platform.h"
+#include "gnunet_scheduler_lib.h"
 #include "gnunet_testing_lib-new.h"
 
 

Modified: gnunet/src/testing/testing_new.c
===================================================================
--- gnunet/src/testing/testing_new.c    2012-06-02 23:11:22 UTC (rev 21734)
+++ gnunet/src/testing/testing_new.c    2012-06-03 09:04:50 UTC (rev 21735)
@@ -597,7 +597,7 @@
   if (NULL == uc->system->controller)
     allowed_hosts = GNUNET_strdup (orig_allowed_hosts);
   else
-    GNUNET_asprintf (&allowed_hosts, "%s %s;", orig_allowed_hosts,
+    GNUNET_asprintf (&allowed_hosts, "%s%s;", orig_allowed_hosts,
                      uc->system->controller);
   GNUNET_free (orig_allowed_hosts);
   GNUNET_CONFIGURATION_set_value_string (uc->cfg, section, "ACCEPT_FROM",
@@ -625,12 +625,17 @@
                                     struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct UpdateContext uc;
+  char *default_config;
   
   uc.system = system;
   uc.cfg = cfg;
   uc.status = GNUNET_OK;
   GNUNET_asprintf (&uc.service_home, "%s/%u", system->tmppath,
                    system->path_counter++);
+  GNUNET_asprintf (&default_config, "%s/config", uc.service_home);
+  GNUNET_CONFIGURATION_set_value_string (cfg, "PATHS", "DEFAULTCONFIG",
+                                         default_config);
+  GNUNET_free (default_config);
   GNUNET_CONFIGURATION_set_value_string (cfg, "PATHS", "SERVICEHOME",
                                          uc.service_home);
   /* make PORTs and UNIXPATHs unique */
@@ -716,6 +721,7 @@
                                                         &service_home));
   GNUNET_snprintf (hostkey_filename, sizeof (hostkey_filename), "%s/.hostkey",
                    service_home);
+  GNUNET_free (service_home);
   fd = GNUNET_DISK_file_open (hostkey_filename,
                               GNUNET_DISK_OPEN_CREATE | GNUNET_DISK_OPEN_WRITE,
                               GNUNET_DISK_PERM_USER_READ 
@@ -743,8 +749,9 @@
     return NULL;
   }
   GNUNET_DISK_file_close (fd);
-  GNUNET_asprintf (&config_filename, "%s/config", service_home);
-  GNUNET_free (service_home);
+  GNUNET_assert (GNUNET_OK ==
+                 GNUNET_CONFIGURATION_get_value_string 
+                 (cfg, "PATHS", "DEFAULTCONFIG", &config_filename));  
   if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, config_filename))
   {
     GNUNET_asprintf (&emsg_,
@@ -757,6 +764,7 @@
       *emsg = emsg_;
     else
       GNUNET_free (emsg_);
+    GNUNET_free (config_filename);
     return NULL;
   }
   peer = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Peer));
@@ -782,7 +790,9 @@
   }
   GNUNET_assert (NULL != peer->cfgfile);
   peer->main_process = GNUNET_OS_start_process (GNUNET_NO, NULL, NULL,
-                                                peer->main_binary, "-c",
+                                                peer->main_binary,
+                                                peer->main_binary,
+                                                "-c",
                                                 peer->cfgfile,
                                                 NULL);
   if (NULL == peer->main_process)
@@ -939,7 +949,7 @@
   data_dir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
   GNUNET_asprintf (&hostkeys_file, "%s/testing_hostkeys.dat", data_dir);
   GNUNET_free (data_dir);  
-  system = GNUNET_TESTING_system_create (tmppath, "localhost");
+  system = GNUNET_TESTING_system_create (tmppath, "127.0.0.1");
   if (NULL == system)
   {
     GNUNET_free (hostkeys_file);




reply via email to

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