diff options
-rw-r--r-- | src/dv/Makefile.am | 15 | ||||
-rw-r--r-- | src/dv/test_dv_topology.c | 753 | ||||
-rw-r--r-- | src/dv/test_transport_api_data.conf | 125 | ||||
-rw-r--r-- | src/dv/test_transport_api_dv_peer1.conf | 118 | ||||
-rw-r--r-- | src/dv/test_transport_api_dv_peer2.conf | 118 | ||||
-rw-r--r-- | src/dv/test_transport_api_dv_peer3.conf | 118 | ||||
-rw-r--r-- | src/dv/test_transport_api_dv_peer4.conf | 117 | ||||
-rw-r--r-- | src/dv/test_transport_dv_data.conf (renamed from src/dv/test_dv_topology.conf) | 34 |
8 files changed, 20 insertions, 1378 deletions
diff --git a/src/dv/Makefile.am b/src/dv/Makefile.am index 99a3e6114..14dd18c1c 100644 --- a/src/dv/Makefile.am +++ b/src/dv/Makefile.am | |||
@@ -62,18 +62,5 @@ test_transport_api_dv_LDADD = \ | |||
62 | $(top_builddir)/src/util/libgnunetutil.la \ | 62 | $(top_builddir)/src/util/libgnunetutil.la \ |
63 | $(top_builddir)/src/testing/libgnunettesting.la | 63 | $(top_builddir)/src/testing/libgnunettesting.la |
64 | 64 | ||
65 | #test_dv_topology_SOURCES = \ | ||
66 | # test_dv_topology.c | ||
67 | #test_dv_topology_LDADD = \ | ||
68 | # $(top_builddir)/src/transport/libgnunettransport.la \ | ||
69 | # $(top_builddir)/src/util/libgnunetutil.la \ | ||
70 | # $(top_builddir)/src/testing/libgnunettesting.la | ||
71 | |||
72 | |||
73 | EXTRA_DIST = \ | 65 | EXTRA_DIST = \ |
74 | test_transport_dv_data.conf \ | 66 | test_transport_dv_data.conf |
75 | test_transport_api_dv_peer1.conf \ | ||
76 | test_transport_api_dv_peer2.conf \ | ||
77 | test_transport_api_dv_peer3.conf | ||
78 | |||
79 | |||
diff --git a/src/dv/test_dv_topology.c b/src/dv/test_dv_topology.c deleted file mode 100644 index 06f4b09ea..000000000 --- a/src/dv/test_dv_topology.c +++ /dev/null | |||
@@ -1,753 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2009 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 2, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | /** | ||
21 | * @file testing/test_testing_topology.c | ||
22 | * @brief base testcase for testing all the topologies provided | ||
23 | */ | ||
24 | #include "platform.h" | ||
25 | #include "gnunet_testing_lib.h" | ||
26 | #include "gnunet_core_service.h" | ||
27 | |||
28 | #define VERBOSE GNUNET_YES | ||
29 | |||
30 | /** | ||
31 | * How long until we fail the whole testcase? | ||
32 | */ | ||
33 | #define TEST_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) | ||
34 | |||
35 | /** | ||
36 | * How long until we give up on connecting the peers? | ||
37 | */ | ||
38 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) | ||
39 | |||
40 | #define DEFAULT_NUM_PEERS 4 | ||
41 | |||
42 | #define MAX_OUTSTANDING_CONNECTIONS 300 | ||
43 | |||
44 | static float fail_percentage = 0.05; | ||
45 | |||
46 | static int ok; | ||
47 | |||
48 | static unsigned long long num_peers; | ||
49 | |||
50 | static unsigned int total_connections; | ||
51 | |||
52 | static unsigned int failed_connections; | ||
53 | |||
54 | static unsigned int total_server_connections; | ||
55 | |||
56 | static unsigned int total_messages_received; | ||
57 | |||
58 | static unsigned int expected_messages; | ||
59 | |||
60 | static unsigned int expected_connections; | ||
61 | |||
62 | static unsigned long long peers_left; | ||
63 | |||
64 | static struct GNUNET_TESTING_PeerGroup *pg; | ||
65 | |||
66 | static struct GNUNET_SCHEDULER_Handle *sched; | ||
67 | |||
68 | const struct GNUNET_CONFIGURATION_Handle *main_cfg; | ||
69 | |||
70 | GNUNET_SCHEDULER_TaskIdentifier die_task; | ||
71 | |||
72 | static char *dotOutFileName; | ||
73 | |||
74 | static FILE *dotOutFile; | ||
75 | |||
76 | static char *topology_string; | ||
77 | |||
78 | static int transmit_ready_scheduled; | ||
79 | |||
80 | static int transmit_ready_failed; | ||
81 | |||
82 | static int transmit_ready_called; | ||
83 | |||
84 | static enum GNUNET_TESTING_Topology topology; | ||
85 | |||
86 | static char *test_directory; | ||
87 | |||
88 | #define MTYPE 12345 | ||
89 | |||
90 | struct GNUNET_TestMessage | ||
91 | { | ||
92 | /** | ||
93 | * Header of the message | ||
94 | */ | ||
95 | struct GNUNET_MessageHeader header; | ||
96 | |||
97 | /** | ||
98 | * Unique identifier for this message. | ||
99 | */ | ||
100 | uint32_t uid; | ||
101 | }; | ||
102 | |||
103 | struct TestMessageContext | ||
104 | { | ||
105 | /* This is a linked list */ | ||
106 | struct TestMessageContext *next; | ||
107 | |||
108 | /* Handle to the sending peer core */ | ||
109 | struct GNUNET_CORE_Handle *peer1handle; | ||
110 | |||
111 | /* Handle to the receiving peer core */ | ||
112 | struct GNUNET_CORE_Handle *peer2handle; | ||
113 | |||
114 | /* Handle to the sending peer daemon */ | ||
115 | struct GNUNET_TESTING_Daemon *peer1; | ||
116 | |||
117 | /* Handle to the receiving peer daemon */ | ||
118 | struct GNUNET_TESTING_Daemon *peer2; | ||
119 | |||
120 | /* Identifier for this message, so we don't disconnect other peers! */ | ||
121 | uint32_t uid; | ||
122 | |||
123 | /* Task for disconnecting cores, allow task to be cancelled on shutdown */ | ||
124 | GNUNET_SCHEDULER_TaskIdentifier disconnect_task; | ||
125 | |||
126 | }; | ||
127 | |||
128 | static struct TestMessageContext *test_messages; | ||
129 | |||
130 | static void | ||
131 | finish_testing () | ||
132 | { | ||
133 | GNUNET_assert (pg != NULL); | ||
134 | struct TestMessageContext *pos; | ||
135 | struct TestMessageContext *free_pos; | ||
136 | #if VERBOSE | ||
137 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
138 | "Called finish testing, stopping daemons.\n"); | ||
139 | #endif | ||
140 | int count; | ||
141 | count = 0; | ||
142 | pos = test_messages; | ||
143 | while (pos != NULL) | ||
144 | { | ||
145 | if (pos->peer1handle != NULL) | ||
146 | { | ||
147 | GNUNET_CORE_disconnect(pos->peer1handle); | ||
148 | pos->peer1handle = NULL; | ||
149 | } | ||
150 | if (pos->peer2handle != NULL) | ||
151 | { | ||
152 | GNUNET_CORE_disconnect(pos->peer2handle); | ||
153 | pos->peer2handle = NULL; | ||
154 | } | ||
155 | free_pos = pos; | ||
156 | pos = pos->next; | ||
157 | if (free_pos->disconnect_task != GNUNET_SCHEDULER_NO_TASK) | ||
158 | { | ||
159 | GNUNET_SCHEDULER_cancel(sched, free_pos->disconnect_task); | ||
160 | } | ||
161 | GNUNET_free(free_pos); | ||
162 | } | ||
163 | #if VERBOSE | ||
164 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
165 | "transmit_ready's scheduled %d, failed %d, transmit_ready's called %d\n", transmit_ready_scheduled, transmit_ready_failed, transmit_ready_called); | ||
166 | #endif | ||
167 | sleep(1); | ||
168 | #if VERBOSE | ||
169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
170 | "Calling daemons_stop\n"); | ||
171 | #endif | ||
172 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT); | ||
173 | #if VERBOSE | ||
174 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
175 | "daemons_stop finished\n"); | ||
176 | #endif | ||
177 | if (dotOutFile != NULL) | ||
178 | { | ||
179 | fprintf(dotOutFile, "}"); | ||
180 | fclose(dotOutFile); | ||
181 | } | ||
182 | |||
183 | ok = 0; | ||
184 | } | ||
185 | |||
186 | |||
187 | static void | ||
188 | disconnect_cores (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | ||
189 | { | ||
190 | struct TestMessageContext *pos = cls; | ||
191 | |||
192 | /* Disconnect from the respective cores */ | ||
193 | #if VERBOSE | ||
194 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
195 | "Disconnecting from peer 1 `%4s'\n", GNUNET_i2s (&pos->peer1->id)); | ||
196 | #endif | ||
197 | if (pos->peer1handle != NULL) | ||
198 | GNUNET_CORE_disconnect(pos->peer1handle); | ||
199 | #if VERBOSE | ||
200 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
201 | "Disconnecting from peer 2 `%4s'\n", GNUNET_i2s (&pos->peer2->id)); | ||
202 | #endif | ||
203 | if (pos->peer2handle != NULL) | ||
204 | GNUNET_CORE_disconnect(pos->peer2handle); | ||
205 | /* Set handles to NULL so test case can be ended properly */ | ||
206 | pos->peer1handle = NULL; | ||
207 | pos->peer2handle = NULL; | ||
208 | pos->disconnect_task = GNUNET_SCHEDULER_NO_TASK; | ||
209 | /* Decrement total connections so new can be established */ | ||
210 | total_server_connections -= 2; | ||
211 | } | ||
212 | |||
213 | static int | ||
214 | process_mtype (void *cls, | ||
215 | const struct GNUNET_PeerIdentity *peer, | ||
216 | const struct GNUNET_MessageHeader *message, | ||
217 | struct GNUNET_TIME_Relative latency, | ||
218 | uint32_t distance) | ||
219 | { | ||
220 | struct TestMessageContext *pos = cls; | ||
221 | struct GNUNET_TestMessage *msg = (struct GNUNET_TestMessage *)message; | ||
222 | |||
223 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
224 | "Received message from `%4s', type %d, distance %u.\n", GNUNET_i2s (peer), ntohs(message->type), distance); | ||
225 | if (pos->uid != ntohl(msg->uid)) | ||
226 | return GNUNET_OK; | ||
227 | |||
228 | total_messages_received++; | ||
229 | #if VERBOSE | ||
230 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
231 | "Received message from `%4s', type %d, distance %u.\n", GNUNET_i2s (peer), ntohs(message->type), distance); | ||
232 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
233 | "Total messages received %d, expected %d.\n", total_messages_received, expected_messages); | ||
234 | #endif | ||
235 | |||
236 | if (total_messages_received == expected_messages) | ||
237 | { | ||
238 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
239 | GNUNET_SCHEDULER_add_now (sched, &finish_testing, NULL); | ||
240 | } | ||
241 | else | ||
242 | { | ||
243 | pos->disconnect_task = GNUNET_SCHEDULER_add_now(sched, &disconnect_cores, pos); | ||
244 | } | ||
245 | |||
246 | return GNUNET_OK; | ||
247 | } | ||
248 | |||
249 | static void | ||
250 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | ||
251 | { | ||
252 | char *msg = cls; | ||
253 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
254 | "End badly was called (%s)... stopping daemons.\n", msg); | ||
255 | struct TestMessageContext *pos; | ||
256 | struct TestMessageContext *free_pos; | ||
257 | |||
258 | pos = test_messages; | ||
259 | while (pos != NULL) | ||
260 | { | ||
261 | if (pos->peer1handle != NULL) | ||
262 | { | ||
263 | GNUNET_CORE_disconnect(pos->peer1handle); | ||
264 | pos->peer1handle = NULL; | ||
265 | } | ||
266 | if (pos->peer2handle != NULL) | ||
267 | { | ||
268 | GNUNET_CORE_disconnect(pos->peer2handle); | ||
269 | pos->peer2handle = NULL; | ||
270 | } | ||
271 | free_pos = pos; | ||
272 | pos = pos->next; | ||
273 | GNUNET_free(free_pos); | ||
274 | } | ||
275 | |||
276 | if (pg != NULL) | ||
277 | { | ||
278 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT); | ||
279 | ok = 7331; /* Opposite of leet */ | ||
280 | } | ||
281 | else | ||
282 | ok = 401; /* Never got peers started */ | ||
283 | |||
284 | if (dotOutFile != NULL) | ||
285 | { | ||
286 | fprintf(dotOutFile, "}"); | ||
287 | fclose(dotOutFile); | ||
288 | } | ||
289 | } | ||
290 | |||
291 | |||
292 | |||
293 | static size_t | ||
294 | transmit_ready (void *cls, size_t size, void *buf) | ||
295 | { | ||
296 | struct GNUNET_TestMessage *m; | ||
297 | struct TestMessageContext *pos = cls; | ||
298 | |||
299 | GNUNET_assert (buf != NULL); | ||
300 | m = (struct GNUNET_TestMessage *) buf; | ||
301 | m->header.type = htons (MTYPE); | ||
302 | m->header.size = htons (sizeof (struct GNUNET_TestMessage)); | ||
303 | m->uid = htonl(pos->uid); | ||
304 | transmit_ready_called++; | ||
305 | #if VERBOSE | ||
306 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
307 | "transmit ready for peer %s\ntransmit_ready's scheduled %d, transmit_ready's called %d\n", GNUNET_i2s(&pos->peer1->id), transmit_ready_scheduled, transmit_ready_called); | ||
308 | #endif | ||
309 | return sizeof (struct GNUNET_TestMessage); | ||
310 | } | ||
311 | |||
312 | |||
313 | static struct GNUNET_CORE_MessageHandler no_handlers[] = { | ||
314 | {NULL, 0, 0} | ||
315 | }; | ||
316 | |||
317 | static struct GNUNET_CORE_MessageHandler handlers[] = { | ||
318 | {&process_mtype, MTYPE, sizeof (struct GNUNET_TestMessage)}, | ||
319 | {NULL, 0, 0} | ||
320 | }; | ||
321 | |||
322 | static void | ||
323 | init_notify_peer2 (void *cls, | ||
324 | struct GNUNET_CORE_Handle *server, | ||
325 | const struct GNUNET_PeerIdentity *my_identity, | ||
326 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey) | ||
327 | { | ||
328 | struct TestMessageContext *pos = cls; | ||
329 | |||
330 | #if VERBOSE | ||
331 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
332 | "Core connection to `%4s' established, scheduling message send\n", | ||
333 | GNUNET_i2s (my_identity)); | ||
334 | #endif | ||
335 | total_server_connections++; | ||
336 | |||
337 | if (NULL == GNUNET_CORE_notify_transmit_ready (pos->peer1handle, | ||
338 | 0, | ||
339 | TIMEOUT, | ||
340 | &pos->peer2->id, | ||
341 | sizeof (struct GNUNET_TestMessage), | ||
342 | &transmit_ready, pos)) | ||
343 | { | ||
344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
345 | "RECEIVED NULL when asking core (1) for transmission to peer `%4s'\n", | ||
346 | GNUNET_i2s (&pos->peer2->id)); | ||
347 | transmit_ready_failed++; | ||
348 | } | ||
349 | else | ||
350 | { | ||
351 | transmit_ready_scheduled++; | ||
352 | } | ||
353 | } | ||
354 | |||
355 | |||
356 | static void | ||
357 | init_notify_peer1 (void *cls, | ||
358 | struct GNUNET_CORE_Handle *server, | ||
359 | const struct GNUNET_PeerIdentity *my_identity, | ||
360 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey) | ||
361 | { | ||
362 | struct TestMessageContext *pos = cls; | ||
363 | total_server_connections++; | ||
364 | |||
365 | #if VERBOSE | ||
366 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
367 | "Core connection to `%4s' established, setting up handles\n", | ||
368 | GNUNET_i2s (my_identity)); | ||
369 | #endif | ||
370 | |||
371 | /* | ||
372 | * Connect to the receiving peer | ||
373 | */ | ||
374 | pos->peer2handle = GNUNET_CORE_connect (sched, | ||
375 | pos->peer2->cfg, | ||
376 | TIMEOUT, | ||
377 | pos, | ||
378 | &init_notify_peer2, | ||
379 | NULL, | ||
380 | NULL, | ||
381 | NULL, | ||
382 | GNUNET_YES, NULL, GNUNET_YES, handlers); | ||
383 | |||
384 | } | ||
385 | |||
386 | |||
387 | static void | ||
388 | send_test_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | ||
389 | { | ||
390 | struct TestMessageContext *pos = cls; | ||
391 | |||
392 | if ((tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) || (cls == NULL)) | ||
393 | return; | ||
394 | |||
395 | if (die_task == GNUNET_SCHEDULER_NO_TASK) | ||
396 | { | ||
397 | die_task = GNUNET_SCHEDULER_add_delayed (sched, | ||
398 | TEST_TIMEOUT, | ||
399 | &end_badly, "from send_test_messages (timeout)"); | ||
400 | } | ||
401 | |||
402 | if (total_server_connections >= MAX_OUTSTANDING_CONNECTIONS) | ||
403 | { | ||
404 | GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1), | ||
405 | &send_test_messages, pos); | ||
406 | return; /* Otherwise we'll double schedule messages here! */ | ||
407 | } | ||
408 | |||
409 | /* | ||
410 | * Connect to the sending peer | ||
411 | */ | ||
412 | pos->peer1handle = GNUNET_CORE_connect (sched, | ||
413 | pos->peer1->cfg, | ||
414 | TIMEOUT, | ||
415 | pos, | ||
416 | &init_notify_peer1, | ||
417 | NULL, | ||
418 | NULL, | ||
419 | NULL, | ||
420 | GNUNET_NO, NULL, GNUNET_NO, no_handlers); | ||
421 | |||
422 | GNUNET_assert(pos->peer1handle != NULL); | ||
423 | |||
424 | if (total_server_connections < MAX_OUTSTANDING_CONNECTIONS) | ||
425 | { | ||
426 | GNUNET_SCHEDULER_add_now (sched, | ||
427 | &send_test_messages, pos->next); | ||
428 | } | ||
429 | else | ||
430 | { | ||
431 | GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1), | ||
432 | &send_test_messages, pos->next); | ||
433 | } | ||
434 | } | ||
435 | |||
436 | |||
437 | static void | ||
438 | schedule_dv_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | ||
439 | { | ||
440 | struct TestMessageContext *pos; | ||
441 | struct TestMessageContext *new_message; | ||
442 | struct TestMessageContext *last; | ||
443 | struct TestMessageContext *new_list; | ||
444 | int i; | ||
445 | int other; | ||
446 | |||
447 | if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) | ||
448 | return; | ||
449 | |||
450 | pos = test_messages; | ||
451 | last = NULL; | ||
452 | while (pos != NULL) | ||
453 | { | ||
454 | last = pos; | ||
455 | pos = pos->next; | ||
456 | } | ||
457 | |||
458 | new_list = NULL; | ||
459 | for (i = 0; i < num_peers; i++) | ||
460 | { | ||
461 | new_message = GNUNET_malloc(sizeof(struct TestMessageContext)); | ||
462 | other = i + 2; | ||
463 | if (other >= num_peers) | ||
464 | other = other - num_peers; | ||
465 | new_message->peer1 = GNUNET_TESTING_daemon_get(pg, i); | ||
466 | new_message->peer2 = GNUNET_TESTING_daemon_get(pg, other); | ||
467 | |||
468 | new_message->uid = total_connections + i + 1; | ||
469 | new_message->next = new_list; | ||
470 | #if VERBOSE | ||
471 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
472 | "Scheduled message between `%4s' and `%4s'\n", | ||
473 | new_message->peer1->shortname, new_message->peer2->shortname); | ||
474 | #endif | ||
475 | |||
476 | new_list = new_message; | ||
477 | expected_messages++; | ||
478 | } | ||
479 | |||
480 | if (dotOutFile != NULL) | ||
481 | { | ||
482 | fprintf(dotOutFile, "}"); | ||
483 | fclose (dotOutFile); | ||
484 | dotOutFile = NULL; | ||
485 | } | ||
486 | |||
487 | if (last != NULL) | ||
488 | last->next = new_list; | ||
489 | else | ||
490 | test_messages = new_list; | ||
491 | |||
492 | GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 1), &send_test_messages, test_messages); | ||
493 | } | ||
494 | |||
495 | |||
496 | void | ||
497 | topology_callback (void *cls, | ||
498 | const struct GNUNET_PeerIdentity *first, | ||
499 | const struct GNUNET_PeerIdentity *second, | ||
500 | const struct GNUNET_CONFIGURATION_Handle *first_cfg, | ||
501 | const struct GNUNET_CONFIGURATION_Handle *second_cfg, | ||
502 | struct GNUNET_TESTING_Daemon *first_daemon, | ||
503 | struct GNUNET_TESTING_Daemon *second_daemon, | ||
504 | const char *emsg) | ||
505 | { | ||
506 | //struct TestMessageContext *temp_context; | ||
507 | if (emsg == NULL) | ||
508 | { | ||
509 | total_connections++; | ||
510 | #if VERBOSE | ||
511 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "connected peer %s to peer %s\n", | ||
512 | first_daemon->shortname, | ||
513 | second_daemon->shortname); | ||
514 | #endif | ||
515 | /*temp_context = GNUNET_malloc(sizeof(struct TestMessageContext)); | ||
516 | temp_context->peer1 = first_daemon; | ||
517 | temp_context->peer2 = second_daemon; | ||
518 | temp_context->next = test_messages; | ||
519 | temp_context->uid = total_connections; | ||
520 | temp_context->disconnect_task = GNUNET_SCHEDULER_NO_TASK; | ||
521 | test_messages = temp_context; | ||
522 | |||
523 | expected_messages++;*/ | ||
524 | if (dotOutFile != NULL) | ||
525 | fprintf(dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, second_daemon->shortname); | ||
526 | } | ||
527 | #if VERBOSE | ||
528 | else | ||
529 | { | ||
530 | failed_connections++; | ||
531 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to connect peer %s to peer %s with error :\n%s\n", | ||
532 | first_daemon->shortname, | ||
533 | second_daemon->shortname, emsg); | ||
534 | } | ||
535 | #endif | ||
536 | |||
537 | if (total_connections == expected_connections) | ||
538 | { | ||
539 | #if VERBOSE | ||
540 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
541 | "Created %d total connections, which is our target number! Calling send messages.\n", | ||
542 | total_connections); | ||
543 | #endif | ||
544 | |||
545 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
546 | die_task = GNUNET_SCHEDULER_NO_TASK; | ||
547 | GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 1), &schedule_dv_messages, test_messages); | ||
548 | } | ||
549 | else if (total_connections + failed_connections == expected_connections) | ||
550 | { | ||
551 | if (failed_connections < (unsigned int)(fail_percentage * total_connections)) | ||
552 | { | ||
553 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
554 | die_task = GNUNET_SCHEDULER_NO_TASK; | ||
555 | GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 1), &schedule_dv_messages, test_messages); | ||
556 | } | ||
557 | else | ||
558 | { | ||
559 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
560 | die_task = GNUNET_SCHEDULER_add_now (sched, | ||
561 | &end_badly, "from topology_callback (too many failed connections)"); | ||
562 | } | ||
563 | } | ||
564 | else | ||
565 | { | ||
566 | #if VERBOSE | ||
567 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
568 | "Have %d total connections, %d failed connections, Want %d (at least %d)\n", | ||
569 | total_connections, failed_connections, expected_connections, expected_connections - (unsigned int)(fail_percentage * expected_connections)); | ||
570 | #endif | ||
571 | } | ||
572 | } | ||
573 | |||
574 | |||
575 | static void | ||
576 | create_topology () | ||
577 | { | ||
578 | expected_connections = -1; | ||
579 | if ((pg != NULL) && (peers_left == 0)) | ||
580 | { | ||
581 | /* create_topology will read the topology information from | ||
582 | the config already contained in the peer group, so should | ||
583 | we have create_topology called from start peers? I think | ||
584 | maybe this way is best so that the client can know both | ||
585 | when peers are started, and when they are connected. | ||
586 | */ | ||
587 | expected_connections = GNUNET_TESTING_create_topology (pg, topology, GNUNET_TESTING_TOPOLOGY_NONE, ""); | ||
588 | #if VERBOSE | ||
589 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
590 | "Have %d expected connections\n", expected_connections); | ||
591 | #endif | ||
592 | } | ||
593 | |||
594 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
595 | if (expected_connections == GNUNET_SYSERR) | ||
596 | { | ||
597 | die_task = GNUNET_SCHEDULER_add_now (sched, | ||
598 | &end_badly, "from create topology (bad return)"); | ||
599 | } | ||
600 | die_task = GNUNET_SCHEDULER_add_delayed (sched, | ||
601 | TEST_TIMEOUT, | ||
602 | &end_badly, "from create topology (timeout)"); | ||
603 | } | ||
604 | |||
605 | |||
606 | static void | ||
607 | my_cb (void *cls, | ||
608 | const struct GNUNET_PeerIdentity *id, | ||
609 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
610 | struct GNUNET_TESTING_Daemon *d, const char *emsg) | ||
611 | { | ||
612 | GNUNET_assert (id != NULL); | ||
613 | #if VERBOSE | ||
614 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n", | ||
615 | (num_peers - peers_left) + 1, num_peers); | ||
616 | #endif | ||
617 | peers_left--; | ||
618 | if (peers_left == 0) | ||
619 | { | ||
620 | #if VERBOSE | ||
621 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
622 | "All %d daemons started, now creating topology!\n", | ||
623 | num_peers); | ||
624 | #endif | ||
625 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
626 | /* Set up task in case topology creation doesn't finish | ||
627 | * within a reasonable amount of time */ | ||
628 | die_task = GNUNET_SCHEDULER_add_delayed (sched, | ||
629 | GNUNET_TIME_relative_multiply | ||
630 | (GNUNET_TIME_UNIT_MINUTES, 5), | ||
631 | &end_badly, "from my_cb"); | ||
632 | create_topology (); | ||
633 | ok = 0; | ||
634 | } | ||
635 | } | ||
636 | |||
637 | |||
638 | static void | ||
639 | run (void *cls, | ||
640 | struct GNUNET_SCHEDULER_Handle *s, | ||
641 | char *const *args, | ||
642 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
643 | { | ||
644 | unsigned long long topology_num; | ||
645 | sched = s; | ||
646 | ok = 1; | ||
647 | |||
648 | dotOutFileName = strdup("topology.dot"); | ||
649 | dotOutFile = fopen (dotOutFileName, "w"); | ||
650 | if (dotOutFile != NULL) | ||
651 | { | ||
652 | fprintf (dotOutFile, "strict graph G {\n"); | ||
653 | } | ||
654 | |||
655 | #if VERBOSE | ||
656 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
657 | "Starting daemons based on config file %s\n", cfgfile); | ||
658 | #endif | ||
659 | |||
660 | if (GNUNET_YES != GNUNET_CONFIGURATION_get_value_string(cfg, "paths", "servicehome", &test_directory)) | ||
661 | { | ||
662 | ok = 404; | ||
663 | return; | ||
664 | } | ||
665 | |||
666 | if (GNUNET_YES == | ||
667 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "topology", | ||
668 | &topology_num)) | ||
669 | topology = topology_num; | ||
670 | |||
671 | if (GNUNET_SYSERR == | ||
672 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "num_peers", | ||
673 | &num_peers)) | ||
674 | num_peers = DEFAULT_NUM_PEERS; | ||
675 | |||
676 | main_cfg = cfg; | ||
677 | |||
678 | peers_left = num_peers; | ||
679 | |||
680 | /* Set up a task to end testing if peer start fails */ | ||
681 | die_task = GNUNET_SCHEDULER_add_delayed (sched, | ||
682 | GNUNET_TIME_relative_multiply | ||
683 | (GNUNET_TIME_UNIT_MINUTES, 5), | ||
684 | &end_badly, "didn't start all daemons in reasonable amount of time!!!"); | ||
685 | |||
686 | pg = GNUNET_TESTING_daemons_start (sched, cfg, | ||
687 | peers_left, | ||
688 | TIMEOUT, | ||
689 | NULL, NULL, | ||
690 | &my_cb, NULL, | ||
691 | &topology_callback, NULL, NULL); | ||
692 | |||
693 | } | ||
694 | |||
695 | static int | ||
696 | check () | ||
697 | { | ||
698 | char *binary_name; | ||
699 | char *config_file_name; | ||
700 | GNUNET_asprintf(&binary_name, "test-dv-topology", topology_string); | ||
701 | GNUNET_asprintf(&config_file_name, "test_dv_topology.conf", topology_string); | ||
702 | |||
703 | int ret; | ||
704 | char *const argv[] = {binary_name, | ||
705 | "-c", | ||
706 | config_file_name, | ||
707 | #if VERBOSE | ||
708 | "-L", "DEBUG", | ||
709 | #endif | ||
710 | NULL | ||
711 | }; | ||
712 | struct GNUNET_GETOPT_CommandLineOption options[] = { | ||
713 | GNUNET_GETOPT_OPTION_END | ||
714 | }; | ||
715 | ret = GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | ||
716 | argv, binary_name, "nohelp", | ||
717 | options, &run, &ok); | ||
718 | if (ret != GNUNET_OK) | ||
719 | { | ||
720 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "`test-dv-topology': Failed with error code %d\n", ret); | ||
721 | } | ||
722 | GNUNET_free(binary_name); | ||
723 | GNUNET_free(config_file_name); | ||
724 | return ok; | ||
725 | } | ||
726 | |||
727 | int | ||
728 | main (int argc, char *argv[]) | ||
729 | { | ||
730 | int ret; | ||
731 | |||
732 | GNUNET_log_setup ("test-dv-topology", | ||
733 | #if VERBOSE | ||
734 | "DEBUG", | ||
735 | #else | ||
736 | "WARNING", | ||
737 | #endif | ||
738 | NULL); | ||
739 | ret = check (); | ||
740 | |||
741 | /** | ||
742 | * Need to remove base directory, subdirectories taken care | ||
743 | * of by the testing framework. | ||
744 | */ | ||
745 | if (GNUNET_DISK_directory_remove (test_directory) != GNUNET_OK) | ||
746 | { | ||
747 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Failed to remove testing directory %s\n", test_directory); | ||
748 | } | ||
749 | |||
750 | return ret; | ||
751 | } | ||
752 | |||
753 | /* end of test_testing_group.c */ | ||
diff --git a/src/dv/test_transport_api_data.conf b/src/dv/test_transport_api_data.conf deleted file mode 100644 index a04dc536d..000000000 --- a/src/dv/test_transport_api_data.conf +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | [PATHS] | ||
2 | SERVICEHOME = /tmp/test-transport-api/ | ||
3 | DEFAULTCONFIG = test_transport_api_data.conf | ||
4 | |||
5 | [transport-tcp] | ||
6 | PORT = 2094 | ||
7 | |||
8 | [fs] | ||
9 | ACCEPT_FROM6 = ::1; | ||
10 | ACCEPT_FROM = 127.0.0.1; | ||
11 | BINARY = gnunet-service-fs | ||
12 | CONFIG = $DEFAULTCONFIG | ||
13 | HOME = $SERVICEHOME | ||
14 | HOSTNAME = localhost | ||
15 | PORT = 2094 | ||
16 | INDEXDB = $SERVICEHOME/idxinfo.lst | ||
17 | |||
18 | [datastore-sqlite] | ||
19 | FILENAME = $SERVICEHOME/datastore/sqlite.db | ||
20 | |||
21 | [datastore] | ||
22 | DATABASE = sqlite | ||
23 | BLOOMFILTER = $SERVICEHOME/fs/bloomfilter | ||
24 | QUOTA = 100000000 | ||
25 | ACCEPT_FROM6 = ::1; | ||
26 | ACCEPT_FROM = 127.0.0.1; | ||
27 | BINARY = gnunet-service-datastore | ||
28 | CONFIG = $DEFAULTCONFIG | ||
29 | HOME = $SERVICEHOME | ||
30 | HOSTNAME = localhost | ||
31 | PORT = 2093 | ||
32 | |||
33 | [hostlist] | ||
34 | HTTP-PROXY = | ||
35 | SERVERS = http://gnunet.org:8080/ | ||
36 | OPTIONS = -b | ||
37 | BINARY = gnunet-daemon-hostlist | ||
38 | CONFIG = $DEFAULTCONFIG | ||
39 | HOME = $SERVICEHOME | ||
40 | HOSTNAME = localhost | ||
41 | HTTPPORT = 8080 | ||
42 | |||
43 | [topology] | ||
44 | BINARY = gnunet-daemon-topology | ||
45 | CONFIG = $DEFAULTCONFIG | ||
46 | FRIENDS = $SERVICEHOME/friends | ||
47 | TARGET-CONNECTION-COUNT = 16 | ||
48 | AUTOCONNECT = YES | ||
49 | FRIENDS-ONLY = NO | ||
50 | MINIMUM-FRIENDS = 0 | ||
51 | |||
52 | [core] | ||
53 | TOTAL_QUOTA_OUT = 3932160 | ||
54 | TOTAL_QUOTA_IN = 3932160 | ||
55 | ACCEPT_FROM6 = ::1; | ||
56 | ACCEPT_FROM = 127.0.0.1; | ||
57 | BINARY = gnunet-service-core | ||
58 | CONFIG = $DEFAULTCONFIG | ||
59 | HOME = $SERVICEHOME | ||
60 | HOSTNAME = localhost | ||
61 | PORT = 2092 | ||
62 | DEBUG = YES | ||
63 | |||
64 | [transport] | ||
65 | plugins = tcp | ||
66 | DEBUG = NO | ||
67 | PREFIX = | ||
68 | ACCEPT_FROM6 = ::1; | ||
69 | ACCEPT_FROM = 127.0.0.1; | ||
70 | NEIGHBOUR_LIMIT = 50 | ||
71 | BINARY = gnunet-service-transport | ||
72 | CONFIG = $DEFAULTCONFIG | ||
73 | HOME = $SERVICEHOME | ||
74 | HOSTNAME = localhost | ||
75 | PORT = 2091 | ||
76 | |||
77 | [peerinfo] | ||
78 | TRUST = $SERVICEHOME/data/credit/ | ||
79 | HOSTS = $SERVICEHOME/data/hosts/ | ||
80 | ACCEPT_FROM6 = ::1; | ||
81 | ACCEPT_FROM = 127.0.0.1; | ||
82 | BINARY = gnunet-service-peerinfo | ||
83 | CONFIG = $DEFAULTCONFIG | ||
84 | HOME = $SERVICEHOME | ||
85 | HOSTNAME = localhost | ||
86 | PORT = 2090 | ||
87 | |||
88 | [resolver] | ||
89 | ACCEPT_FROM6 = ::1; | ||
90 | ACCEPT_FROM = 127.0.0.1; | ||
91 | BINARY = gnunet-service-resolver | ||
92 | CONFIG = $DEFAULTCONFIG | ||
93 | HOME = $SERVICEHOME | ||
94 | HOSTNAME = localhost | ||
95 | PORT = 2089 | ||
96 | |||
97 | [statistics] | ||
98 | ACCEPT_FROM6 = ::1; | ||
99 | ACCEPT_FROM = 127.0.0.1; | ||
100 | BINARY = gnunet-service-statistics | ||
101 | CONFIG = $DEFAULTCONFIG | ||
102 | HOME = $SERVICEHOME | ||
103 | HOSTNAME = localhost | ||
104 | PORT = 2088 | ||
105 | |||
106 | [arm] | ||
107 | DEFAULTSERVICES = | ||
108 | ACCEPT_FROM6 = ::1; | ||
109 | ACCEPT_FROM = 127.0.0.1; | ||
110 | BINARY = gnunet-service-arm | ||
111 | CONFIG = $DEFAULTCONFIG | ||
112 | HOME = $SERVICEHOME | ||
113 | HOSTNAME = localhost | ||
114 | PORT = 2087 | ||
115 | |||
116 | [transport-tcp] | ||
117 | TIMEOUT = 300000 | ||
118 | PORT = 2094 | ||
119 | |||
120 | [TESTING] | ||
121 | WEAKRANDOM = NO | ||
122 | |||
123 | [gnunetd] | ||
124 | HOSTKEY = $SERVICEHOME/.hostkey | ||
125 | |||
diff --git a/src/dv/test_transport_api_dv_peer1.conf b/src/dv/test_transport_api_dv_peer1.conf deleted file mode 100644 index af53414d4..000000000 --- a/src/dv/test_transport_api_dv_peer1.conf +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | [hostlist] | ||
2 | HTTP-PROXY = | ||
3 | SERVERS = http://gnunet.org:8080/ | ||
4 | OPTIONS = -b | ||
5 | BINARY = gnunet-daemon-hostlist | ||
6 | CONFIG = $DEFAULTCONFIG | ||
7 | HOME = $SERVICEHOME | ||
8 | HOSTNAME = localhost | ||
9 | HTTPPORT = 8080 | ||
10 | |||
11 | [topology] | ||
12 | BINARY = gnunet-daemon-topology | ||
13 | CONFIG = $DEFAULTCONFIG | ||
14 | FRIENDS = $SERVICEHOME/friends | ||
15 | TARGET-CONNECTION-COUNT = 16 | ||
16 | AUTOCONNECT = YES | ||
17 | FRIENDS-ONLY = NO | ||
18 | MINIMUM-FRIENDS = 0 | ||
19 | |||
20 | [transport] | ||
21 | PLUGINS = tcp dv | ||
22 | DEBUG = NO | ||
23 | #PREFIX = xterm -T transport2 -e gdb --command=cmd --args | ||
24 | #PREFIX = valgrind --leak-check=full | ||
25 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport | ||
26 | ACCEPT_FROM6 = ::1; | ||
27 | ACCEPT_FROM = 127.0.0.1; | ||
28 | NEIGHBOUR_LIMIT = 50 | ||
29 | BINARY = gnunet-service-transport | ||
30 | CONFIG = $DEFAULTCONFIG | ||
31 | HOME = $SERVICEHOME | ||
32 | HOSTNAME = localhost | ||
33 | PORT = 12365 | ||
34 | BLACKLIST_FILE = $SERVICEHOME/blacklist | ||
35 | UNIXPATH = /tmp/gnunet-p1-service-transport.sock | ||
36 | |||
37 | [peerinfo] | ||
38 | TRUST = $SERVICEHOME/data/credit/ | ||
39 | HOSTS = $SERVICEHOME/data/hosts/ | ||
40 | ACCEPT_FROM6 = ::1; | ||
41 | ACCEPT_FROM = 127.0.0.1; | ||
42 | BINARY = gnunet-service-peerinfo | ||
43 | CONFIG = $DEFAULTCONFIG | ||
44 | HOME = $SERVICEHOME | ||
45 | HOSTNAME = localhost | ||
46 | PORT = 12369 | ||
47 | UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock | ||
48 | |||
49 | [resolver] | ||
50 | ACCEPT_FROM6 = ::1; | ||
51 | ACCEPT_FROM = 127.0.0.1; | ||
52 | BINARY = gnunet-service-resolver | ||
53 | CONFIG = $DEFAULTCONFIG | ||
54 | HOME = $SERVICEHOME | ||
55 | HOSTNAME = localhost | ||
56 | PORT = 12364 | ||
57 | UNIXPATH = /tmp/gnunet-p1-service-resolver.sock | ||
58 | |||
59 | [statistics] | ||
60 | ACCEPT_FROM6 = ::1; | ||
61 | ACCEPT_FROM = 127.0.0.1; | ||
62 | BINARY = gnunet-service-statistics | ||
63 | CONFIG = $DEFAULTCONFIG | ||
64 | HOME = $SERVICEHOME | ||
65 | HOSTNAME = localhost | ||
66 | PORT = 12367 | ||
67 | UNIXPATH = /tmp/gnunet-p1-service-statistics.sock | ||
68 | |||
69 | [dv] | ||
70 | DEBUG = NO | ||
71 | ACCEPT_FROM6 = ::1; | ||
72 | ACCEPT_FROM = 127.0.0.1; | ||
73 | #BINARY = gnunet-service-dv | ||
74 | BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/dv/.libs/gnunet-service-dv | ||
75 | #PREFIX = xterm -T dvservice -e gdb --args | ||
76 | #PREFIX = valgrind --log-file=dv1-%p --leak-check=full | ||
77 | CONFIG = $DEFAULTCONFIG | ||
78 | HOME = $SERVICEHOME | ||
79 | HOSTNAME = localhost | ||
80 | PORT = 12370 | ||
81 | |||
82 | [core] | ||
83 | TOTAL_QUOTA_OUT = 3932160 | ||
84 | TOTAL_QUOTA_IN = 3932160 | ||
85 | ACCEPT_FROM6 = ::1; | ||
86 | ACCEPT_FROM = 127.0.0.1; | ||
87 | BINARY = gnunet-service-core | ||
88 | CONFIG = $DEFAULTCONFIG | ||
89 | HOME = $SERVICEHOME | ||
90 | HOSTNAME = localhost | ||
91 | PORT = 12092 | ||
92 | UNIXPATH = /tmp/gnunet-p1-service-core.sock | ||
93 | |||
94 | [arm] | ||
95 | DEFAULTSERVICES = | ||
96 | ACCEPT_FROM6 = ::1; | ||
97 | ACCEPT_FROM = 127.0.0.1; | ||
98 | BINARY = gnunet-service-arm | ||
99 | CONFIG = $DEFAULTCONFIG | ||
100 | HOME = $SERVICEHOME | ||
101 | HOSTNAME = localhost | ||
102 | PORT = 12366 | ||
103 | UNIXPATH = /tmp/gnunet-p1-service-arm.sock | ||
104 | |||
105 | [transport-tcp] | ||
106 | TIMEOUT = 300000 | ||
107 | PORT = 12368 | ||
108 | |||
109 | [TESTING] | ||
110 | WEAKRANDOM = YES | ||
111 | |||
112 | [gnunetd] | ||
113 | HOSTKEY = $SERVICEHOME/.hostkey | ||
114 | |||
115 | [PATHS] | ||
116 | DEFAULTCONFIG = test_transport_api_dv_peer1.conf | ||
117 | SERVICEHOME = /tmp/test-gnunetd-transport-peer-1/ | ||
118 | |||
diff --git a/src/dv/test_transport_api_dv_peer2.conf b/src/dv/test_transport_api_dv_peer2.conf deleted file mode 100644 index 515f6340b..000000000 --- a/src/dv/test_transport_api_dv_peer2.conf +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | [core] | ||
2 | TOTAL_QUOTA_OUT = 3932160 | ||
3 | TOTAL_QUOTA_IN = 3932160 | ||
4 | ACCEPT_FROM6 = ::1; | ||
5 | ACCEPT_FROM = 127.0.0.1; | ||
6 | BINARY = gnunet-service-core | ||
7 | CONFIG = $DEFAULTCONFIG | ||
8 | HOME = $SERVICEHOME | ||
9 | HOSTNAME = localhost | ||
10 | PORT = 22092 | ||
11 | |||
12 | [hostlist] | ||
13 | HTTP-PROXY = | ||
14 | SERVERS = http://gnunet.org:8080/ | ||
15 | OPTIONS = -b | ||
16 | BINARY = gnunet-daemon-hostlist | ||
17 | CONFIG = $DEFAULTCONFIG | ||
18 | HOME = $SERVICEHOME | ||
19 | HOSTNAME = localhost | ||
20 | HTTPPORT = 8080 | ||
21 | |||
22 | [topology] | ||
23 | BINARY = gnunet-daemon-topology | ||
24 | CONFIG = $DEFAULTCONFIG | ||
25 | FRIENDS = $SERVICEHOME/friends | ||
26 | TARGET-CONNECTION-COUNT = 16 | ||
27 | AUTOCONNECT = YES | ||
28 | FRIENDS-ONLY = NO | ||
29 | MINIMUM-FRIENDS = 0 | ||
30 | |||
31 | [transport] | ||
32 | PLUGINS = tcp dv | ||
33 | DEBUG = NO | ||
34 | # PREFIX = | ||
35 | ACCEPT_FROM6 = ::1; | ||
36 | ACCEPT_FROM = 127.0.0.1; | ||
37 | NEIGHBOUR_LIMIT = 50 | ||
38 | #BINARY = gnunet-service-transport | ||
39 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport | ||
40 | CONFIG = $DEFAULTCONFIG | ||
41 | HOME = $SERVICEHOME | ||
42 | HOSTNAME = localhost | ||
43 | PORT = 22365 | ||
44 | #PREFIX = xterm -T transport1 -e gdb --command=cmd --args | ||
45 | #PREFIX = valgrind --leak-check=full | ||
46 | BLACKLIST_FILE = $SERVICEHOME/blacklist | ||
47 | UNIXPATH = /tmp/gnunet-p2-service-transport.sock | ||
48 | |||
49 | [peerinfo] | ||
50 | TRUST = $SERVICEHOME/data/credit/ | ||
51 | HOSTS = $SERVICEHOME/data/hosts/ | ||
52 | ACCEPT_FROM6 = ::1; | ||
53 | ACCEPT_FROM = 127.0.0.1; | ||
54 | BINARY = gnunet-service-peerinfo | ||
55 | CONFIG = $DEFAULTCONFIG | ||
56 | HOME = $SERVICEHOME | ||
57 | HOSTNAME = localhost | ||
58 | PORT = 22369 | ||
59 | UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock | ||
60 | |||
61 | [resolver] | ||
62 | ACCEPT_FROM6 = ::1; | ||
63 | ACCEPT_FROM = 127.0.0.1; | ||
64 | BINARY = gnunet-service-resolver | ||
65 | CONFIG = $DEFAULTCONFIG | ||
66 | HOME = $SERVICEHOME | ||
67 | HOSTNAME = localhost | ||
68 | PORT = 22364 | ||
69 | UNIXPATH = /tmp/gnunet-p2-service-resolver.sock | ||
70 | |||
71 | [statistics] | ||
72 | ACCEPT_FROM6 = ::1; | ||
73 | ACCEPT_FROM = 127.0.0.1; | ||
74 | BINARY = gnunet-service-statistics | ||
75 | CONFIG = $DEFAULTCONFIG | ||
76 | HOME = $SERVICEHOME | ||
77 | HOSTNAME = localhost | ||
78 | PORT = 22367 | ||
79 | UNIXPATH = /tmp/gnunet-p2-service-statistics.sock | ||
80 | |||
81 | [dv] | ||
82 | DEBUG = NO | ||
83 | ACCEPT_FROM6 = ::1; | ||
84 | ACCEPT_FROM = 127.0.0.1; | ||
85 | #BINARY = gnunet-service-dv | ||
86 | BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/dv/.libs/gnunet-service-dv | ||
87 | #PREFIX = xterm -T dvservice2 -e gdb --args | ||
88 | #PREFIX = valgrind --log-file=dv2-%p --leak-check=full | ||
89 | CONFIG = $DEFAULTCONFIG | ||
90 | HOME = $SERVICEHOME | ||
91 | HOSTNAME = localhost | ||
92 | PORT = 22370 | ||
93 | |||
94 | [arm] | ||
95 | DEFAULTSERVICES = | ||
96 | ACCEPT_FROM6 = ::1; | ||
97 | ACCEPT_FROM = 127.0.0.1; | ||
98 | BINARY = gnunet-service-arm | ||
99 | CONFIG = $DEFAULTCONFIG | ||
100 | HOME = $SERVICEHOME | ||
101 | HOSTNAME = localhost | ||
102 | PORT = 22366 | ||
103 | UNIXPATH = /tmp/gnunet-p2-service-arm.sock | ||
104 | |||
105 | [transport-tcp] | ||
106 | TIMEOUT = 300000 | ||
107 | PORT = 22368 | ||
108 | |||
109 | [TESTING] | ||
110 | WEAKRANDOM = YES | ||
111 | |||
112 | [gnunetd] | ||
113 | HOSTKEY = $SERVICEHOME/.hostkey | ||
114 | |||
115 | [PATHS] | ||
116 | DEFAULTCONFIG = test_transport_api_dv_peer2.conf | ||
117 | SERVICEHOME = /tmp/test-gnunetd-transport-peer-2/ | ||
118 | |||
diff --git a/src/dv/test_transport_api_dv_peer3.conf b/src/dv/test_transport_api_dv_peer3.conf deleted file mode 100644 index be9d7fd2d..000000000 --- a/src/dv/test_transport_api_dv_peer3.conf +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | [hostlist] | ||
2 | HTTP-PROXY = | ||
3 | SERVERS = http://gnunet.org:8080/ | ||
4 | OPTIONS = -b | ||
5 | BINARY = gnunet-daemon-hostlist | ||
6 | CONFIG = $DEFAULTCONFIG | ||
7 | HOME = $SERVICEHOME | ||
8 | HOSTNAME = localhost | ||
9 | HTTPPORT = 8080 | ||
10 | |||
11 | [topology] | ||
12 | BINARY = gnunet-daemon-topology | ||
13 | CONFIG = $DEFAULTCONFIG | ||
14 | FRIENDS = $SERVICEHOME/friends | ||
15 | TARGET-CONNECTION-COUNT = 16 | ||
16 | AUTOCONNECT = YES | ||
17 | FRIENDS-ONLY = NO | ||
18 | MINIMUM-FRIENDS = 0 | ||
19 | |||
20 | [transport] | ||
21 | PLUGINS = tcp dv | ||
22 | DEBUG = NO | ||
23 | ACCEPT_FROM6 = ::1; | ||
24 | ACCEPT_FROM = 127.0.0.1; | ||
25 | NEIGHBOUR_LIMIT = 50 | ||
26 | #BINARY = /root/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport | ||
27 | BINARY = gnunet-service-transport | ||
28 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport | ||
29 | CONFIG = $DEFAULTCONFIG | ||
30 | HOME = $SERVICEHOME | ||
31 | HOSTNAME = localhost | ||
32 | PORT = 32365 | ||
33 | #PREFIX = xterm -T transport1 -e gdb --args | ||
34 | #PREFIX = valgrind --leak-check=full | ||
35 | BLACKLIST_FILE = $SERVICEHOME/blacklist | ||
36 | UNIXPATH = /tmp/gnunet-p3-service-transport.sock | ||
37 | |||
38 | [peerinfo] | ||
39 | TRUST = $SERVICEHOME/data/credit/ | ||
40 | HOSTS = $SERVICEHOME/data/hosts/ | ||
41 | ACCEPT_FROM6 = ::1; | ||
42 | ACCEPT_FROM = 127.0.0.1; | ||
43 | BINARY = gnunet-service-peerinfo | ||
44 | CONFIG = $DEFAULTCONFIG | ||
45 | HOME = $SERVICEHOME | ||
46 | HOSTNAME = localhost | ||
47 | PORT = 32369 | ||
48 | |||
49 | [resolver] | ||
50 | ACCEPT_FROM6 = ::1; | ||
51 | ACCEPT_FROM = 127.0.0.1; | ||
52 | BINARY = gnunet-service-resolver | ||
53 | CONFIG = $DEFAULTCONFIG | ||
54 | HOME = $SERVICEHOME | ||
55 | HOSTNAME = localhost | ||
56 | PORT = 32364 | ||
57 | UNIXPATH = /tmp/gnunet-p3-service-resolver.sock | ||
58 | |||
59 | [core] | ||
60 | TOTAL_QUOTA_OUT = 3932160 | ||
61 | TOTAL_QUOTA_IN = 3932160 | ||
62 | ACCEPT_FROM6 = ::1; | ||
63 | ACCEPT_FROM = 127.0.0.1; | ||
64 | BINARY = gnunet-service-core | ||
65 | CONFIG = $DEFAULTCONFIG | ||
66 | HOME = $SERVICEHOME | ||
67 | HOSTNAME = localhost | ||
68 | PORT = 32092 | ||
69 | UNIXPATH = /tmp/gnunet-p3-service-core.sock | ||
70 | |||
71 | [statistics] | ||
72 | ACCEPT_FROM6 = ::1; | ||
73 | ACCEPT_FROM = 127.0.0.1; | ||
74 | BINARY = gnunet-service-statistics | ||
75 | CONFIG = $DEFAULTCONFIG | ||
76 | HOME = $SERVICEHOME | ||
77 | HOSTNAME = localhost | ||
78 | PORT = 32367 | ||
79 | UNIXPATH = /tmp/gnunet-p3-service-statistics.sock | ||
80 | |||
81 | [dv] | ||
82 | DEBUG = YES | ||
83 | ACCEPT_FROM6 = ::1; | ||
84 | ACCEPT_FROM = 127.0.0.1; | ||
85 | BINARY = gnunet-service-dv | ||
86 | BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/dv/.libs/gnunet-service-dv | ||
87 | #PREFIX = xterm -T dvservice3 -e gdb --args | ||
88 | #PREFIX = valgrind --log-file=dv3-%p --leak-check=full --show-reachable=yes | ||
89 | CONFIG = $DEFAULTCONFIG | ||
90 | HOME = $SERVICEHOME | ||
91 | HOSTNAME = localhost | ||
92 | PORT = 32370 | ||
93 | |||
94 | [arm] | ||
95 | DEFAULTSERVICES = | ||
96 | ACCEPT_FROM6 = ::1; | ||
97 | ACCEPT_FROM = 127.0.0.1; | ||
98 | BINARY = gnunet-service-arm | ||
99 | CONFIG = $DEFAULTCONFIG | ||
100 | HOME = $SERVICEHOME | ||
101 | HOSTNAME = localhost | ||
102 | PORT = 32366 | ||
103 | UNIXPATH = /tmp/gnunet-p3-service-arm.sock | ||
104 | |||
105 | [transport-tcp] | ||
106 | TIMEOUT = 300000 | ||
107 | PORT = 32368 | ||
108 | |||
109 | [TESTING] | ||
110 | WEAKRANDOM = YES | ||
111 | |||
112 | [gnunetd] | ||
113 | HOSTKEY = $SERVICEHOME/.hostkey | ||
114 | |||
115 | [PATHS] | ||
116 | DEFAULTCONFIG = test_transport_api_dv_peer3.conf | ||
117 | SERVICEHOME = /tmp/test-gnunetd-transport-peer-3/ | ||
118 | |||
diff --git a/src/dv/test_transport_api_dv_peer4.conf b/src/dv/test_transport_api_dv_peer4.conf deleted file mode 100644 index c051de030..000000000 --- a/src/dv/test_transport_api_dv_peer4.conf +++ /dev/null | |||
@@ -1,117 +0,0 @@ | |||
1 | [topology] | ||
2 | BINARY = gnunet-daemon-topology | ||
3 | CONFIG = $DEFAULTCONFIG | ||
4 | FRIENDS = $SERVICEHOME/friends | ||
5 | TARGET-CONNECTION-COUNT = 16 | ||
6 | AUTOCONNECT = YES | ||
7 | FRIENDS-ONLY = NO | ||
8 | MINIMUM-FRIENDS = 0 | ||
9 | |||
10 | [transport] | ||
11 | PLUGINS = tcp dv | ||
12 | DEBUG = NO | ||
13 | ALLOW_SHUTDOWN = YES | ||
14 | ACCEPT_FROM6 = ::1; | ||
15 | ACCEPT_FROM = 127.0.0.1; | ||
16 | NEIGHBOUR_LIMIT = 50 | ||
17 | #BINARY = /root/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport | ||
18 | BINARY = gnunet-service-transport | ||
19 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport | ||
20 | CONFIG = $DEFAULTCONFIG | ||
21 | HOME = $SERVICEHOME | ||
22 | HOSTNAME = localhost | ||
23 | PORT = 42365 | ||
24 | #PREFIX = xterm -T transport1 -e gdb --args | ||
25 | #PREFIX = valgrind --leak-check=full | ||
26 | BLACKLIST_FILE = $SERVICEHOME/blacklist | ||
27 | UNIXPATH = /tmp/gnunet-p4-service-transport.sock | ||
28 | |||
29 | [peerinfo] | ||
30 | TRUST = $SERVICEHOME/data/credit/ | ||
31 | HOSTS = $SERVICEHOME/data/hosts/ | ||
32 | ALLOW_SHUTDOWN = YES | ||
33 | ACCEPT_FROM6 = ::1; | ||
34 | ACCEPT_FROM = 127.0.0.1; | ||
35 | BINARY = gnunet-service-peerinfo | ||
36 | CONFIG = $DEFAULTCONFIG | ||
37 | HOME = $SERVICEHOME | ||
38 | HOSTNAME = localhost | ||
39 | PORT = 42369 | ||
40 | UNIXPATH = /tmp/gnunet-p4-service-peerinfo.sock | ||
41 | |||
42 | [resolver] | ||
43 | ALLOW_SHUTDOWN = YES | ||
44 | ACCEPT_FROM6 = ::1; | ||
45 | ACCEPT_FROM = 127.0.0.1; | ||
46 | BINARY = gnunet-service-resolver | ||
47 | CONFIG = $DEFAULTCONFIG | ||
48 | HOME = $SERVICEHOME | ||
49 | HOSTNAME = localhost | ||
50 | PORT = 42364 | ||
51 | UNIXPATH = /tmp/gnunet-p4-service-resolver.sock | ||
52 | |||
53 | [core] | ||
54 | TOTAL_QUOTA_OUT = 3932160 | ||
55 | TOTAL_QUOTA_IN = 3932160 | ||
56 | ALLOW_SHUTDOWN = YES | ||
57 | ACCEPT_FROM6 = ::1; | ||
58 | ACCEPT_FROM = 127.0.0.1; | ||
59 | BINARY = gnunet-service-core | ||
60 | CONFIG = $DEFAULTCONFIG | ||
61 | HOME = $SERVICEHOME | ||
62 | HOSTNAME = localhost | ||
63 | PORT = 42092 | ||
64 | UNIXPATH = /tmp/gnunet-p4-service-core.sock | ||
65 | |||
66 | [statistics] | ||
67 | ALLOW_SHUTDOWN = YES | ||
68 | ACCEPT_FROM6 = ::1; | ||
69 | ACCEPT_FROM = 127.0.0.1; | ||
70 | BINARY = gnunet-service-statistics | ||
71 | CONFIG = $DEFAULTCONFIG | ||
72 | HOME = $SERVICEHOME | ||
73 | HOSTNAME = localhost | ||
74 | PORT = 42367 | ||
75 | UNIXPATH = /tmp/gnunet-p4-service-statistics.sock | ||
76 | |||
77 | [dv] | ||
78 | DEBUG = NO | ||
79 | ALLOW_SHUTDOWN = YES | ||
80 | ACCEPT_FROM6 = ::1; | ||
81 | ACCEPT_FROM = 127.0.0.1; | ||
82 | BINARY = gnunet-service-dv | ||
83 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/dv/.libs/gnunet-service-dv | ||
84 | #PREFIX = xterm -T dvservice4 -e gdb --args | ||
85 | #PREFIX = valgrind --log-file=dv4-%p --leak-check=full --show-reachable=yes | ||
86 | CONFIG = $DEFAULTCONFIG | ||
87 | HOME = $SERVICEHOME | ||
88 | HOSTNAME = localhost | ||
89 | PORT = 42370 | ||
90 | |||
91 | [arm] | ||
92 | DEFAULTSERVICES = | ||
93 | ALLOW_SHUTDOWN = YES | ||
94 | ACCEPT_FROM6 = ::1; | ||
95 | ACCEPT_FROM = 127.0.0.1; | ||
96 | BINARY = gnunet-service-arm | ||
97 | CONFIG = $DEFAULTCONFIG | ||
98 | HOME = $SERVICEHOME | ||
99 | HOSTNAME = localhost | ||
100 | PORT = 42366 | ||
101 | UNIXPATH = /tmp/gnunet-p4-service-arm.sock | ||
102 | |||
103 | [transport-tcp] | ||
104 | ALLOW_SHUTDOWN = NO | ||
105 | TIMEOUT = 300000 | ||
106 | PORT = 42368 | ||
107 | |||
108 | [TESTING] | ||
109 | WEAKRANDOM = YES | ||
110 | |||
111 | [gnunetd] | ||
112 | HOSTKEY = $SERVICEHOME/.hostkey | ||
113 | |||
114 | [PATHS] | ||
115 | DEFAULTCONFIG = test_transport_api_dv_peer4.conf | ||
116 | SERVICEHOME = /tmp/test-gnunetd-transport-peer-4/ | ||
117 | |||
diff --git a/src/dv/test_dv_topology.conf b/src/dv/test_transport_dv_data.conf index 4eeee8fe2..848f9170a 100644 --- a/src/dv/test_dv_topology.conf +++ b/src/dv/test_transport_dv_data.conf | |||
@@ -1,21 +1,15 @@ | |||
1 | [PATHS] | 1 | [PATHS] |
2 | SERVICEHOME = /tmp/test-gnunet-dv/ | 2 | SERVICEHOME = /tmp/test-gnunet-dv-testing/ |
3 | DEFAULTCONFIG = test_dv_topology.conf | 3 | DEFAULTCONFIG = test_transport_dv_data.conf |
4 | 4 | ||
5 | [resolver] | 5 | [resolver] |
6 | PORT = 2564 | 6 | PORT = 2564 |
7 | 7 | ||
8 | [topology] | ||
9 | BINARY = gnunet-daemon-topology | ||
10 | CONFIG = $DEFAULTCONFIG | ||
11 | FRIENDS = $SERVICEHOME/friends | ||
12 | AUTOCONNECT = YES | ||
13 | FRIENDS-ONLY = YES | ||
14 | |||
15 | |||
16 | [transport] | 8 | [transport] |
9 | DEBUG = NO | ||
17 | PORT = 2565 | 10 | PORT = 2565 |
18 | PLUGINS = tcp dv | 11 | PLUGINS = tcp dv |
12 | BLACKLIST_FILE = $SERVICEHOME/blacklist | ||
19 | #PREFIX = xterm -e xterm -T transport -e gdb --args | 13 | #PREFIX = xterm -e xterm -T transport -e gdb --args |
20 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport | 14 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport |
21 | #PREFIX = valgrind --tool=memcheck --log-file=logs%p | 15 | #PREFIX = valgrind --tool=memcheck --log-file=logs%p |
@@ -23,7 +17,7 @@ PLUGINS = tcp dv | |||
23 | 17 | ||
24 | [arm] | 18 | [arm] |
25 | PORT = 2566 | 19 | PORT = 2566 |
26 | DEFAULTSERVICES = topology core dv statistics | 20 | DEFAULTSERVICES = |
27 | 21 | ||
28 | [statistics] | 22 | [statistics] |
29 | PORT = 2567 | 23 | PORT = 2567 |
@@ -48,21 +42,31 @@ PORT = 2570 | |||
48 | #DEBUG = YES | 42 | #DEBUG = YES |
49 | 43 | ||
50 | [dv] | 44 | [dv] |
45 | AUTOSTART = YES | ||
51 | DEBUG = NO | 46 | DEBUG = NO |
52 | ALLOW_SHUTDOWN = YES | ||
53 | ACCEPT_FROM6 = ::1; | 47 | ACCEPT_FROM6 = ::1; |
54 | ACCEPT_FROM = 127.0.0.1; | 48 | ACCEPT_FROM = 127.0.0.1; |
55 | BINARY = gnunet-service-dv | 49 | BINARY = gnunet-service-dv |
50 | #BINARY = /root/documents/research/gnunet/gnunet-ng/src/dv/.libs/gnunet-service-dv | ||
56 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/dv/.libs/gnunet-service-dv | 51 | #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/dv/.libs/gnunet-service-dv |
57 | #PREFIX = xterm -T dvservice -e gdb --args | 52 | #PREFIX = xterm -T dvservice -e gdb --args |
58 | #PREFIX = valgrind --log-file=dv1-%p --leak-check=full | 53 | #PREFIX = valgrind --log-file=dv-%p --leak-check=full |
59 | CONFIG = $DEFAULTCONFIG | 54 | CONFIG = $DEFAULTCONFIG |
60 | HOME = $SERVICEHOME | 55 | HOME = $SERVICEHOME |
61 | HOSTNAME = localhost | 56 | HOSTNAME = localhost |
62 | PORT = 2571 | 57 | PORT = 2571 |
63 | 58 | ||
64 | [testing] | 59 | [testing] |
65 | NUM_PEERS = 6 | 60 | NUM_PEERS = 5 |
61 | DEBUG = YES | ||
66 | WEAKRANDOM = YES | 62 | WEAKRANDOM = YES |
67 | TOPOLOGY = 3 | 63 | TOPOLOGY = CLIQUE |
64 | CONNECT_TOPOLOGY = RING | ||
65 | BLACKLIST_TOPOLOGY = RING | ||
66 | BLACKLIST_TRANSPORTS = tcp | ||
68 | F2F = YES | 67 | F2F = YES |
68 | |||
69 | [fs] | ||
70 | AUTOSTART = NO | ||
71 | |||
72 | |||