added dv twice and dht never?
authorNathan S. Evans <evans@in.tum.de>
Fri, 2 Jul 2010 13:49:05 +0000 (13:49 +0000)
committerNathan S. Evans <evans@in.tum.de>
Fri, 2 Jul 2010 13:49:05 +0000 (13:49 +0000)
src/Makefile.am
src/dht/dht_api.c
src/dv/dv.h
src/dv/test_transport_api_dv.c
src/dv/test_transport_dv_data.conf
src/fragmentation/fragmentation.c
src/fs/Makefile.am
src/testing/test_testing_data_topology_clique.conf
src/testing/test_testing_data_topology_none.conf
src/testing/test_testing_topology.c

index aa68c85375e18fe539f9ba646abd9a86c48d592b..46189da719f766549ccd92f14fbf79338504d762 100644 (file)
@@ -25,8 +25,9 @@ SUBDIRS = \
   transport \
   peerinfo-tool \
   core \
-  testing \
   dv \
+  testing \
+  dht \
   hostlist \
   topology \
   $(NAT_DIR) \
index 4a19422a88b04f79a5ae61b78f34a884d0dd0e75..7095eeb6d364c5ee0ff5034b84c07f6e79f63e21 100644 (file)
@@ -574,7 +574,7 @@ service_message_handler (void *cls,
           finish(handle, GNUNET_SYSERR); /* If there was a current message, kill it! */
         }
 #if RETRANSMIT
-      if (GNUNET_CONTAINER_multihashmap_iterate(handle->outstanding_requests, &retransmit_iterator, handle) > 0)
+      if ((handle->retransmit_stage != DHT_RETRANSMITTING) && (GNUNET_CONTAINER_multihashmap_iterate(handle->outstanding_requests, &retransmit_iterator, handle) > 0))
         {
           handle->retransmit_stage = DHT_RETRANSMITTING;
           handle->current = handle->retransmissions->message;
index e744c30d0cf5fb8923606c88af597c95d587fac8..bb63bc004ebccb753e74a1665c1da921f1cdcd8a 100644 (file)
@@ -31,7 +31,7 @@
 #define DEBUG_DV_GOSSIP GNUNET_NO
 #define DEBUG_DV_GOSSIP_SEND GNUNET_NO
 #define DEBUG_DV_GOSSIP_RECEIPT GNUNET_NO
-#define DEBUG_DV_MESSAGES GNUNET_NO
+#define DEBUG_DV_MESSAGES GNUNET_YES
 #define DEBUG_DV GNUNET_NO
 #define DEBUG_DV_PEER_NUMBERS GNUNET_NO
 #define DEBUG_MESSAGE_DROP GNUNET_NO
index 48db86cdc100ce3ae7406fd8704c5e97aa32884b..709ef8e975bf058d0de2e64d16261a7f21c10e1f 100644 (file)
@@ -720,7 +720,7 @@ topology_callback (void *cls,
     {
 #if VERBOSE
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Created %d total connections, which is our target number!  Calling send messages.\n",
+                  "Created %u total connections, which is our target number!  Calling send messages.\n",
                   total_connections);
 #endif
 
index f993603c0f37bfcf77e932f6fb2961c1a5aa14e8..8cb1ffb0686f11aba2ddb71fb198c117e9442bf3 100644 (file)
@@ -6,7 +6,7 @@ DEFAULTCONFIG = test_transport_dv_data.conf
 PORT = 2564
 
 [transport]
-DEBUG = NO
+DEBUG = YES
 PORT = 2565
 PLUGINS = tcp dv
 BLACKLIST_FILE = $SERVICEHOME/blacklist
@@ -45,7 +45,7 @@ PORT = 2570
 
 [dv]
 AUTOSTART = YES
-DEBUG = NO
+DEBUG = YES
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;
 BINARY = gnunet-service-dv
index 58fcd834a1c6cf3f1f5f55f364dbd9a3ac4a56ae..ecd82b2c4ba4e1809ebfa6fae1bcaa28b46b0b61 100644 (file)
 #include "gnunet_fragmentation_lib.h"
 #include "gnunet_protocols.h"
 #include "gnunet_util_lib.h"
+
 /**
  * Message fragment.  This header is followed
  * by the actual data of the fragment.
  */
+
 struct Fragment
 {
 
@@ -181,10 +183,16 @@ void
 GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *ctx)
 {
        struct GNUNET_FRAGEMENT_Ctxbuffer *buffer;
-       for(buffer = ctx->buffer; buffer!=NULL; buffer = buffer->next){
-               GNUNET_free(buffer->num);
-               GNUNET_free(buffer);
-       }
+       struct GNUNET_FRAGEMENT_Ctxbuffer *temp;
+       buffer = ctx->buffer;
+
+       while (buffer != NULL)
+         {
+            temp = buffer->next;
+            GNUNET_free(buffer->num);
+            GNUNET_free(buffer);
+            buffer = temp;
+          }
        GNUNET_free(ctx);
        GNUNET_assert (0);
 }
index f5e834d4ee44bd143b2beaf900ee926938797a93..9fcdd351b6566edfa0408a3154aff33361b13c6e 100644 (file)
@@ -150,7 +150,6 @@ TESTS = \
  test_fs_download \
  test_fs_download_indexed \
  test_fs_download_persistence \
- test_fs_file_information \
  test_fs_list_indexed \
  test_fs_namespace \
  test_fs_publish \
@@ -166,6 +165,7 @@ TESTS = \
  test_gnunet_service_fs_p2p \
  $(check_SCRIPTS) 
 # $(check_PROGRAMS)
+# test_fs_file_information
 
 
 test_fs_collection_SOURCES = \
index 114364da2fc561873ae7d7baa2eb27c1737c58d9..abe6f586a1fac9704a1f63f06763a3c9979c8648 100644 (file)
@@ -41,7 +41,7 @@ PORT = 2570
 #DEBUG = YES
 
 [testing]
-NUM_PEERS = 4
+NUM_PEERS = 10
 WEAKRANDOM = YES
 TOPOLOGY = CLIQUE
 F2F = YES
index 9ff8ca390a006761e04b9af0929d6d48cf73640f..f03633d5602741595f0029d98127120dda9ceb83 100644 (file)
@@ -3,16 +3,14 @@ SERVICEHOME = /tmp/test-gnunet-testing/
 DEFAULTCONFIG = test_testing_data_topology_clique.conf
 
 [resolver]
+AUTOSTART = NO
 PORT = 0
 
 [transport]
 PORT = 0
 PLUGINS = tcp
-#PREFIX = xterm -e xterm -T transport -e gdb --args
 #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport
-#PREFIX = valgrind --tool=memcheck --log-file=logs%p
-#PREFIX = valgrind --tool=callgrind --log-file=callgrind.%p
-#DEBUG = YES
+#PREFIX = valgrind --tool=massif
 
 [topology]
 PORT = 0
@@ -22,23 +20,18 @@ PORT = 0
 DEFAULTSERVICES = 
 
 [statistics]
+AUTOSTART = NO
 PORT = 0
 
 [transport-tcp]
 PORT = 2568
+BINDTO = 127.0.0.1
 
 [peerinfo]
 PORT = 0
-#DEBUG = YES
-#PREFIX = xterm -e xterm -T peerinfo -e gdb --args
-#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/peerinfo/.libs/gnunet-service-peerinfo
-#PREFIX = valgrind --tool=memcheck --log-file=peerinfo%p
 
 [core]
 PORT = 0
-#PREFIX = xterm -e xterm -T CORE -e gdb --args
-#PREFIX = valgrind --tool=memcheck --log-file=logs%p
-#DEBUG = YES
 
 [hostlist]
 PORT = 0
@@ -47,10 +40,14 @@ PORT = 0
 PORT = 0
 
 [testing]
-NUM_PEERS = 200
+NUM_PEERS = 50
 WEAKRANDOM = YES
 TOPOLOGY = NONE
 F2F = NO
 BLACKLIST_TOPOLOGY = NONE
 CONNECT_TOPOLOGY = RING
+#CONNECT_TOPOLOGY = 2D_TORUS
+#CONNECT_TOPOLOGY = CLIQUE
+#CONNECT_TOPOLOGY_OPTION = CONNECT_DFS
+#CONNECT_TOPOLOGY_OPTION_MODIFIER = 20
 #DEBUG = YES
index eb13c8eefd0095a805a0c4ffde48da6bd9f1ff31..23cb3716acfa3316ccd49bd82b0a96b410388714 100644 (file)
 #include "platform.h"
 #include "gnunet_testing_lib.h"
 #include "gnunet_core_service.h"
+#include "gnunet_os_lib.h"
 
 #define VERBOSE GNUNET_YES
 
+#define DELAY_FOR_LOGGING GNUNET_YES
+
 /**
  * How long until we fail the whole testcase?
  */
@@ -167,6 +170,20 @@ void shutdown_callback (void *cls,
     }
 }
 
+#if DELAY_FOR_LOGGING
+static void gather_log_data ()
+{
+  char *peer_number;
+  char *connect_number;
+  pid_t mem_process;
+  GNUNET_asprintf(&peer_number, "%llu", num_peers);
+  GNUNET_asprintf(&connect_number, "%llu", expected_connections);
+  mem_process = GNUNET_OS_start_process (NULL, NULL, "./memsize.pl",
+                           "memsize.pl", "totals.txt", peer_number, connect_number, NULL);
+  GNUNET_OS_process_wait(mem_process);
+}
+
+#endif
 static void
 finish_testing ()
 {
@@ -177,6 +194,7 @@ finish_testing ()
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Called finish testing, stopping daemons.\n");
 #endif
+
   int count;
   count = 0;
   pos = test_messages;
@@ -558,12 +576,22 @@ topology_callback (void *cls,
 #endif
       modnum = expected_messages / 4;
       dotnum = (expected_messages / 50) + 1;
-#if VERBOSE
-      fprintf(stdout, "Test message progress: [");
-#endif
       GNUNET_SCHEDULER_cancel (sched, die_task);
       die_task = GNUNET_SCHEDULER_NO_TASK;
+#if DELAY_FOR_LOGGING
+      fprintf(stdout, "Sending test messages in 10 seconds.\n");
+      GNUNET_SCHEDULER_add_delayed (sched,
+                                    GNUNET_TIME_relative_multiply
+                                    (GNUNET_TIME_UNIT_SECONDS, 10),
+                                    &send_test_messages, test_messages);
+      gather_log_data();
+#else
       GNUNET_SCHEDULER_add_now (sched, &send_test_messages, test_messages);
+#endif
+#if VERBOSE
+      fprintf(stdout, "Test message progress: [");
+#endif
+
     }
   else if (total_connections + failed_connections == expected_connections)
     {
@@ -629,8 +657,8 @@ create_topology ()
 #if VERBOSE
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Topology set up, now starting peers!\n");
-#endif
       fprintf(stdout, "Daemon start progress [");
+#endif
       GNUNET_TESTING_daemons_continue_startup(pg);
     }
   else
@@ -696,10 +724,18 @@ peers_started_callback (void *cls,
        * within a reasonable amount of time */
       die_task = GNUNET_SCHEDULER_add_delayed (sched,
                                                GNUNET_TIME_relative_multiply
-                                               (GNUNET_TIME_UNIT_MINUTES, 5),
+                                               (GNUNET_TIME_UNIT_MINUTES, 8),
                                                &end_badly, "from peers_started_callback");
-
+#if DELAY_FOR_LOGGING
+      fprintf(stdout, "Connecting topology in 10 seconds\n");
+      gather_log_data();
+      GNUNET_SCHEDULER_add_delayed (sched,
+                                    GNUNET_TIME_relative_multiply
+                                    (GNUNET_TIME_UNIT_SECONDS, 10),
+                                    &connect_topology, NULL);
+#else
       connect_topology ();
+#endif
       ok = 0;
     }
 }
@@ -861,7 +897,9 @@ run (void *cls,
   peers_left = num_peers;
   modnum = num_peers / 4;
   dotnum = (num_peers / 50) + 1;
+#if VERBOSE
   fprintf (stdout, "Hostkey generation progress: \[");
+#endif
   /* Set up a task to end testing if peer start fails */
   die_task = GNUNET_SCHEDULER_add_delayed (sched,
                                            GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, SECONDS_PER_PEER_START * num_peers),