summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-02-26 10:58:00 +0000
committerNathan S. Evans <evans@in.tum.de>2010-02-26 10:58:00 +0000
commita87f456787c26f1387e37b404f5d1ce23ee17bd2 (patch)
treea5962ef4f4f71c7cd02e343b1f05a221f49a1ce6
parenteb98ca5b7a3d2377f2422d453b5b0fe445cf6329 (diff)
downloadgnunet-a87f456787c26f1387e37b404f5d1ce23ee17bd2.tar.gz
gnunet-a87f456787c26f1387e37b404f5d1ce23ee17bd2.zip
add support for multi topology testing to makefile (all work for me, but only clique is currently a testcase)
-rw-r--r--src/testing/Makefile.am64
-rw-r--r--src/testing/test_testing_data_topology_2d_torus.conf36
-rw-r--r--src/testing/test_testing_data_topology_clique.conf2
-rw-r--r--src/testing/test_testing_data_topology_erdos_renyi.conf36
-rw-r--r--src/testing/test_testing_data_topology_internat.conf36
-rw-r--r--src/testing/test_testing_data_topology_ring.conf36
-rw-r--r--src/testing/test_testing_data_topology_small_world_ring.conf36
-rw-r--r--src/testing/test_testing_data_topology_small_world_torus.conf36
-rw-r--r--src/testing/test_testing_topology.c8
9 files changed, 282 insertions, 8 deletions
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 = \
26 test_testing_connect \ 26 test_testing_connect \
27 test_testing_group \ 27 test_testing_group \
28 test_testing_topology_clique 28 test_testing_topology_clique
29 29# test_testing_topology_ring \
30# test_testing_topology_2d_torus \
31# test_testing_topology_small_world_ring \
32# test_testing_topology_small_world_torus \
33# test_testing_topology_erdos_renyi \
34# test_testing_topology_internat
35
30TESTS = \ 36TESTS = \
31 test_testing \ 37 test_testing \
32 test_testing_connect \ 38 test_testing_connect \
33 test_testing_group \ 39 test_testing_group \
34 test_testing_topology_clique 40 test_testing_topology_clique
41# test_testing_topology_ring \
42# test_testing_topology_2d_torus \
43# test_testing_topology_small_world_ring \
44# test_testing_topology_small_world_torus \
45# test_testing_topology_erdos_renyi \
46# test_testing_topology_internat
35#$(check_PROGRAMS) 47#$(check_PROGRAMS)
36 48
37test_testing_SOURCES = \ 49test_testing_SOURCES = \
@@ -53,13 +65,57 @@ test_testing_group_LDADD = \
53 $(top_builddir)/src/util/libgnunetutil.la 65 $(top_builddir)/src/util/libgnunetutil.la
54 66
55test_testing_topology_clique_SOURCES = \ 67test_testing_topology_clique_SOURCES = \
56 test_testing_topology_clique.c 68 test_testing_topology.c
57test_testing_topology_clique_LDADD = \ 69test_testing_topology_clique_LDADD = \
58 $(top_builddir)/src/testing/libgnunettesting.la \ 70 $(top_builddir)/src/testing/libgnunettesting.la \
59 $(top_builddir)/src/util/libgnunetutil.la 71 $(top_builddir)/src/util/libgnunetutil.la
60 72
73#test_testing_topology_ring_SOURCES = \
74# test_testing_topology.c
75#test_testing_topology_ring_LDADD = \
76# $(top_builddir)/src/testing/libgnunettesting.la \
77# $(top_builddir)/src/util/libgnunetutil.la
78
79#test_testing_topology_2d_torus_SOURCES = \
80# test_testing_topology.c
81#test_testing_topology_2d_torus_LDADD = \
82# $(top_builddir)/src/testing/libgnunettesting.la \
83# $(top_builddir)/src/util/libgnunetutil.la
84
85#test_testing_topology_small_world_ring_SOURCES = \
86# test_testing_topology.c
87#test_testing_topology_small_world_ring_LDADD = \
88# $(top_builddir)/src/testing/libgnunettesting.la \
89# $(top_builddir)/src/util/libgnunetutil.la
90
91#test_testing_topology_small_world_torus_SOURCES = \
92# test_testing_topology.c
93#test_testing_topology_small_world_torus_LDADD = \
94# $(top_builddir)/src/testing/libgnunettesting.la \
95# $(top_builddir)/src/util/libgnunetutil.la
96
97#test_testing_topology_internat_SOURCES = \
98# test_testing_topology.c
99#test_testing_topology_internat_LDADD = \
100# $(top_builddir)/src/testing/libgnunettesting.la \
101# $(top_builddir)/src/util/libgnunetutil.la
102
103#test_testing_topology_erdos_renyi_SOURCES = \
104# test_testing_topology.c
105#test_testing_topology_erdos_renyi_LDADD = \
106# $(top_builddir)/src/testing/libgnunettesting.la \
107# $(top_builddir)/src/util/libgnunetutil.la
108
109
61EXTRA_DIST = \ 110EXTRA_DIST = \
62 test_testing_data.conf \ 111 test_testing_data.conf \
63 test_testing_connect_peer1.conf \ 112 test_testing_connect_peer1.conf \
64 test_testing_connect_peer2.conf \ 113 test_testing_connect_peer2.conf \
65 test_testing_data_topology_clique.conf 114 test_testing_data_topology_clique.conf \
115 test_testing_data_topology_ring.conf \
116 test_testing_data_topology_2d_torus.conf \
117 test_testing_data_topology_small_world_ring.conf \
118 test_testing_data_topology_small_world_torus.conf \
119 test_testing_data_topology_erdos_renyi.conf \
120 test_testing_data_topology_internat.conf
121
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 @@
1[PATHS]
2SERVICEHOME = /tmp/test-gnunet-testing/
3DEFAULTCONFIG = test_testing_data_topology_clique.conf
4
5[resolver]
6PORT = 2564
7
8[transport]
9PORT = 2565
10PLUGINS = tcp
11#PREFIX = xterm -e xterm -T transport -e gdb --args
12#PREFIX = valgrind --tool=memcheck --log-file=logs%p
13#DEBUG = YES
14
15[arm]
16PORT = 2566
17DEFAULTSERVICES = peerinfo transport core
18
19[statistics]
20PORT = 2567
21
22[transport-tcp]
23PORT = 2568
24
25[peerinfo]
26PORT = 2569
27
28[core]
29PORT = 2570
30#DEBUG = YES
31
32[testing]
33NUM_PEERS = 5
34WEAKRANDOM = YES
35TOPOLOGY = 4
36F2F = 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
30#DEBUG = YES 30#DEBUG = YES
31 31
32[testing] 32[testing]
33NUM_PEERS = 2 33NUM_PEERS = 5
34WEAKRANDOM = YES 34WEAKRANDOM = YES
35TOPOLOGY = 0 35TOPOLOGY = 0
36F2F = YES 36F2F = 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 @@
1[PATHS]
2SERVICEHOME = /tmp/test-gnunet-testing/
3DEFAULTCONFIG = test_testing_data_topology_clique.conf
4
5[resolver]
6PORT = 2564
7
8[transport]
9PORT = 2565
10PLUGINS = tcp
11#PREFIX = xterm -e xterm -T transport -e gdb --args
12#PREFIX = valgrind --tool=memcheck --log-file=logs%p
13#DEBUG = YES
14
15[arm]
16PORT = 2566
17DEFAULTSERVICES = peerinfo transport core
18
19[statistics]
20PORT = 2567
21
22[transport-tcp]
23PORT = 2568
24
25[peerinfo]
26PORT = 2569
27
28[core]
29PORT = 2570
30#DEBUG = YES
31
32[testing]
33NUM_PEERS = 5
34WEAKRANDOM = YES
35TOPOLOGY = 5
36F2F = 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 @@
1[PATHS]
2SERVICEHOME = /tmp/test-gnunet-testing/
3DEFAULTCONFIG = test_testing_data_topology_clique.conf
4
5[resolver]
6PORT = 2564
7
8[transport]
9PORT = 2565
10PLUGINS = tcp
11#PREFIX = xterm -e xterm -T transport -e gdb --args
12#PREFIX = valgrind --tool=memcheck --log-file=logs%p
13#DEBUG = YES
14
15[arm]
16PORT = 2566
17DEFAULTSERVICES = peerinfo transport core
18
19[statistics]
20PORT = 2567
21
22[transport-tcp]
23PORT = 2568
24
25[peerinfo]
26PORT = 2569
27
28[core]
29PORT = 2570
30#DEBUG = YES
31
32[testing]
33NUM_PEERS = 5
34WEAKRANDOM = YES
35TOPOLOGY = 6
36F2F = 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 @@
1[PATHS]
2SERVICEHOME = /tmp/test-gnunet-testing/
3DEFAULTCONFIG = test_testing_data_topology_clique.conf
4
5[resolver]
6PORT = 2564
7
8[transport]
9PORT = 2565
10PLUGINS = tcp
11#PREFIX = xterm -e xterm -T transport -e gdb --args
12#PREFIX = valgrind --tool=memcheck --log-file=logs%p
13#DEBUG = YES
14
15[arm]
16PORT = 2566
17DEFAULTSERVICES = peerinfo transport core
18
19[statistics]
20PORT = 2567
21
22[transport-tcp]
23PORT = 2568
24
25[peerinfo]
26PORT = 2569
27
28[core]
29PORT = 2570
30#DEBUG = YES
31
32[testing]
33NUM_PEERS = 5
34WEAKRANDOM = YES
35TOPOLOGY = 3
36F2F = 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 @@
1[PATHS]
2SERVICEHOME = /tmp/test-gnunet-testing/
3DEFAULTCONFIG = test_testing_data_topology_clique.conf
4
5[resolver]
6PORT = 2564
7
8[transport]
9PORT = 2565
10PLUGINS = tcp
11#PREFIX = xterm -e xterm -T transport -e gdb --args
12#PREFIX = valgrind --tool=memcheck --log-file=logs%p
13#DEBUG = YES
14
15[arm]
16PORT = 2566
17DEFAULTSERVICES = peerinfo transport core
18
19[statistics]
20PORT = 2567
21
22[transport-tcp]
23PORT = 2568
24
25[peerinfo]
26PORT = 2569
27
28[core]
29PORT = 2570
30#DEBUG = YES
31
32[testing]
33NUM_PEERS = 5
34WEAKRANDOM = YES
35TOPOLOGY = 2
36F2F = 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 @@
1[PATHS]
2SERVICEHOME = /tmp/test-gnunet-testing/
3DEFAULTCONFIG = test_testing_data_topology_clique.conf
4
5[resolver]
6PORT = 2564
7
8[transport]
9PORT = 2565
10PLUGINS = tcp
11#PREFIX = xterm -e xterm -T transport -e gdb --args
12#PREFIX = valgrind --tool=memcheck --log-file=logs%p
13#DEBUG = YES
14
15[arm]
16PORT = 2566
17DEFAULTSERVICES = peerinfo transport core
18
19[statistics]
20PORT = 2567
21
22[transport-tcp]
23PORT = 2568
24
25[peerinfo]
26PORT = 2569
27
28[core]
29PORT = 2570
30#DEBUG = YES
31
32[testing]
33NUM_PEERS = 5
34WEAKRANDOM = YES
35TOPOLOGY = 1
36F2F = 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 @@
25#include "gnunet_testing_lib.h" 25#include "gnunet_testing_lib.h"
26#include "gnunet_core_service.h" 26#include "gnunet_core_service.h"
27 27
28#define VERBOSE GNUNET_YES 28#define VERBOSE GNUNET_NO
29 29
30/** 30/**
31 * How long until we give up on connecting the peers? 31 * How long until we give up on connecting the peers?
@@ -250,7 +250,9 @@ static size_t
250transmit_ready (void *cls, size_t size, void *buf) 250transmit_ready (void *cls, size_t size, void *buf)
251{ 251{
252 struct GNUNET_MessageHeader *m; 252 struct GNUNET_MessageHeader *m;
253#if VERBOSE
253 struct GNUNET_PeerIdentity *peer = cls; 254 struct GNUNET_PeerIdentity *peer = cls;
255#endif
254 GNUNET_assert (buf != NULL); 256 GNUNET_assert (buf != NULL);
255 m = (struct GNUNET_MessageHeader *) buf; 257 m = (struct GNUNET_MessageHeader *) buf;
256 m->type = htons (MTYPE); 258 m->type = htons (MTYPE);
@@ -258,8 +260,8 @@ transmit_ready (void *cls, size_t size, void *buf)
258 260
259 transmit_ready_called++; 261 transmit_ready_called++;
260#if VERBOSE 262#if VERBOSE
261 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 263 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
262 "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); 264 "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);
263#endif 265#endif
264 GNUNET_SCHEDULER_add_now(sched, &schedule_transmission, NULL); 266 GNUNET_SCHEDULER_add_now(sched, &schedule_transmission, NULL);
265 return sizeof (struct GNUNET_MessageHeader); 267 return sizeof (struct GNUNET_MessageHeader);