gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29525 - gnunet/src/dv


From: gnunet
Subject: [GNUnet-SVN] r29525 - gnunet/src/dv
Date: Wed, 25 Sep 2013 11:24:05 +0200

Author: wachs
Date: 2013-09-25 11:24:05 +0200 (Wed, 25 Sep 2013)
New Revision: 29525

Modified:
   gnunet/src/dv/template_dv.conf
   gnunet/src/dv/test_transport_dv.c
Log:
updated test


Modified: gnunet/src/dv/template_dv.conf
===================================================================
--- gnunet/src/dv/template_dv.conf      2013-09-24 12:49:32 UTC (rev 29524)
+++ gnunet/src/dv/template_dv.conf      2013-09-25 09:24:05 UTC (rev 29525)
@@ -21,6 +21,7 @@
 OVERLAY_TOPOLOGY = CLIQUE
 SETUP_TIMEOUT = 1 m
 OPERATION_TIMEOUT = 5 s
+CACHE_SIZE = 0
 
 
[transport-blacklist-OF84RAOAU2B1SOSEHJH6350MA0F7C98U55RI76LGIQOM7O33TFHPNUFB47CDBSCOLIINMVJ2U82445ABOBQRIVREG20L31KVDV5HG60]
 
548J7M14O4I0F8I84U0UFARVJ97DB6QOT3MCA8O8SNAIT5JJ8TR95LUVAP3N5L7DN33IB49SNMF3Q3C0VPLTGP9ASCULA9S2OIMHHH8
 = tcp

Modified: gnunet/src/dv/test_transport_dv.c
===================================================================
--- gnunet/src/dv/test_transport_dv.c   2013-09-24 12:49:32 UTC (rev 29524)
+++ gnunet/src/dv/test_transport_dv.c   2013-09-25 09:24:05 UTC (rev 29525)
@@ -30,6 +30,28 @@
  */
 static int ok;
 
+struct GNUNET_TESTBED_Operation *topology_op;
+
+static void topology_completed (void *cls,
+                                unsigned int nsuccess,
+                                unsigned int nfailures)
+{
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Links successful %u / %u failed\n", 
nsuccess, nfailures);
+  GNUNET_TESTBED_operation_done (topology_op);
+  topology_op = NULL;
+
+  if (nfailures > 0)
+  {
+    fprintf (stderr, "Error: links successful %u but %u failed\n", nsuccess, 
nfailures);
+    ok = 1;
+  }
+  else
+    ok = 0;
+
+  GNUNET_SCHEDULER_shutdown ();
+}
+
+
 static void
 test_connection (void *cls,
                  struct GNUNET_TESTBED_RunHandle *h,
@@ -38,22 +60,29 @@
                  unsigned int links_succeeded,
                  unsigned int links_failed)
 {
-  int c;
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Links successful %u / %u failed\n", 
links_succeeded, links_failed);
+  if (4 != num_peers)
+  {
+    ok = 1;
+    fprintf (stderr, "Only %u out of 4 peers were started ...\n",
+        num_peers);
+  }
 
-  if ( (4 != num_peers) || (0 != links_failed) )
+  if (0 != links_failed)
   {
-    fprintf (stderr, "Testbed failed to connect peers\n");
-    GNUNET_SCHEDULER_shutdown ();
+    /* All peers except DV peers are connected  */
+    fprintf (stderr, "Testbed failed to connect peers,\n");
+
+    topology_op = GNUNET_TESTBED_overlay_configure_topology(NULL, num_peers, 
peers, NULL,
+        &topology_completed, NULL,
+        GNUNET_TESTBED_TOPOLOGY_CLIQUE,
+        GNUNET_TESTBED_TOPOLOGY_OPTION_END);
     return;
   }
-  ok = 0;
-  if (1)
-  {
-    GNUNET_SCHEDULER_shutdown ();
-  }
-  else
-    fprintf (stderr, "Test passed, press CTRL-C to shut down\n");
+
+  ok = 1;
+  fprintf (stderr, "Testbed connected peers, should not happen...\n");
+  GNUNET_SCHEDULER_shutdown ();
+
 }
 
 
@@ -61,6 +90,7 @@
 main (int argc, char *argv[])
 {
   ok = 1;
+  /* Connecting initial topology */
   (void) GNUNET_TESTBED_test_run ("test-transport-dv",
                                  "test_transport_dv_data.conf",
                                  4,




reply via email to

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