gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r25029 - gnunet/src/testbed


From: gnunet
Subject: [GNUnet-SVN] r25029 - gnunet/src/testbed
Date: Fri, 16 Nov 2012 18:53:26 +0100

Author: harsha
Date: 2012-11-16 18:53:26 +0100 (Fri, 16 Nov 2012)
New Revision: 25029

Added:
   gnunet/src/testbed/test_testbed_api_testbed_run_topologysmallworld.conf
Modified:
   gnunet/src/testbed/
   gnunet/src/testbed/Makefile.am
   gnunet/src/testbed/testbed_api_testbed.c
   gnunet/src/testbed/testbed_api_topology.c
Log:
small world topology

Index: gnunet/src/testbed
===================================================================
--- gnunet/src/testbed  2012-11-16 17:37:30 UTC (rev 25028)
+++ gnunet/src/testbed  2012-11-16 17:53:26 UTC (rev 25029)

Property changes on: gnunet/src/testbed
___________________________________________________________________
Modified: svn:ignore
## -26,3 +26,4 ##
 test_testbed_api_testbed_run_topologyring
 test_testbed_api_testbed_run_topologysmallworldring
 test_testbed_api_testbed_run_topology2dtorus
+test_testbed_api_testbed_run_topologysmallworld
Modified: gnunet/src/testbed/Makefile.am
===================================================================
--- gnunet/src/testbed/Makefile.am      2012-11-16 17:37:30 UTC (rev 25028)
+++ gnunet/src/testbed/Makefile.am      2012-11-16 17:53:26 UTC (rev 25029)
@@ -96,7 +96,8 @@
  test_testbed_api_testbed_run_topologyclique \
  test_testbed_api_testbed_run_topologyring \
  test_testbed_api_testbed_run_topologysmallworldring \
- test_testbed_api_testbed_run_topology2dtorus
+ test_testbed_api_testbed_run_topology2dtorus \
+ test_testbed_api_testbed_run_topologysmallworld
 
 if ENABLE_TEST_RUN
  TESTS = \
@@ -116,7 +117,8 @@
  test_testbed_api_testbed_run_topologyclique \
  test_testbed_api_testbed_run_topologyring \
  test_testbed_api_testbed_run_topologysmallworldring \
- test_testbed_api_testbed_run_topology2dtorus
+ test_testbed_api_testbed_run_topology2dtorus \
+ test_testbed_api_testbed_run_topologysmallworld
 endif
 
 test_testbed_api_hosts_SOURCES = \
@@ -226,6 +228,12 @@
  $(top_builddir)/src/util/libgnunetutil.la \
  libgnunettestbed.la
 
+test_testbed_api_testbed_run_topologysmallworld_SOURCES = \
+ test_testbed_api_testbed_run.c
+test_testbed_api_testbed_run_topologysmallworld_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ libgnunettestbed.la
+
 EXTRA_DIST = \
   test_testbed_api.conf \
   test_testbed_api_testbed_run_topologyring.conf \
@@ -234,4 +242,5 @@
   test_testbed_api_testbed_run_topologyrandom.conf \
   test_testbed_api_testbed_run_topologysmallworldring.conf \
   test_testbed_api_testbed_run_topology2dtorus.conf \
+  test_testbed_api_testbed_run_topologysmallworld.conf \
   sample_hosts.txt
\ No newline at end of file

Copied: gnunet/src/testbed/test_testbed_api_testbed_run_topologysmallworld.conf 
(from rev 25019, 
gnunet/src/testbed/test_testbed_api_testbed_run_topologysmallworldring.conf)
===================================================================
--- gnunet/src/testbed/test_testbed_api_testbed_run_topologysmallworld.conf     
                        (rev 0)
+++ gnunet/src/testbed/test_testbed_api_testbed_run_topologysmallworld.conf     
2012-11-16 17:53:26 UTC (rev 25029)
@@ -0,0 +1,80 @@
+[testbed]
+AUTOSTART = NO
+PORT = 12113
+ACCEPT_FROM = 127.0.0.1;
+HOSTNAME = localhost
+PARALLEL_OVERLAY_CONNECT_THRESHOLD = 2
+OVERLAY_TOPOLOGY = SMALL_WORLD
+OVERLAY_RANDOM_LINKS = 3
+#PREFIX = xterm -geometry 100x85 -T peer1 -e libtool --mode=execute gdb --args
+
+[fs]
+AUTOSTART = NO
+
+[resolver]
+AUTOSTART = NO
+
+[mesh]
+AUTOSTART = NO
+
+[dht]
+AUTOSTART = NO
+
+[block]
+plugins = dht test
+
+[dhtcache]
+QUOTA = 1 MB
+DATABASE = sqlite
+
+[transport]
+PLUGINS = tcp
+ACCEPT_FROM6 = ::1;
+ACCEPT_FROM = 127.0.0.1;
+NEIGHBOUR_LIMIT = 50
+PORT = 12365
+
+[ats]
+WAN_QUOTA_OUT = 3932160
+WAN_QUOTA_IN = 3932160
+
+[core]
+PORT = 12092
+AUTOSTART = YES
+
+[arm]
+DEFAULTSERVICES = core transport
+PORT = 12366
+
+[transport-tcp]
+TIMEOUT = 300 s
+PORT = 12368
+
+[TESTING]
+NUM_PEERS = 5
+WEAKRANDOM = YES
+HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat
+MAX_CONCURRENT_SSH = 10
+USE_PROGRESSBARS = YES
+PEERGROUP_TIMEOUT = 2400 s
+
+[gnunetd]
+HOSTKEY = $SERVICEHOME/.hostkey
+
+[PATHS]
+SERVICEHOME = /tmp/test-testbed/
+
+[dns]
+AUTOSTART = NO
+
+[nse]
+AUTOSTART = NO
+
+[vpn]
+AUTOSTART = NO
+
+[nat]
+RETURN_LOCAL_ADDRESSES = YES
+
+[gns-helper-service-w32]
+AUTOSTART = NO
\ No newline at end of file

Modified: gnunet/src/testbed/testbed_api_testbed.c
===================================================================
--- gnunet/src/testbed/testbed_api_testbed.c    2012-11-16 17:37:30 UTC (rev 
25028)
+++ gnunet/src/testbed/testbed_api_testbed.c    2012-11-16 17:53:26 UTC (rev 
25029)
@@ -441,17 +441,34 @@
   if (GNUNET_TESTBED_TOPOLOGY_NONE != rc->topology)
   {
     if ( (GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI == rc->topology)
-         || (GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING == rc->topology))
+         || (GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING == rc->topology)
+         || (GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD == rc->topology))
+    {
+      unsigned int rand_links;
+      
+      switch (rc->topology)
+      {
+      case GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI:
+        rand_links = rc->num_oc;
+        break;
+      case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING:
+        rand_links = rc->num_oc - rc->num_peers;
+        break;
+      case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD:
+        rand_links = GNUNET_TESTBED_2dtorus_calc_links (rc->num_peers, NULL, 
NULL);
+        break;
+      default:
+        GNUNET_break (0);
+        rand_links = 0;
+      }
       rc->topology_operation =
           GNUNET_TESTBED_overlay_configure_topology (NULL,
                                                      rc->num_peers,
                                                      rc->peers,
                                                      rc->topology,
-                                                     
(GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI
-                                                      == rc->topology) ?
-                                                     rc->num_oc : 
-                                                     (rc->num_oc - 
rc->num_peers),
+                                                     rand_links,
                                                      
GNUNET_TESTBED_TOPOLOGY_OPTION_END);
+    }
     else
       rc->topology_operation =
           GNUNET_TESTBED_overlay_configure_topology (NULL,
@@ -655,7 +672,13 @@
     else if (0 == strcasecmp (topology, "SMALL_WORLD_RING"))
     {
       rc->topology = GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING;
+      rc->num_oc = num_peers;
     }
+    else if (0 == strcasecmp (topology, "SMALL_WORLD"))
+    {
+      rc->topology = GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD;
+      rc->num_oc = GNUNET_TESTBED_2dtorus_calc_links (num_peers, NULL, NULL);
+    }
     else if (0 == strcasecmp (topology, "CLIQUE"))
     {
       rc->topology = GNUNET_TESTBED_TOPOLOGY_CLIQUE;
@@ -682,7 +705,8 @@
     GNUNET_free (topology);
   }
   if ( (GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI == rc->topology)
-       || (GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING == rc->topology))
+       || (GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING == rc->topology)
+       || (GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD == rc->topology))
   { 
     if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, "testbed",
                                                             
"OVERLAY_RANDOM_LINKS",
@@ -700,9 +724,7 @@
       GNUNET_free (rc);
       return;
     }
-    rc->num_oc = (unsigned int) random_links;
-    if (GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING == rc->topology)
-      rc->num_oc += num_peers;
+    rc->num_oc += (unsigned int) random_links;
   }
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
                                 &shutdown_run_task, rc);

Modified: gnunet/src/testbed/testbed_api_topology.c
===================================================================
--- gnunet/src/testbed/testbed_api_topology.c   2012-11-16 17:37:30 UTC (rev 
25028)
+++ gnunet/src/testbed/testbed_api_topology.c   2012-11-16 17:53:26 UTC (rev 
25029)
@@ -530,6 +530,12 @@
   case GNUNET_TESTBED_TOPOLOGY_2D_TORUS:
     gen_topo_2dtorus (tc);
     break;
+  case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD:
+    gen_topo_2dtorus (tc);
+    gen_topo_random (tc,
+                     va_arg (va, unsigned int),
+                     GNUNET_YES);
+    break;
   default:
     GNUNET_break (0);
     GNUNET_free (tc);




reply via email to

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