From: Nathan S. Evans Date: Fri, 26 Feb 2010 10:58:00 +0000 (+0000) Subject: add support for multi topology testing to makefile (all work for me, but only clique... X-Git-Tag: initial-import-from-subversion-38251~22607 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a87f456787c26f1387e37b404f5d1ce23ee17bd2;p=oweals%2Fgnunet.git add support for multi topology testing to makefile (all work for me, but only clique is currently a testcase) --- diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am index 8b1dceb15..ebe777b0f 100644 --- a/src/testing/Makefile.am +++ b/src/testing/Makefile.am @@ -26,12 +26,24 @@ check_PROGRAMS = \ test_testing_connect \ test_testing_group \ test_testing_topology_clique - +# test_testing_topology_ring \ +# test_testing_topology_2d_torus \ +# test_testing_topology_small_world_ring \ +# test_testing_topology_small_world_torus \ +# test_testing_topology_erdos_renyi \ +# test_testing_topology_internat + TESTS = \ test_testing \ test_testing_connect \ test_testing_group \ - test_testing_topology_clique + test_testing_topology_clique +# test_testing_topology_ring \ +# test_testing_topology_2d_torus \ +# test_testing_topology_small_world_ring \ +# test_testing_topology_small_world_torus \ +# test_testing_topology_erdos_renyi \ +# test_testing_topology_internat #$(check_PROGRAMS) test_testing_SOURCES = \ @@ -53,13 +65,57 @@ test_testing_group_LDADD = \ $(top_builddir)/src/util/libgnunetutil.la test_testing_topology_clique_SOURCES = \ - test_testing_topology_clique.c + test_testing_topology.c test_testing_topology_clique_LDADD = \ $(top_builddir)/src/testing/libgnunettesting.la \ $(top_builddir)/src/util/libgnunetutil.la +#test_testing_topology_ring_SOURCES = \ +# test_testing_topology.c +#test_testing_topology_ring_LDADD = \ +# $(top_builddir)/src/testing/libgnunettesting.la \ +# $(top_builddir)/src/util/libgnunetutil.la + +#test_testing_topology_2d_torus_SOURCES = \ +# test_testing_topology.c +#test_testing_topology_2d_torus_LDADD = \ +# $(top_builddir)/src/testing/libgnunettesting.la \ +# $(top_builddir)/src/util/libgnunetutil.la + +#test_testing_topology_small_world_ring_SOURCES = \ +# test_testing_topology.c +#test_testing_topology_small_world_ring_LDADD = \ +# $(top_builddir)/src/testing/libgnunettesting.la \ +# $(top_builddir)/src/util/libgnunetutil.la + +#test_testing_topology_small_world_torus_SOURCES = \ +# test_testing_topology.c +#test_testing_topology_small_world_torus_LDADD = \ +# $(top_builddir)/src/testing/libgnunettesting.la \ +# $(top_builddir)/src/util/libgnunetutil.la + +#test_testing_topology_internat_SOURCES = \ +# test_testing_topology.c +#test_testing_topology_internat_LDADD = \ +# $(top_builddir)/src/testing/libgnunettesting.la \ +# $(top_builddir)/src/util/libgnunetutil.la + +#test_testing_topology_erdos_renyi_SOURCES = \ +# test_testing_topology.c +#test_testing_topology_erdos_renyi_LDADD = \ +# $(top_builddir)/src/testing/libgnunettesting.la \ +# $(top_builddir)/src/util/libgnunetutil.la + + EXTRA_DIST = \ test_testing_data.conf \ test_testing_connect_peer1.conf \ test_testing_connect_peer2.conf \ - test_testing_data_topology_clique.conf + test_testing_data_topology_clique.conf \ + test_testing_data_topology_ring.conf \ + test_testing_data_topology_2d_torus.conf \ + test_testing_data_topology_small_world_ring.conf \ + test_testing_data_topology_small_world_torus.conf \ + test_testing_data_topology_erdos_renyi.conf \ + test_testing_data_topology_internat.conf + diff --git a/src/testing/test_testing_data_topology_2d_torus.conf b/src/testing/test_testing_data_topology_2d_torus.conf new file mode 100644 index 000000000..8e8642bb5 --- /dev/null +++ b/src/testing/test_testing_data_topology_2d_torus.conf @@ -0,0 +1,36 @@ +[PATHS] +SERVICEHOME = /tmp/test-gnunet-testing/ +DEFAULTCONFIG = test_testing_data_topology_clique.conf + +[resolver] +PORT = 2564 + +[transport] +PORT = 2565 +PLUGINS = tcp +#PREFIX = xterm -e xterm -T transport -e gdb --args +#PREFIX = valgrind --tool=memcheck --log-file=logs%p +#DEBUG = YES + +[arm] +PORT = 2566 +DEFAULTSERVICES = peerinfo transport core + +[statistics] +PORT = 2567 + +[transport-tcp] +PORT = 2568 + +[peerinfo] +PORT = 2569 + +[core] +PORT = 2570 +#DEBUG = YES + +[testing] +NUM_PEERS = 5 +WEAKRANDOM = YES +TOPOLOGY = 4 +F2F = YES diff --git a/src/testing/test_testing_data_topology_clique.conf b/src/testing/test_testing_data_topology_clique.conf index 6f9a7739e..2a8934c34 100644 --- a/src/testing/test_testing_data_topology_clique.conf +++ b/src/testing/test_testing_data_topology_clique.conf @@ -30,7 +30,7 @@ PORT = 2570 #DEBUG = YES [testing] -NUM_PEERS = 2 +NUM_PEERS = 5 WEAKRANDOM = YES TOPOLOGY = 0 F2F = YES diff --git a/src/testing/test_testing_data_topology_erdos_renyi.conf b/src/testing/test_testing_data_topology_erdos_renyi.conf new file mode 100644 index 000000000..a505c4df5 --- /dev/null +++ b/src/testing/test_testing_data_topology_erdos_renyi.conf @@ -0,0 +1,36 @@ +[PATHS] +SERVICEHOME = /tmp/test-gnunet-testing/ +DEFAULTCONFIG = test_testing_data_topology_clique.conf + +[resolver] +PORT = 2564 + +[transport] +PORT = 2565 +PLUGINS = tcp +#PREFIX = xterm -e xterm -T transport -e gdb --args +#PREFIX = valgrind --tool=memcheck --log-file=logs%p +#DEBUG = YES + +[arm] +PORT = 2566 +DEFAULTSERVICES = peerinfo transport core + +[statistics] +PORT = 2567 + +[transport-tcp] +PORT = 2568 + +[peerinfo] +PORT = 2569 + +[core] +PORT = 2570 +#DEBUG = YES + +[testing] +NUM_PEERS = 5 +WEAKRANDOM = YES +TOPOLOGY = 5 +F2F = YES diff --git a/src/testing/test_testing_data_topology_internat.conf b/src/testing/test_testing_data_topology_internat.conf new file mode 100644 index 000000000..89c0cdf06 --- /dev/null +++ b/src/testing/test_testing_data_topology_internat.conf @@ -0,0 +1,36 @@ +[PATHS] +SERVICEHOME = /tmp/test-gnunet-testing/ +DEFAULTCONFIG = test_testing_data_topology_clique.conf + +[resolver] +PORT = 2564 + +[transport] +PORT = 2565 +PLUGINS = tcp +#PREFIX = xterm -e xterm -T transport -e gdb --args +#PREFIX = valgrind --tool=memcheck --log-file=logs%p +#DEBUG = YES + +[arm] +PORT = 2566 +DEFAULTSERVICES = peerinfo transport core + +[statistics] +PORT = 2567 + +[transport-tcp] +PORT = 2568 + +[peerinfo] +PORT = 2569 + +[core] +PORT = 2570 +#DEBUG = YES + +[testing] +NUM_PEERS = 5 +WEAKRANDOM = YES +TOPOLOGY = 6 +F2F = YES diff --git a/src/testing/test_testing_data_topology_ring.conf b/src/testing/test_testing_data_topology_ring.conf new file mode 100644 index 000000000..41493887c --- /dev/null +++ b/src/testing/test_testing_data_topology_ring.conf @@ -0,0 +1,36 @@ +[PATHS] +SERVICEHOME = /tmp/test-gnunet-testing/ +DEFAULTCONFIG = test_testing_data_topology_clique.conf + +[resolver] +PORT = 2564 + +[transport] +PORT = 2565 +PLUGINS = tcp +#PREFIX = xterm -e xterm -T transport -e gdb --args +#PREFIX = valgrind --tool=memcheck --log-file=logs%p +#DEBUG = YES + +[arm] +PORT = 2566 +DEFAULTSERVICES = peerinfo transport core + +[statistics] +PORT = 2567 + +[transport-tcp] +PORT = 2568 + +[peerinfo] +PORT = 2569 + +[core] +PORT = 2570 +#DEBUG = YES + +[testing] +NUM_PEERS = 5 +WEAKRANDOM = YES +TOPOLOGY = 3 +F2F = YES diff --git a/src/testing/test_testing_data_topology_small_world_ring.conf b/src/testing/test_testing_data_topology_small_world_ring.conf new file mode 100644 index 000000000..f97723ff2 --- /dev/null +++ b/src/testing/test_testing_data_topology_small_world_ring.conf @@ -0,0 +1,36 @@ +[PATHS] +SERVICEHOME = /tmp/test-gnunet-testing/ +DEFAULTCONFIG = test_testing_data_topology_clique.conf + +[resolver] +PORT = 2564 + +[transport] +PORT = 2565 +PLUGINS = tcp +#PREFIX = xterm -e xterm -T transport -e gdb --args +#PREFIX = valgrind --tool=memcheck --log-file=logs%p +#DEBUG = YES + +[arm] +PORT = 2566 +DEFAULTSERVICES = peerinfo transport core + +[statistics] +PORT = 2567 + +[transport-tcp] +PORT = 2568 + +[peerinfo] +PORT = 2569 + +[core] +PORT = 2570 +#DEBUG = YES + +[testing] +NUM_PEERS = 5 +WEAKRANDOM = YES +TOPOLOGY = 2 +F2F = YES diff --git a/src/testing/test_testing_data_topology_small_world_torus.conf b/src/testing/test_testing_data_topology_small_world_torus.conf new file mode 100644 index 000000000..0da71f89f --- /dev/null +++ b/src/testing/test_testing_data_topology_small_world_torus.conf @@ -0,0 +1,36 @@ +[PATHS] +SERVICEHOME = /tmp/test-gnunet-testing/ +DEFAULTCONFIG = test_testing_data_topology_clique.conf + +[resolver] +PORT = 2564 + +[transport] +PORT = 2565 +PLUGINS = tcp +#PREFIX = xterm -e xterm -T transport -e gdb --args +#PREFIX = valgrind --tool=memcheck --log-file=logs%p +#DEBUG = YES + +[arm] +PORT = 2566 +DEFAULTSERVICES = peerinfo transport core + +[statistics] +PORT = 2567 + +[transport-tcp] +PORT = 2568 + +[peerinfo] +PORT = 2569 + +[core] +PORT = 2570 +#DEBUG = YES + +[testing] +NUM_PEERS = 5 +WEAKRANDOM = YES +TOPOLOGY = 1 +F2F = YES diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c index a8d1a4a8c..a0438f7be 100644 --- a/src/testing/test_testing_topology.c +++ b/src/testing/test_testing_topology.c @@ -25,7 +25,7 @@ #include "gnunet_testing_lib.h" #include "gnunet_core_service.h" -#define VERBOSE GNUNET_YES +#define VERBOSE GNUNET_NO /** * How long until we give up on connecting the peers? @@ -250,7 +250,9 @@ static size_t transmit_ready (void *cls, size_t size, void *buf) { struct GNUNET_MessageHeader *m; +#if VERBOSE struct GNUNET_PeerIdentity *peer = cls; +#endif GNUNET_assert (buf != NULL); m = (struct GNUNET_MessageHeader *) buf; m->type = htons (MTYPE); @@ -258,8 +260,8 @@ transmit_ready (void *cls, size_t size, void *buf) transmit_ready_called++; #if VERBOSE - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "transmit ready for peer %s\ntransmit_ready's scheduled %d, transmit_ready's called %d\n", GNUNET_i2s(peer), transmit_ready_scheduled, transmit_ready_called); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "transmit ready for peer %s\ntransmit_ready's scheduled %d, transmit_ready's called %d\n", GNUNET_i2s(peer), transmit_ready_scheduled, transmit_ready_called); #endif GNUNET_SCHEDULER_add_now(sched, &schedule_transmission, NULL); return sizeof (struct GNUNET_MessageHeader);