gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6118 - GNUnet/src/applications/testing


From: gnunet
Subject: [GNUnet-SVN] r6118 - GNUnet/src/applications/testing
Date: Wed, 23 Jan 2008 19:03:45 -0700 (MST)

Author: nevans
Date: 2008-01-23 19:03:45 -0700 (Wed, 23 Jan 2008)
New Revision: 6118

Removed:
   GNUnet/src/applications/testing/remotetesting.c
Modified:
   GNUnet/src/applications/testing/Makefile.am
   GNUnet/src/applications/testing/testing.c
   GNUnet/src/applications/testing/testingtest.c
Log:


Modified: GNUnet/src/applications/testing/Makefile.am
===================================================================
--- GNUnet/src/applications/testing/Makefile.am 2008-01-23 22:26:22 UTC (rev 
6117)
+++ GNUnet/src/applications/testing/Makefile.am 2008-01-24 02:03:45 UTC (rev 
6118)
@@ -14,6 +14,7 @@
 
 check_PROGRAMS = \
   testingtest \
+  remotetesting \
   testingtest_loop
 
 TESTS = $(check_PROGRAMS)
@@ -24,7 +25,13 @@
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/applications/testing/libgnunettesting_api.la
 
+remotetesting_SOURCES = \
+ remotetesting.c
+remotetesting_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/applications/testing/libgnunettesting_api.la
 
+
 testingtest_loop_SOURCES = \
  testingtest_loop.c 
 testingtest_loop_LDADD = \

Deleted: GNUnet/src/applications/testing/remotetesting.c
===================================================================
--- GNUnet/src/applications/testing/remotetesting.c     2008-01-23 22:26:22 UTC 
(rev 6117)
+++ GNUnet/src/applications/testing/remotetesting.c     2008-01-24 02:03:45 UTC 
(rev 6118)
@@ -1,101 +0,0 @@
-/*
-     This file is part of GNUnet.
-     (C) 2007 Christian Grothoff (and other contributing authors)
-
-     GNUnet is free software; you can redistribute it and/or modify
-     it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
-     option) any later version.
-
-     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file applications/testing/testingtest.c
- * @brief testcase for testing library
- * @author Christian Grothoff
- */
-
-#include "platform.h"
-#include "gnunet_protocols.h"
-#include "gnunet_testing_lib.h"
-
-/**
- * Testcase
- * @return 0: ok, -1: error
- */
-int
-main (int argc, const char **argv)
-{  
-  static char *configFile = "/tmp/fake.conf";
-  static char *path;
-  int ret = 0;
-  int res;
-  struct GNUNET_GC_Configuration *cfg;
-  struct GNUNET_GE_Context *ectx;
-  
-
-static struct GNUNET_CommandLineOption gnunetstatsOptions[] = {
-  GNUNET_COMMAND_LINE_OPTION_CFG_FILE (&configFile),   /* -c */
-  GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Print statistics about 
GNUnet operations.")), /* -h */
-  GNUNET_COMMAND_LINE_OPTION_HOSTNAME,  /* -H */
-  GNUNET_COMMAND_LINE_OPTION_LOGGING,   /* -L */
-  GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
-  GNUNET_COMMAND_LINE_OPTION_END,
-};
-
-  
-
-  res = GNUNET_init (argc,
-                     argv,
-                     "testingtest",
-                     &configFile, gnunetstatsOptions, &ectx, &cfg);
-  if (res == -1)
-    {
-      GNUNET_fini (ectx, cfg);
-      return -1;
-    }
-
-  GNUNET_GC_get_configuration_value_filename(cfg,"","CONFIG","",&path);
-  
-  configFile = strcat(path,configFile);
-    
-    
-    struct GNUNET_GC_Configuration *hostConfig;
-    
-    if (GNUNET_OK != GNUNET_TESTING_read_config (path,&hostConfig))
-    {
-       printf("Problem with main host configuration file...\n");
-       exit(1);        
-    }
-    
-    if (GNUNET_TESTING_check_config(&hostConfig) != GNUNET_OK)
-    {
-       printf("Problem with main host configuration file...\n");
-       exit(1);        
-    }
-                      
-       char *one = "/u/home9/natevans/gnunet/GNUnet/";
-       char *two = "/tmp/";
-       char *three = "/u/home9/natevans/configs/";
-       char *four = "130.253.191.151";
-       char *five = "natevans";
-       char *six = "gnunetd.xxxxx";
-       
-       
-       GNUNET_TESTING_start_single_remote_daemon(one,two,six,three,four,five);
-       
-       GNUNET_TESTING_parse_config_start_daemons(&hostConfig);
-       
-  return ret;
-}
-
-/* end of testingtest.c */

Modified: GNUnet/src/applications/testing/testing.c
===================================================================
--- GNUnet/src/applications/testing/testing.c   2008-01-23 22:26:22 UTC (rev 
6117)
+++ GNUnet/src/applications/testing/testing.c   2008-01-24 02:03:45 UTC (rev 
6118)
@@ -412,31 +412,28 @@
   return ret;
 }
 
-int GNUNET_TESTING_read_config(const char *config_file,struct 
GNUNET_GC_Configuration **newcfg)
+int GNUNET_TESTING_remote_read_config(const char *config_file,struct 
GNUNET_GC_Configuration **newcfg)
 {
        struct GNUNET_GC_Configuration *cfg;
                
-       if (config_file == NULL) {
-               printf("config_file is null pointer\n");
+       if (config_file == NULL) 
                return GNUNET_SYSERR;
+       
+       cfg = GNUNET_GC_create ();
+       if (-1 == GNUNET_GC_parse_configuration (cfg, config_file))
+       {
+         fprintf (stderr,
+                 "Failed to read configuration file `%s'\n", config_file);
+         GNUNET_GC_free (cfg);
+         return GNUNET_SYSERR;
        }
-       else {
-               cfg = GNUNET_GC_create ();
-               if (-1 == GNUNET_GC_parse_configuration (cfg, config_file))
-               {
-                       printf("Problem parsing config file...\n");
-                         fprintf (stderr,
-                                  "Failed to read configuration file `%s'\n", 
config_file);
-                         GNUNET_GC_free (cfg);
-                         return GNUNET_SYSERR;
-               }
-               printf("Assigning new config to return pointer\n");
-               *newcfg = cfg;
-       }
+       
+       *newcfg = cfg;
+       
        return GNUNET_OK;       
 }
 
-int GNUNET_TESTING_check_config(struct GNUNET_GC_Configuration **newcfg)
+int GNUNET_TESTING_remote_check_config(struct GNUNET_GC_Configuration **newcfg)
 {
        if (GNUNET_NO == 
GNUNET_GC_have_configuration_value(*newcfg,"MULTIPLE_SERVER_TESTING","SSH_USERNAME"))
                return GNUNET_SYSERR;
@@ -476,7 +473,7 @@
  * @param username username to use for ssh (assumed to be used with ssh-agent)
  */
 int
-GNUNET_TESTING_start_single_remote_daemon (char *gnunetd_home,
+GNUNET_TESTING_remote_start_daemon (char *gnunetd_home,
                              char *localConfigPath,char *configFileName,char 
*remote_config_path,char *ip_address,
                              char *username)
 {
@@ -520,7 +517,7 @@
 }
 
 int
-GNUNET_TESTING_parse_config_start_daemons(struct GNUNET_GC_Configuration 
**newcfg)
+GNUNET_TESTING_remote_start_daemons(struct GNUNET_GC_Configuration **newcfg)
 {
        const unsigned long long MIN_STARTING_PORT = 1001;
        const unsigned long long MAX_STARTING_PORT = 30000;

Modified: GNUnet/src/applications/testing/testingtest.c
===================================================================
--- GNUnet/src/applications/testing/testingtest.c       2008-01-23 22:26:22 UTC 
(rev 6117)
+++ GNUnet/src/applications/testing/testingtest.c       2008-01-24 02:03:45 UTC 
(rev 6118)
@@ -41,8 +41,40 @@
   GNUNET_PeerIdentity p2;
   char *c1 = NULL;
   char *c2 = NULL;
+  static char *configFile = "/tmp/fake.conf";
+  static char *path;
   int ret = 0;
+  int res;
+  struct GNUNET_GC_Configuration *cfg;
+  struct GNUNET_GE_Context *ectx;
+  
 
+static struct GNUNET_CommandLineOption gnunetstatsOptions[] = {
+  GNUNET_COMMAND_LINE_OPTION_CFG_FILE (&configFile),   /* -c */
+  GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Print statistics about 
GNUnet operations.")), /* -h */
+  GNUNET_COMMAND_LINE_OPTION_HOSTNAME,  /* -H */
+  GNUNET_COMMAND_LINE_OPTION_LOGGING,   /* -L */
+  GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+  GNUNET_COMMAND_LINE_OPTION_END,
+};
+
+  
+
+  res = GNUNET_init (argc,
+                     argv,
+                     "testingtest",
+                     &configFile, gnunetstatsOptions, &ectx, &cfg);
+  if (res == -1)
+    {
+      GNUNET_fini (ectx, cfg);
+      return -1;
+    }
+
+  GNUNET_GC_get_configuration_value_filename(cfg,"","CONFIG","",&path);
+  
+  configFile = strcat(path,configFile);
+  
+  
   if (GNUNET_OK != GNUNET_TESTING_start_daemon (12087,
                                                 10000,
                                                 "/tmp/gnunet-testing-1",
@@ -73,6 +105,7 @@
       UNLINK (c2);
       GNUNET_free (c2);
     }
+    
   return ret;
 }
 





reply via email to

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