some testing changes, including an api change that likely breaks things for others
[oweals/gnunet.git] / src / testing / test_testing_group.c
index 2429c45254d1c66f72bec39fead54b461de61181..81d949e2a2d14d77c5bec1d61aa67a44ef7fb605 100644 (file)
@@ -24,7 +24,7 @@
 #include "platform.h"
 #include "gnunet_testing_lib.h"
 
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
 
 #define NUM_PEERS 4
 
@@ -55,13 +55,18 @@ my_cb (void *cls,
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start callback called with error (too long starting peers), aborting test!\n");
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error from testing: `%s'\n");
       failed_peers++;
-      ok = 7;
+      if (failed_peers == peers_left)
+       {
+          GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Too many peers failed, ending test!\n");
+         ok = 1;
+         GNUNET_TESTING_daemons_stop (pg, TIMEOUT);
+       }
+      return;
     }
 
   peers_left--;
   if (peers_left == 0)
     {
-      sleep(2); /* Give other services a chance to initialize before killing */
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers started successfully, ending test!\n");
       GNUNET_TESTING_daemons_stop (pg, TIMEOUT);
       ok = 0;
@@ -69,6 +74,7 @@ my_cb (void *cls,
   else if (failed_peers == peers_left)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Too many peers failed, ending test!\n");
+      ok = 1;
       GNUNET_TESTING_daemons_stop (pg, TIMEOUT);
     }
 }