diff options
-rw-r--r-- | src/transport/test_quota_compliance.c | 504 | ||||
-rw-r--r-- | src/transport/test_quota_compliance_data.conf | 29 | ||||
-rw-r--r-- | src/transport/test_quota_compliance_peer1.conf | 109 | ||||
-rw-r--r-- | src/transport/test_quota_compliance_peer2.conf | 107 |
4 files changed, 749 insertions, 0 deletions
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c new file mode 100644 index 000000000..ed4a75ae5 --- /dev/null +++ b/src/transport/test_quota_compliance.c | |||
@@ -0,0 +1,504 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2009, 2010 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 3, 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 transport/test_quota_compliance.c | ||
22 | * @brief base test case for transport implementations | ||
23 | * | ||
24 | * This test case tests quota compliance both on core and transport level | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_common.h" | ||
28 | #include "gnunet_hello_lib.h" | ||
29 | #include "gnunet_getopt_lib.h" | ||
30 | #include "gnunet_os_lib.h" | ||
31 | #include "gnunet_program_lib.h" | ||
32 | #include "gnunet_scheduler_lib.h" | ||
33 | #include "gnunet_server_lib.h" | ||
34 | #include "gnunet_transport_service.h" | ||
35 | #include "transport.h" | ||
36 | |||
37 | #define VERBOSE GNUNET_YES | ||
38 | |||
39 | #define VERBOSE_ARM GNUNET_NO | ||
40 | |||
41 | #define START_ARM GNUNET_YES | ||
42 | |||
43 | /** | ||
44 | * Note that this value must not significantly exceed | ||
45 | * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise | ||
46 | * messages may be dropped even for a reliable transport. | ||
47 | */ | ||
48 | #define TOTAL_MSGS (10000 * 2) | ||
49 | |||
50 | /** | ||
51 | * How long until we give up on transmitting the message? | ||
52 | */ | ||
53 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) | ||
54 | |||
55 | #define MTYPE 12345 | ||
56 | |||
57 | struct PeerContext | ||
58 | { | ||
59 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
60 | struct GNUNET_TRANSPORT_Handle *th; | ||
61 | struct GNUNET_PeerIdentity id; | ||
62 | #if START_ARM | ||
63 | pid_t arm_pid; | ||
64 | #endif | ||
65 | }; | ||
66 | |||
67 | static struct PeerContext p1; | ||
68 | |||
69 | static struct PeerContext p2; | ||
70 | |||
71 | static struct GNUNET_SCHEDULER_Handle *sched; | ||
72 | |||
73 | static int ok; | ||
74 | |||
75 | static int connected; | ||
76 | |||
77 | static unsigned long long total_bytes; | ||
78 | |||
79 | static struct GNUNET_TIME_Absolute start_time; | ||
80 | |||
81 | static GNUNET_SCHEDULER_TaskIdentifier die_task; | ||
82 | |||
83 | static int msg_scheduled; | ||
84 | static int msg_sent; | ||
85 | static int msg_recv_expected; | ||
86 | static int msg_recv; | ||
87 | |||
88 | |||
89 | #if VERBOSE | ||
90 | #define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) | ||
91 | #else | ||
92 | #define OKPP do { ok++; } while (0) | ||
93 | #endif | ||
94 | |||
95 | |||
96 | static void | ||
97 | end () | ||
98 | { | ||
99 | unsigned long long delta; | ||
100 | |||
101 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
102 | die_task = GNUNET_SCHEDULER_NO_TASK; | ||
103 | #if VERBOSE | ||
104 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n"); | ||
105 | #endif | ||
106 | GNUNET_TRANSPORT_disconnect (p1.th); | ||
107 | GNUNET_TRANSPORT_disconnect (p2.th); | ||
108 | #if VERBOSE | ||
109 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
110 | "Transports disconnected, returning success!\n"); | ||
111 | #endif | ||
112 | delta = GNUNET_TIME_absolute_get_duration (start_time).value; | ||
113 | fprintf (stderr, | ||
114 | "\nThroughput was %llu kb/s\n", | ||
115 | total_bytes * 1000 / 1024 / delta); | ||
116 | ok = 0; | ||
117 | |||
118 | } | ||
119 | |||
120 | |||
121 | |||
122 | static void | ||
123 | stop_arm (struct PeerContext *p) | ||
124 | { | ||
125 | #if START_ARM | ||
126 | if (0 != PLIBC_KILL (p->arm_pid, SIGTERM)) | ||
127 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | ||
128 | GNUNET_OS_process_wait (p->arm_pid); | ||
129 | #endif | ||
130 | GNUNET_CONFIGURATION_destroy (p->cfg); | ||
131 | } | ||
132 | |||
133 | |||
134 | static void | ||
135 | end_badly (void *cls, | ||
136 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
137 | { | ||
138 | |||
139 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
140 | "end_badly \n "); | ||
141 | GNUNET_break (0); | ||
142 | if (p1.th != NULL) | ||
143 | GNUNET_TRANSPORT_disconnect (p1.th); | ||
144 | if (p2.th != NULL) | ||
145 | GNUNET_TRANSPORT_disconnect (p2.th); | ||
146 | ok = 1; | ||
147 | } | ||
148 | |||
149 | |||
150 | struct TestMessage | ||
151 | { | ||
152 | struct GNUNET_MessageHeader header; | ||
153 | uint32_t num; | ||
154 | }; | ||
155 | |||
156 | |||
157 | static unsigned int | ||
158 | get_size (unsigned int iter) | ||
159 | { | ||
160 | unsigned int ret; | ||
161 | |||
162 | if (iter < 60000) | ||
163 | return iter + sizeof (struct TestMessage); | ||
164 | ret = (iter * iter * iter); | ||
165 | return sizeof (struct TestMessage) + (ret % 60000); | ||
166 | } | ||
167 | |||
168 | |||
169 | static void | ||
170 | notify_receive (void *cls, | ||
171 | const struct GNUNET_PeerIdentity *peer, | ||
172 | const struct GNUNET_MessageHeader *message, | ||
173 | struct GNUNET_TIME_Relative latency, | ||
174 | uint32_t distance) | ||
175 | { | ||
176 | static int n; | ||
177 | unsigned int s; | ||
178 | char cbuf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1]; | ||
179 | const struct TestMessage *hdr; | ||
180 | |||
181 | hdr = (const struct TestMessage*) message; | ||
182 | s = get_size (n); | ||
183 | if (MTYPE != ntohs (message->type)) | ||
184 | return; | ||
185 | msg_recv_expected = n; | ||
186 | msg_recv = ntohl(hdr->num); | ||
187 | if (ntohs (message->size) != s) | ||
188 | { | ||
189 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
190 | "Expected message %u of size %u, got %u bytes of message %u\n", | ||
191 | n, s, | ||
192 | ntohs (message->size), | ||
193 | ntohl (hdr->num)); | ||
194 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
195 | die_task = GNUNET_SCHEDULER_add_now (sched, &end_badly, NULL); | ||
196 | return; | ||
197 | } | ||
198 | if (ntohl (hdr->num) != n) | ||
199 | { | ||
200 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
201 | "Expected message %u of size %u, got %u bytes of message %u\n", | ||
202 | n, s, | ||
203 | ntohs (message->size), | ||
204 | ntohl (hdr->num)); | ||
205 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
206 | die_task = GNUNET_SCHEDULER_add_now (sched, &end_badly, NULL); | ||
207 | return; | ||
208 | } | ||
209 | memset (cbuf, n, s - sizeof (struct TestMessage)); | ||
210 | if (0 != memcmp (cbuf, | ||
211 | &hdr[1], | ||
212 | s - sizeof (struct TestMessage))) | ||
213 | { | ||
214 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
215 | "Expected message %u with bits %u, but body did not match\n", | ||
216 | n, (unsigned char) n); | ||
217 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
218 | die_task = GNUNET_SCHEDULER_add_now (sched, &end_badly, NULL); | ||
219 | return; | ||
220 | } | ||
221 | #if VERBOSE | ||
222 | if (ntohl(hdr->num) % 5000 == 0) | ||
223 | { | ||
224 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
225 | "Got message %u of size %u\n", | ||
226 | ntohl (hdr->num), | ||
227 | ntohs (message->size)); | ||
228 | } | ||
229 | #endif | ||
230 | n++; | ||
231 | if (0 == (n % (TOTAL_MSGS/100))) | ||
232 | { | ||
233 | fprintf (stderr, "."); | ||
234 | GNUNET_SCHEDULER_cancel (sched, die_task); | ||
235 | die_task = GNUNET_SCHEDULER_add_delayed (sched, | ||
236 | TIMEOUT, | ||
237 | &end_badly, | ||
238 | NULL); | ||
239 | } | ||
240 | if (n == TOTAL_MSGS) | ||
241 | end (); | ||
242 | } | ||
243 | |||
244 | |||
245 | static size_t | ||
246 | notify_ready (void *cls, size_t size, void *buf) | ||
247 | { | ||
248 | static int n; | ||
249 | char *cbuf = buf; | ||
250 | struct TestMessage hdr; | ||
251 | unsigned int s; | ||
252 | unsigned int ret; | ||
253 | |||
254 | if (buf == NULL) | ||
255 | { | ||
256 | GNUNET_break (0); | ||
257 | ok = 42; | ||
258 | return 0; | ||
259 | } | ||
260 | ret = 0; | ||
261 | s = get_size (n); | ||
262 | GNUNET_assert (size >= s); | ||
263 | GNUNET_assert (buf != NULL); | ||
264 | cbuf = buf; | ||
265 | do | ||
266 | { | ||
267 | hdr.header.size = htons (s); | ||
268 | hdr.header.type = htons (MTYPE); | ||
269 | hdr.num = htonl (n); | ||
270 | msg_sent = n; | ||
271 | memcpy (&cbuf[ret], &hdr, sizeof (struct TestMessage)); | ||
272 | ret += sizeof (struct TestMessage); | ||
273 | memset (&cbuf[ret], n, s - sizeof (struct TestMessage)); | ||
274 | ret += s - sizeof (struct TestMessage); | ||
275 | #if VERBOSE | ||
276 | if (n % 5000 == 0) | ||
277 | { | ||
278 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
279 | "Sending message %u of size %u\n", | ||
280 | n, | ||
281 | s); | ||
282 | } | ||
283 | #endif | ||
284 | n++; | ||
285 | s = get_size (n); | ||
286 | if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16)) | ||
287 | break; /* sometimes pack buffer full, sometimes not */ | ||
288 | } | ||
289 | while (size - ret >= s); | ||
290 | if (n < TOTAL_MSGS) | ||
291 | { | ||
292 | GNUNET_TRANSPORT_notify_transmit_ready (p2.th, | ||
293 | &p1.id, | ||
294 | s, 0, TIMEOUT, | ||
295 | ¬ify_ready, | ||
296 | NULL); | ||
297 | msg_scheduled = n; | ||
298 | } | ||
299 | if (n % 5000 == 0) | ||
300 | { | ||
301 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
302 | "Returning total message block of size %u\n", | ||
303 | ret); | ||
304 | } | ||
305 | total_bytes += ret; | ||
306 | return ret; | ||
307 | } | ||
308 | |||
309 | |||
310 | static void | ||
311 | notify_connect (void *cls, | ||
312 | const struct GNUNET_PeerIdentity *peer, | ||
313 | struct GNUNET_TIME_Relative latency, | ||
314 | uint32_t distance) | ||
315 | { | ||
316 | #if VERBOSE | ||
317 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
318 | "Peer `%4s' connected to us (%p)!\n", GNUNET_i2s (peer), cls); | ||
319 | #endif | ||
320 | |||
321 | if (cls == &p1) | ||
322 | { | ||
323 | GNUNET_TRANSPORT_set_quota (p1.th, | ||
324 | &p2.id, | ||
325 | GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024), | ||
326 | GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024), | ||
327 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
328 | NULL, NULL); | ||
329 | start_time = GNUNET_TIME_absolute_get (); | ||
330 | connected++; | ||
331 | } | ||
332 | else | ||
333 | { | ||
334 | GNUNET_TRANSPORT_set_quota (p2.th, | ||
335 | &p1.id, | ||
336 | GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024), | ||
337 | GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024), | ||
338 | GNUNET_TIME_UNIT_FOREVER_REL, | ||
339 | NULL, NULL); | ||
340 | connected++; | ||
341 | } | ||
342 | |||
343 | if (connected == 2) | ||
344 | { | ||
345 | GNUNET_TRANSPORT_notify_transmit_ready (p2.th, | ||
346 | &p1.id, | ||
347 | get_size (0), 0, TIMEOUT, | ||
348 | ¬ify_ready, | ||
349 | NULL); | ||
350 | } | ||
351 | |||
352 | } | ||
353 | |||
354 | |||
355 | static void | ||
356 | notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | ||
357 | { | ||
358 | #if VERBOSE | ||
359 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
360 | "Peer `%4s' disconnected (%p)!\n", | ||
361 | GNUNET_i2s (peer), cls); | ||
362 | #endif | ||
363 | } | ||
364 | |||
365 | |||
366 | static void | ||
367 | setup_peer (struct PeerContext *p, const char *cfgname) | ||
368 | { | ||
369 | p->cfg = GNUNET_CONFIGURATION_create (); | ||
370 | #if START_ARM | ||
371 | p->arm_pid = GNUNET_OS_start_process (NULL, NULL, | ||
372 | "gnunet-service-arm", | ||
373 | "gnunet-service-arm", | ||
374 | #if VERBOSE_ARM | ||
375 | "-L", "DEBUG", | ||
376 | #endif | ||
377 | "-c", cfgname, NULL); | ||
378 | #endif | ||
379 | |||
380 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | ||
381 | p->th = GNUNET_TRANSPORT_connect (sched, p->cfg, NULL, | ||
382 | p, | ||
383 | ¬ify_receive, | ||
384 | ¬ify_connect, | ||
385 | ¬ify_disconnect); | ||
386 | GNUNET_assert (p->th != NULL); | ||
387 | } | ||
388 | |||
389 | |||
390 | static void | ||
391 | exchange_hello_last (void *cls, | ||
392 | const struct GNUNET_MessageHeader *message) | ||
393 | { | ||
394 | struct PeerContext *me = cls; | ||
395 | |||
396 | GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, me); | ||
397 | #if VERBOSE | ||
398 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
399 | "Exchanging HELLO with peer (%p)!\n", cls); | ||
400 | #endif | ||
401 | GNUNET_assert (ok >= 3); | ||
402 | OKPP; | ||
403 | GNUNET_assert (message != NULL); | ||
404 | GNUNET_assert (GNUNET_OK == | ||
405 | GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) | ||
406 | message, &me->id)); | ||
407 | /* both HELLOs exchanged, get ready to test transmission! */ | ||
408 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
409 | "Finished exchanging HELLOs, now waiting for transmission!\n"); | ||
410 | } | ||
411 | |||
412 | |||
413 | static void | ||
414 | exchange_hello (void *cls, | ||
415 | const struct GNUNET_MessageHeader *message) | ||
416 | { | ||
417 | struct PeerContext *me = cls; | ||
418 | |||
419 | GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, me); | ||
420 | #if VERBOSE | ||
421 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
422 | "Exchanging HELLO with peer (%p)!\n", cls); | ||
423 | #endif | ||
424 | GNUNET_assert (ok >= 2); | ||
425 | OKPP; | ||
426 | GNUNET_assert (message != NULL); | ||
427 | GNUNET_assert (GNUNET_OK == | ||
428 | GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) | ||
429 | message, &me->id)); | ||
430 | |||
431 | #if VERBOSE | ||
432 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
433 | "Received HELLO size %d\n", | ||
434 | GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message)); | ||
435 | #endif | ||
436 | GNUNET_TRANSPORT_offer_hello (p2.th, message); | ||
437 | GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2); | ||
438 | } | ||
439 | |||
440 | static void | ||
441 | run (void *cls, | ||
442 | struct GNUNET_SCHEDULER_Handle *s, | ||
443 | char *const *args, | ||
444 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
445 | { | ||
446 | GNUNET_assert (ok == 1); | ||
447 | OKPP; | ||
448 | sched = s; | ||
449 | |||
450 | die_task = GNUNET_SCHEDULER_add_delayed (sched, | ||
451 | TIMEOUT, | ||
452 | &end_badly, | ||
453 | NULL); | ||
454 | |||
455 | |||
456 | setup_peer (&p1, "test_quota_compliance_peer1.conf"); | ||
457 | setup_peer (&p2, "test_quota_compliance_peer2.conf"); | ||
458 | |||
459 | GNUNET_assert(p1.th != NULL); | ||
460 | GNUNET_assert(p2.th != NULL); | ||
461 | GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1); | ||
462 | } | ||
463 | |||
464 | int | ||
465 | main (int argc, char *argv[]) | ||
466 | { | ||
467 | int ret = 0; | ||
468 | #ifdef MINGW | ||
469 | return GNUNET_SYSERR; | ||
470 | #endif | ||
471 | GNUNET_log_setup ("test-quota-compliance", | ||
472 | #if VERBOSE | ||
473 | "DEBUG", | ||
474 | #else | ||
475 | "WARNING", | ||
476 | #endif | ||
477 | NULL); | ||
478 | char *const argv1[] = { "test-quota-compliance", | ||
479 | "-c", | ||
480 | "test_quota_compliance_data.conf", | ||
481 | #if VERBOSE | ||
482 | "-L", "DEBUG", | ||
483 | #endif | ||
484 | NULL | ||
485 | }; | ||
486 | struct GNUNET_GETOPT_CommandLineOption options[] = { | ||
487 | GNUNET_GETOPT_OPTION_END | ||
488 | }; | ||
489 | |||
490 | ok = 1; | ||
491 | GNUNET_PROGRAM_run ((sizeof (argv1) / sizeof (char *)) - 1, | ||
492 | argv1, "test-quota-compliance", "nohelp", | ||
493 | options, &run, &ok); | ||
494 | ret = ok; | ||
495 | |||
496 | stop_arm (&p1); | ||
497 | stop_arm (&p2); | ||
498 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Removin DIRS\n"); | ||
499 | GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer1"); | ||
500 | GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer2"); | ||
501 | return ret; | ||
502 | } | ||
503 | |||
504 | /* end of test_quota_compliance.c */ | ||
diff --git a/src/transport/test_quota_compliance_data.conf b/src/transport/test_quota_compliance_data.conf new file mode 100644 index 000000000..88f590e56 --- /dev/null +++ b/src/transport/test_quota_compliance_data.conf | |||
@@ -0,0 +1,29 @@ | |||
1 | [PATHS] | ||
2 | SERVICEHOME = /tmp/test-gnunetd-plugin-transport/ | ||
3 | |||
4 | [resolver] | ||
5 | PORT = 2364 | ||
6 | |||
7 | [transport] | ||
8 | PORT = 2365 | ||
9 | PLUGINS = tcp | ||
10 | |||
11 | [arm] | ||
12 | PORT = 2366 | ||
13 | |||
14 | [statistics] | ||
15 | PORT = 2367 | ||
16 | |||
17 | [transport-tcp] | ||
18 | PORT = 2368 | ||
19 | |||
20 | [peerinfo] | ||
21 | PORT = 2369 | ||
22 | |||
23 | [testing] | ||
24 | WEAKRANDOM = YES | ||
25 | |||
26 | [dht] | ||
27 | AUTOSTART = NO | ||
28 | |||
29 | |||
diff --git a/src/transport/test_quota_compliance_peer1.conf b/src/transport/test_quota_compliance_peer1.conf new file mode 100644 index 000000000..c5e725083 --- /dev/null +++ b/src/transport/test_quota_compliance_peer1.conf | |||
@@ -0,0 +1,109 @@ | |||
1 | [PATHS] | ||
2 | SERVICEHOME = /tmp/test_quota_compliance_peer1/ | ||
3 | DEFAULTCONFIG = test_quota_compliance_peer1.conf | ||
4 | |||
5 | |||
6 | |||
7 | [fs] | ||
8 | AUTOSTART = NO | ||
9 | |||
10 | [datastore] | ||
11 | AUTOSTART = NO | ||
12 | |||
13 | [hostlist] | ||
14 | HTTP-PROXY = | ||
15 | SERVERS = http://gnunet.org:8080/ | ||
16 | OPTIONS = -b | ||
17 | BINARY = gnunet-daemon-hostlist | ||
18 | CONFIG = $DEFAULTCONFIG | ||
19 | HOME = $SERVICEHOME | ||
20 | HOSTNAME = localhost | ||
21 | HTTPPORT = 8080 | ||
22 | |||
23 | [topology] | ||
24 | BINARY = gnunet-daemon-topology | ||
25 | CONFIG = $DEFAULTCONFIG | ||
26 | FRIENDS = $SERVICEHOME/friends | ||
27 | TARGET-CONNECTION-COUNT = 16 | ||
28 | AUTOCONNECT = YES | ||
29 | FRIENDS-ONLY = NO | ||
30 | MINIMUM-FRIENDS = 0 | ||
31 | |||
32 | [core] | ||
33 | AUTOSTART = NO | ||
34 | |||
35 | [transport-udp] | ||
36 | PORT = 4094 | ||
37 | |||
38 | [transport-tcp] | ||
39 | TIMEOUT = 300000 | ||
40 | PORT = 4094 | ||
41 | |||
42 | [transport] | ||
43 | plugins = tcp | ||
44 | DEBUG = YES | ||
45 | PREFIX = | ||
46 | ACCEPT_FROM6 = ::1; | ||
47 | ACCEPT_FROM = 127.0.0.1; | ||
48 | NEIGHBOUR_LIMIT = 50 | ||
49 | BINARY = gnunet-service-transport | ||
50 | CONFIG = $DEFAULTCONFIG | ||
51 | HOME = $SERVICEHOME | ||
52 | HOSTNAME = localhost | ||
53 | PORT = 4091 | ||
54 | UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_transport_peer1.sock | ||
55 | |||
56 | [peerinfo] | ||
57 | TRUST = $SERVICEHOME/data/credit/ | ||
58 | HOSTS = $SERVICEHOME/data/hosts/ | ||
59 | ACCEPT_FROM6 = ::1; | ||
60 | ACCEPT_FROM = 127.0.0.1; | ||
61 | BINARY = gnunet-service-peerinfo | ||
62 | CONFIG = $DEFAULTCONFIG | ||
63 | HOME = $SERVICEHOME | ||
64 | HOSTNAME = localhost | ||
65 | PORT = 4090 | ||
66 | UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_peerinfo_peer1.sock | ||
67 | |||
68 | [resolver] | ||
69 | ACCEPT_FROM6 = ::1; | ||
70 | ACCEPT_FROM = 127.0.0.1; | ||
71 | BINARY = gnunet-service-resolver | ||
72 | CONFIG = $DEFAULTCONFIG | ||
73 | HOME = $SERVICEHOME | ||
74 | HOSTNAME = localhost | ||
75 | PORT = 4089 | ||
76 | UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_resolver_peer1.sock | ||
77 | |||
78 | [statistics] | ||
79 | ACCEPT_FROM6 = ::1; | ||
80 | ACCEPT_FROM = 127.0.0.1; | ||
81 | BINARY = gnunet-service-statistics | ||
82 | CONFIG = $DEFAULTCONFIG | ||
83 | HOME = $SERVICEHOME | ||
84 | HOSTNAME = localhost | ||
85 | PORT = 4088 | ||
86 | UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_statistics_peer1.sock | ||
87 | |||
88 | [arm] | ||
89 | DEFAULTSERVICES = | ||
90 | ACCEPT_FROM6 = ::1; | ||
91 | ACCEPT_FROM = 127.0.0.1; | ||
92 | BINARY = gnunet-service-arm | ||
93 | CONFIG = $DEFAULTCONFIG | ||
94 | HOME = $SERVICEHOME | ||
95 | HOSTNAME = localhost | ||
96 | PORT = 4087 | ||
97 | UNIXPATH = /tmp/test_quota_compliance_peer1/test_quota_compliance_arm_peer1.sock | ||
98 | |||
99 | [TESTING] | ||
100 | WEAKRANDOM = YES | ||
101 | |||
102 | [gnunetd] | ||
103 | HOSTKEY = $SERVICEHOME/.hostkey | ||
104 | |||
105 | |||
106 | [dht] | ||
107 | AUTOSTART = NO | ||
108 | |||
109 | |||
diff --git a/src/transport/test_quota_compliance_peer2.conf b/src/transport/test_quota_compliance_peer2.conf new file mode 100644 index 000000000..8faf55f39 --- /dev/null +++ b/src/transport/test_quota_compliance_peer2.conf | |||
@@ -0,0 +1,107 @@ | |||
1 | [PATHS] | ||
2 | SERVICEHOME = /tmp/test_quota_compliance_peer2 | ||
3 | DEFAULTCONFIG = test_quota_compliance_peer2.conf | ||
4 | |||
5 | [transport-udp] | ||
6 | PORT = 3094 | ||
7 | |||
8 | [transport-tcp] | ||
9 | TIMEOUT = 300000 | ||
10 | PORT = 3094 | ||
11 | |||
12 | [fs] | ||
13 | AUTOSTART = NO | ||
14 | |||
15 | [datastore] | ||
16 | AUTOSTART = NO | ||
17 | |||
18 | [hostlist] | ||
19 | HTTP-PROXY = | ||
20 | SERVERS = http://gnunet.org:8080/ | ||
21 | OPTIONS = -b | ||
22 | BINARY = gnunet-daemon-hostlist | ||
23 | CONFIG = $DEFAULTCONFIG | ||
24 | HOME = $SERVICEHOME | ||
25 | HOSTNAME = localhost | ||
26 | HTTPPORT = 8080 | ||
27 | |||
28 | [topology] | ||
29 | BINARY = gnunet-daemon-topology | ||
30 | CONFIG = $DEFAULTCONFIG | ||
31 | FRIENDS = $SERVICEHOME/friends | ||
32 | TARGET-CONNECTION-COUNT = 16 | ||
33 | AUTOCONNECT = YES | ||
34 | FRIENDS-ONLY = NO | ||
35 | MINIMUM-FRIENDS = 0 | ||
36 | |||
37 | [core] | ||
38 | AUTOSTART = NO | ||
39 | |||
40 | [transport] | ||
41 | plugins = tcp | ||
42 | DEBUG = YES | ||
43 | PREFIX = | ||
44 | ACCEPT_FROM6 = ::1; | ||
45 | ACCEPT_FROM = 127.0.0.1; | ||
46 | NEIGHBOUR_LIMIT = 50 | ||
47 | BINARY = gnunet-service-transport | ||
48 | CONFIG = $DEFAULTCONFIG | ||
49 | HOME = $SERVICEHOME | ||
50 | HOSTNAME = localhost | ||
51 | PORT = 3091 | ||
52 | UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_transport_peer2.sock | ||
53 | |||
54 | [peerinfo] | ||
55 | TRUST = $SERVICEHOME/data/credit/ | ||
56 | HOSTS = $SERVICEHOME/data/hosts/ | ||
57 | ACCEPT_FROM6 = ::1; | ||
58 | ACCEPT_FROM = 127.0.0.1; | ||
59 | BINARY = gnunet-service-peerinfo | ||
60 | CONFIG = $DEFAULTCONFIG | ||
61 | HOME = $SERVICEHOME | ||
62 | HOSTNAME = localhost | ||
63 | PORT = 3090 | ||
64 | UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_peerinfo_peer2.sock | ||
65 | |||
66 | [resolver] | ||
67 | ACCEPT_FROM6 = ::1; | ||
68 | ACCEPT_FROM = 127.0.0.1; | ||
69 | BINARY = gnunet-service-resolver | ||
70 | CONFIG = $DEFAULTCONFIG | ||
71 | HOME = $SERVICEHOME | ||
72 | HOSTNAME = localhost | ||
73 | PORT = 3089 | ||
74 | UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_resolver_peer2.sock | ||
75 | |||
76 | [statistics] | ||
77 | ACCEPT_FROM6 = ::1; | ||
78 | ACCEPT_FROM = 127.0.0.1; | ||
79 | BINARY = gnunet-service-statistics | ||
80 | CONFIG = $DEFAULTCONFIG | ||
81 | HOME = $SERVICEHOME | ||
82 | HOSTNAME = localhost | ||
83 | PORT = 3088 | ||
84 | UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_statistics_peer2.sock | ||
85 | |||
86 | [arm] | ||
87 | DEFAULTSERVICES = | ||
88 | ACCEPT_FROM6 = ::1; | ||
89 | ACCEPT_FROM = 127.0.0.1; | ||
90 | BINARY = gnunet-service-arm | ||
91 | CONFIG = $DEFAULTCONFIG | ||
92 | HOME = $SERVICEHOME | ||
93 | HOSTNAME = localhost | ||
94 | PORT = 3087 | ||
95 | UNIXPATH = /tmp/test_quota_compliance_peer2/test_quota_compliance_arm_peer2.sock | ||
96 | |||
97 | [TESTING] | ||
98 | WEAKRANDOM = YES | ||
99 | |||
100 | [gnunetd] | ||
101 | HOSTKEY = $SERVICEHOME/.hostkey | ||
102 | |||
103 | |||
104 | [dht] | ||
105 | AUTOSTART = NO | ||
106 | |||
107 | |||