it seems once a connection fails a few times, it will never work
[oweals/gnunet.git] / src / testing / testing_group.c
index 3c9460879ea0603431dd4c18e7c371b892580a48..af17d27c78294736ad4c3a62e612b6ff99c4517c 100644 (file)
@@ -61,9 +61,9 @@
 
 #define MAX_CONCURRENT_SHUTDOWN 200
 
-#define CONNECT_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 180)
+#define CONNECT_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
 
-#define CONNECT_ATTEMPTS 30
+#define CONNECT_ATTEMPTS 12
 
 /**
  * Which list of peers do we need to modify?
@@ -1325,7 +1325,6 @@ add_connections (struct GNUNET_TESTING_PeerGroup *pg,
   switch (list)
   {
   case ALLOWED:
-    GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Adding to ALLOWED\n");
     first_list = &pg->peers[first].allowed_peers_head;
     second_list = &pg->peers[second].allowed_peers_head;
     first_tail = &pg->peers[first].allowed_peers_tail;
@@ -1397,7 +1396,6 @@ add_connections (struct GNUNET_TESTING_PeerGroup *pg,
   if (add_first)
     {
 #if OLD
-      GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Adding peer %d to %d\n", second, first);
       new_first = GNUNET_malloc (sizeof (struct PeerConnection));
       new_first->index = second;
       GNUNET_CONTAINER_DLL_insert(*first_list, *first_tail, new_first);
@@ -1458,6 +1456,7 @@ add_connections (struct GNUNET_TESTING_PeerGroup *pg,
  *
  * @param pg the peer group we are dealing with
  * @param proc the connection processor to use
+ * @param list the peer list to use
  *
  * @return the number of connections created
  */
@@ -1531,6 +1530,7 @@ create_scale_free (struct GNUNET_TESTING_PeerGroup *pg,
  * @param pg the peergroup to create the topology on
  * @param proc the connection processor to call to actually set
  *        up connections between two peers
+ * @param list the peer list to use
  *
  * @return the number of connections that were set up
  *
@@ -1654,6 +1654,7 @@ create_small_world_ring (struct GNUNET_TESTING_PeerGroup *pg,
  * @param pg the peergroup to create the topology on
  * @param proc the connection processor to call to actually set
  *        up connections between two peers
+ * @param list the peer list to use
  *
  * @return the number of connections that were set up
  *
@@ -1716,6 +1717,7 @@ create_nated_internet (struct GNUNET_TESTING_PeerGroup *pg,
  * @param pg the peergroup to create the topology on
  * @param proc the connection processor to call to actually set
  *        up connections between two peers
+ * @param list the peer list to use
  *
  * @return the number of connections that were set up
  *
@@ -1886,6 +1888,7 @@ create_small_world (struct GNUNET_TESTING_PeerGroup *pg,
  * @param pg the peergroup to create the topology on
  * @param proc the connection processor to call to actually set
  *        up connections between two peers
+ * @param list the peer list to use
  *
  * @return the number of connections that were set up
  *
@@ -1948,6 +1951,7 @@ create_erdos_renyi (struct GNUNET_TESTING_PeerGroup *pg,
  * @param pg the peergroup to create the topology on
  * @param proc the connection processor to call to actually set
  *        up connections between two peers
+ * @param list the peer list to use
  *
  * @return the number of connections that were set up
  *
@@ -2036,6 +2040,7 @@ create_2d_torus (struct GNUNET_TESTING_PeerGroup *pg,
  * @param pg the peergroup to create the topology on
  * @param proc the connection processor to call to actually set
  *        up connections between two peers
+ * @param list the peer list to use
  *
  * @return the number of connections that were set up
  *
@@ -2179,6 +2184,7 @@ create_line (struct GNUNET_TESTING_PeerGroup *pg,
  * @param filename the file to read topology information from
  * @param proc the connection processor to call to actually set
  *        up connections between two peers
+ * @param list the peer list to use
  *
  * @return the number of connections that were set up
  *
@@ -2316,6 +2322,7 @@ create_from_file (struct GNUNET_TESTING_PeerGroup *pg,
  * @param pg the peergroup to create the topology on
  * @param proc the connection processor to call to actually set
  *        up connections between two peers
+ * @param list the peer list to use
  *
  * @return the number of connections that were set up
  *
@@ -3143,7 +3150,7 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
         num_connections = create_from_file (pg, filename, &add_connections, ALLOWED);
       else
       {
-        GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Missing configuration option TESTING:TOPOLOGY_FILE for creating topology from file!");
+        GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Missing configuration option TESTING:TOPOLOGY_FILE for creating topology from file!\n");
         num_connections = 0;
       }
       break;
@@ -3153,7 +3160,7 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
                   _
                   ("Creating no allowed topology (all peers can connect at core level)\n"));
 #endif
-      num_connections = 0;
+      num_connections = pg->total * pg->total; /* Clique is allowed! */
       break;
     default:
       num_connections = 0;
@@ -3763,6 +3770,7 @@ find_closest_peers (void *cls, const GNUNET_HashCode * key, void *value)
  * @param pg the peergroup we are dealing with
  * @param num how many connections at least should each peer have (if possible)?
  * @param proc processor to actually add the connections
+ * @param list the peer list to use
  */
 void
 add_closest (struct GNUNET_TESTING_PeerGroup *pg, unsigned int num,
@@ -4856,7 +4864,7 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
       else
         proc = GNUNET_OS_start_process (NULL, NULL, "ssh",
                                             "ssh", arg, "mkdir -p", baseservicehome,  NULL);
-      GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Creating remote dir with command ssh %s %s %s\n", arg, " mkdir -p ", baseservicehome);
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Creating remote dir with command ssh %s %s %s\n", arg, " mkdir -p ", baseservicehome);
       GNUNET_OS_process_wait(proc);
     }
   GNUNET_free(baseservicehome);
@@ -4865,7 +4873,7 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                                           &hostkeys_file))
     {
       if (GNUNET_YES != GNUNET_DISK_file_test (hostkeys_file))
-        GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Couldn't read hostkeys file!");
+        GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Couldn't read hostkeys file!\n");
       else
         {
           /* Check hostkey file size, read entire thing into memory */