remove debugging from testcases, testing now used gnunet-arm to run and stop gnunet...
authorNathan S. Evans <evans@in.tum.de>
Mon, 29 Mar 2010 17:05:32 +0000 (17:05 +0000)
committerNathan S. Evans <evans@in.tum.de>
Mon, 29 Mar 2010 17:05:32 +0000 (17:05 +0000)
src/testing/test_testing.c
src/testing/test_testing_connect.c
src/testing/test_testing_group.c
src/testing/test_testing_topology.c
src/testing/testing.c
src/testing/testing_group.c

index 15b7e10ec21210ee1bc30218d94370f8b9a14a93..4a014de6602b109d5533ee7caaeccb86fce5c81b 100644 (file)
@@ -101,8 +101,7 @@ main (int argc, char *argv[])
 #endif
                     NULL);
   ret = check ();
-  sleep (1);                    /* FIXME: make this unnecessary */
-  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing");
+
   return ret;
 }
 
index 5cd6274ea29e087af263a26e461e4c7843bd9bfc..15cc695bcbe9cdc5f7e7382563b3d82f8e7d2986 100644 (file)
@@ -170,10 +170,10 @@ main (int argc, char *argv[])
 #endif
                     NULL);
   ret = check ();
-  sleep (1);
+  /*sleep (1);
   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing");
   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing-connect-peer1");
-  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing-connect-peer2");
+  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing-connect-peer2");*/
   return ret;
 }
 
index 2b6df732eb2cd18824b0799d99f2664830ba29ba..1f21b64f43aa869e24e77654bf81b0b211c7659c 100644 (file)
@@ -109,7 +109,13 @@ main (int argc, char *argv[])
 #endif
                     NULL);
   ret = check ();
-  sleep (1);
+  /**
+   * Still need to remove the base testing directory here,
+   * because group starts will create subdirectories under this
+   * main dir.  However, we no longer need to sleep, as the
+   * shutdown sequence won't return until everything is cleaned
+   * up.
+   */
   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing");
   return ret;
 }
index c3d9cfda85ab2df8234b14b468cdd241b962fa75..7f5411fc45bfd2bcdc9dee08a9ace1e53bbe39ec 100644 (file)
@@ -619,7 +619,11 @@ main (int argc, char *argv[])
 #endif
                     NULL);
   ret = check ();
-  sleep (1);
+
+  /**
+   * Need to remove base directory, subdirectories taken care
+   * of by the testing framework.
+   */
   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-testing");
   GNUNET_free(our_binary_name);
   return ret;
index a18e7b88bbc3c1c76ae0847ab9239fa298a4c904..a1bbb4f70a6714d1b25d7949503c6c1f40e97a2f 100644 (file)
@@ -168,13 +168,13 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
       /* start GNUnet on remote host */
       if (NULL == d->hostname)
         {
-          d->pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
-                                            "gnunet-service-arm",
+          d->pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-arm",
+                                            "gnunet-arm",
                                             "-c", d->cfgfile,
 #if DEBUG_TESTING
                                             "-L", "DEBUG",
 #endif
-                                            "-d", NULL);
+                                            "-s", NULL);
         }
       else
         {
@@ -186,6 +186,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                                             "ssh",
                                             dst,
                                             "gnunet-arm",
+#if DEBUG_TESTING
+                                            "-L", "DEBUG",
+#endif
                                             "-c", d->cfgfile, "-s", NULL);
           GNUNET_free (dst);
         }
@@ -528,6 +531,9 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
 
       d->pid = GNUNET_OS_start_process (NULL, NULL, "ssh", "ssh",
                                               arg, "gnunet-arm",
+#if DEBUG_TESTING
+                                              "-L", "DEBUG",
+#endif
                                               "-c", d->cfgfile, "-e", "-d", NULL);
       /* Use -e to end arm, and -d to remove temp files */
 
@@ -541,7 +547,10 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
 #endif
     d->pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-arm",
                                             "gnunet-arm",
-                                            "-c", d->cfgfile, "-e", NULL);
+#if DEBUG_TESTING
+                                            "-L", "DEBUG",
+#endif
+                                            "-c", d->cfgfile, "-e", "-d", NULL);
   }
 
   d->wait_runs = 0;
index 30c4fc886f440b877e4572b8be96a8c51e710ce8..96d2831d7b8450f318745e9d091fdbec2884ea64 100644 (file)
@@ -27,7 +27,7 @@
 #include "gnunet_arm_service.h"
 #include "gnunet_testing_lib.h"
 
-#define VERBOSE_TESTING GNUNET_YES
+#define VERBOSE_TESTING GNUNET_NO
 
 /**
  * Lowest port used for GNUnet testing.  Should be high enough to not
@@ -213,8 +213,8 @@ update_config (void *cls,
  * Create a new configuration using the given configuration
  * as a template; however, each PORT in the existing cfg
  * must be renumbered by incrementing "*port".  If we run
- * out of "*port" numbers, return NULL. 
- * 
+ * out of "*port" numbers, return NULL.
+ *
  * @param cfg template configuration
  * @param port port numbers to use, update to reflect
  *             port numbers that were used
@@ -330,9 +330,9 @@ create_small_world_ring(struct GNUNET_TESTING_PeerGroup *pg)
   int connect_attempts;
 
   logNModifier = 0.5; /* FIXME: default value? */
-  if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(pg->cfg, 
+  if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(pg->cfg,
                                                         "TESTING",
-                                                        "LOGNMODIFIER", 
+                                                        "LOGNMODIFIER",
                                                         &p_string))
     {
       if (sscanf(p_string, "%lf", &logNModifier) != 1)
@@ -500,7 +500,7 @@ create_small_world (struct GNUNET_TESTING_PeerGroup *pg)
   square = floor (sqrt (pg->total));
   rows = square;
   cols = square;
-  
+
   percentage = 0.5; /* FIXME: default percentage? */
   if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string(pg->cfg,
                                                         "TESTING",
@@ -842,7 +842,7 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
 
       if (GNUNET_OK !=
          GNUNET_CONFIGURATION_get_value_string(pg->peers[pg_iter].daemon->cfg, "PATHS", "SERVICEHOME", &temp_service_path))
-       {         
+       {
           GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                      _("No `%s' specified in peer configuration in section `%s', cannot copy friends file!\n"),
                      "SERVICEHOME",
@@ -1134,7 +1134,7 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg)
  * adjusted to ensure that no two peers running on the same system
  * have the same port(s) in their respective configurations.
  *
- * @param sched scheduler to use 
+ * @param sched scheduler to use
  * @param cfg configuration template to use
  * @param total number of daemons to start
  * @param cb function to call on each daemon that was started
@@ -1301,7 +1301,7 @@ GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, unsigned int pos
 
 /**
  * Shutdown all peers started in the given group.
- * 
+ *
  * @param pg handle to the peer group
  */
 void