2 This file is part of GNUnet.
3 Copyright (C) 2009, 2010, 2015 Christian Grothoff (and other contributing authors)
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.
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.
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., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 * @file core/test_core_quota_compliance.c
22 * @brief testcase for core_api.c focusing quota compliance on core level
25 #include "gnunet_arm_service.h"
26 #include "gnunet_core_service.h"
27 #include "gnunet_util_lib.h"
28 #include "gnunet_ats_service.h"
29 #include "gnunet_transport_service.h"
30 #include "gnunet_statistics_service.h"
34 #define ASYMMETRIC_SEND_LIMITED 1
35 #define ASYMMETRIC_RECV_LIMITED 2
38 * Note that this value must not significantly exceed
39 * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise
40 * messages may be dropped even for a reliable transport.
42 #define TOTAL_MSGS (60000 * 10)
45 * How long until we give up on transmitting the message?
47 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300)
50 * What delay do we request from the core service for transmission?
52 #define FAST_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 150)
55 #define MESSAGESIZE 1024
56 #define MEASUREMENT_LENGTH GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
58 static unsigned long long total_bytes_sent;
59 static unsigned long long total_bytes_recv;
61 static struct GNUNET_TIME_Absolute start_time;
63 static struct GNUNET_SCHEDULER_Task *err_task;
65 static struct GNUNET_SCHEDULER_Task *measure_task;
67 static struct GNUNET_SCHEDULER_Task *connect_task;
72 struct GNUNET_CONFIGURATION_Handle *cfg;
73 struct GNUNET_CORE_Handle *ch;
74 struct GNUNET_CORE_TransmitHandle *nth;
75 struct GNUNET_PeerIdentity id;
76 struct GNUNET_TRANSPORT_Handle *th;
77 struct GNUNET_MessageHeader *hello;
78 struct GNUNET_STATISTICS_Handle *stats;
79 struct GNUNET_TRANSPORT_GetHelloHandle *ghh;
80 struct GNUNET_ATS_ConnectivityHandle *ats;
81 struct GNUNET_ATS_ConnectivitySuggestHandle *ats_sh;
83 struct GNUNET_OS_Process *arm_proc;
86 static struct PeerContext p1;
87 static struct PeerContext p2;
89 static unsigned long long current_quota_p1_in;
90 static unsigned long long current_quota_p1_out;
91 static unsigned long long current_quota_p2_in;
92 static unsigned long long current_quota_p2_out;
102 #define OKPP do { ok++; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
104 #define OKPP do { ok++; } while (0)
109 struct GNUNET_MessageHeader header;
115 terminate_peer (struct PeerContext *p)
119 GNUNET_CORE_notify_transmit_ready_cancel (p->nth);
124 GNUNET_CORE_disconnect (p->ch);
129 GNUNET_TRANSPORT_get_hello_cancel (p->ghh);
130 GNUNET_TRANSPORT_disconnect (p->th);
133 if (NULL != p->ats_sh)
135 GNUNET_ATS_connectivity_suggest_cancel (p->ats_sh);
140 GNUNET_ATS_connectivity_done (p->ats);
143 if (NULL != p->stats)
145 GNUNET_STATISTICS_destroy (p->stats, GNUNET_NO);
148 if (NULL != p->hello)
150 GNUNET_free (p->hello);
157 terminate_task (void *cls,
158 const struct GNUNET_SCHEDULER_TaskContext *tc)
161 terminate_peer (&p1);
162 terminate_peer (&p2);
163 if (NULL != connect_task)
165 GNUNET_SCHEDULER_cancel (connect_task);
172 terminate_task_error (void *cls,
173 const struct GNUNET_SCHEDULER_TaskContext *tc)
177 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
178 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
179 "Testcase failed!\n");
180 terminate_peer (&p1);
181 terminate_peer (&p2);
183 if (NULL != measure_task)
185 GNUNET_SCHEDULER_cancel (measure_task);
188 if (NULL != connect_task)
190 GNUNET_SCHEDULER_cancel (connect_task);
198 try_connect (void *cls,
199 const struct GNUNET_SCHEDULER_TaskContext *tc)
202 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &try_connect,
204 GNUNET_TRANSPORT_try_connect (p1.th, &p2.id, NULL, NULL); /*FIXME TRY_CONNECT change */
205 GNUNET_TRANSPORT_try_connect (p2.th, &p1.id, NULL, NULL); /*FIXME TRY_CONNECT change */
210 * Callback function to process statistic values.
213 * @param subsystem name of subsystem that created the statistic
214 * @param name the name of the datum
215 * @param value the current value
216 * @param is_persistent #GNUNET_YES if the value is persistent, #GNUNET_NO if not
217 * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
220 print_stat (void *cls,
221 const char *subsystem,
227 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
228 "Peer1 %50s = %12llu\n",
230 (unsigned long long) value);
232 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
233 "Peer2 %50s = %12llu\n",
235 (unsigned long long) value);
241 measurement_stop (void *cls,
242 const struct GNUNET_SCHEDULER_TaskContext *tc)
244 unsigned long long delta;
245 unsigned long long throughput_out;
246 unsigned long long throughput_in;
247 unsigned long long max_quota_in;
248 unsigned long long max_quota_out;
249 unsigned long long quota_delta;
250 enum GNUNET_ErrorType kind = GNUNET_ERROR_TYPE_DEBUG;
253 FPRINTF (stdout, "%s", "\n");
256 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value_us;
258 throughput_out = total_bytes_sent * 1000000LL / delta; /* convert to bytes/s */
259 throughput_in = total_bytes_recv * 1000000LL / delta; /* convert to bytes/s */
261 max_quota_in = GNUNET_MIN (current_quota_p1_in, current_quota_p2_in);
262 max_quota_out = GNUNET_MIN (current_quota_p1_out, current_quota_p2_out);
263 if (max_quota_out < max_quota_in)
264 quota_delta = max_quota_in / 3;
266 quota_delta = max_quota_out / 3;
268 if ((throughput_out > (max_quota_out + quota_delta)) ||
269 (throughput_in > (max_quota_in + quota_delta)))
273 GNUNET_STATISTICS_get (p1.stats, "core", "# discarded CORE_SEND requests",
274 GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p1);
276 GNUNET_STATISTICS_get (p1.stats, "core",
277 "# discarded CORE_SEND request bytes",
278 GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p1);
279 GNUNET_STATISTICS_get (p1.stats, "core",
280 "# discarded lower priority CORE_SEND requests",
281 GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, NULL);
282 GNUNET_STATISTICS_get (p1.stats, "core",
283 "# discarded lower priority CORE_SEND request bytes",
284 GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p1);
285 GNUNET_STATISTICS_get (p2.stats, "core", "# discarded CORE_SEND requests",
286 GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p2);
288 GNUNET_STATISTICS_get (p2.stats, "core",
289 "# discarded CORE_SEND request bytes",
290 GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p2);
291 GNUNET_STATISTICS_get (p2.stats, "core",
292 "# discarded lower priority CORE_SEND requests",
293 GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p2);
294 GNUNET_STATISTICS_get (p2.stats, "core",
295 "# discarded lower priority CORE_SEND request bytes",
296 GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p2);
299 kind = GNUNET_ERROR_TYPE_ERROR;
303 GNUNET_log (kind, "Core quota compliance test with symmetric quotas: %s\n",
304 (0 == ok) ? "PASSED" : "FAILED");
306 case ASYMMETRIC_SEND_LIMITED:
308 "Core quota compliance test with limited sender quota: %s\n",
309 (0 == ok) ? "PASSED" : "FAILED");
311 case ASYMMETRIC_RECV_LIMITED:
313 "Core quota compliance test with limited receiver quota: %s\n",
314 (0 == ok) ? "PASSED" : "FAILED");
317 GNUNET_log (kind, "Peer 1 send rate: %llu b/s (%llu bytes in %llu ms)\n",
318 throughput_out, total_bytes_sent, delta);
319 GNUNET_log (kind, "Peer 1 send quota: %llu b/s\n", current_quota_p1_out);
320 GNUNET_log (kind, "Peer 2 receive rate: %llu b/s (%llu bytes in %llu ms)\n",
321 throughput_in, total_bytes_recv, delta);
322 GNUNET_log (kind, "Peer 2 receive quota: %llu b/s\n", current_quota_p2_in);
324 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Max. inbound quota allowed: %llu b/s\n",max_quota_in );
325 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Max. outbound quota allowed: %llu b/s\n",max_quota_out);
327 GNUNET_SCHEDULER_cancel (err_task);
328 err_task = GNUNET_SCHEDULER_add_now (&terminate_task, NULL);
334 transmit_ready (void *cls, size_t size, void *buf)
337 struct TestMessage hdr;
341 GNUNET_assert (size <= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE);
344 if ((p1.ch != NULL) && (p1.connect_status == 1))
345 GNUNET_break (NULL !=
347 GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO,
348 GNUNET_CORE_PRIO_BEST_EFFORT,
349 FAST_TIMEOUT, &p2.id,
351 &transmit_ready, &p1)));
354 GNUNET_assert (tr_n < TOTAL_MSGS);
356 GNUNET_assert (size >= MESSAGESIZE);
357 GNUNET_assert (buf != NULL);
361 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
362 "Sending message %u of size %u at offset %u\n", tr_n,
364 hdr.header.size = htons (MESSAGESIZE);
365 hdr.header.type = htons (MTYPE);
366 hdr.num = htonl (tr_n);
367 memcpy (&cbuf[ret], &hdr, sizeof (struct TestMessage));
368 ret += sizeof (struct TestMessage);
369 memset (&cbuf[ret], tr_n, MESSAGESIZE - sizeof (struct TestMessage));
370 ret += MESSAGESIZE - sizeof (struct TestMessage);
372 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16))
373 break; /* sometimes pack buffer full, sometimes not */
375 while (size - ret >= MESSAGESIZE);
376 GNUNET_SCHEDULER_cancel (err_task);
378 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &terminate_task_error, NULL);
380 total_bytes_sent += ret;
387 connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
389 struct PeerContext *pc = cls;
391 if (0 == memcmp (&pc->id, peer, sizeof (struct GNUNET_PeerIdentity)))
392 return; /* loopback */
393 GNUNET_assert (pc->connect_status == 0);
394 pc->connect_status = 1;
397 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
398 "Encrypted connection established to peer `%4s'\n",
400 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
401 "Asking core (1) for transmission to peer `%4s'\n",
402 GNUNET_i2s (&p2.id));
403 if (err_task != NULL)
404 GNUNET_SCHEDULER_cancel (err_task);
406 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &terminate_task_error, NULL);
407 start_time = GNUNET_TIME_absolute_get ();
408 running = GNUNET_YES;
410 GNUNET_SCHEDULER_add_delayed (MEASUREMENT_LENGTH, &measurement_stop,
413 GNUNET_break (NULL !=
415 GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO,
416 GNUNET_CORE_PRIO_BEST_EFFORT,
419 &transmit_ready, &p1)));
425 disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
427 struct PeerContext *pc = cls;
429 if (0 == memcmp (&pc->id, peer, sizeof (struct GNUNET_PeerIdentity)))
430 return; /* loopback */
431 pc->connect_status = 0;
432 if (NULL != measure_task)
434 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
435 "Measurement aborted due to disconnect!\n");
436 GNUNET_SCHEDULER_cancel (measure_task);
441 GNUNET_CORE_notify_transmit_ready_cancel (pc->nth);
444 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Encrypted connection to `%4s' cut\n",
450 inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
451 const struct GNUNET_MessageHeader *message)
453 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
454 "Core provides inbound data from `%4s' %llu.\n",
455 GNUNET_i2s (other), ntohs (message->size));
456 total_bytes_recv += ntohs (message->size);
462 outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
463 const struct GNUNET_MessageHeader *message)
465 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
466 "Core notifies about outbound data for `%4s'.\n",
473 transmit_ready (void *cls, size_t size, void *buf);
477 process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
478 const struct GNUNET_MessageHeader *message)
481 const struct TestMessage *hdr;
483 hdr = (const struct TestMessage *) message;
484 if (MTYPE != ntohs (message->type))
485 return GNUNET_SYSERR;
486 if (ntohs (message->size) != MESSAGESIZE)
488 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
489 "Expected message %u of size %u, got %u bytes of message %u\n",
490 n, MESSAGESIZE, ntohs (message->size), ntohl (hdr->num));
491 GNUNET_SCHEDULER_cancel (err_task);
492 err_task = GNUNET_SCHEDULER_add_now (&terminate_task_error, NULL);
493 return GNUNET_SYSERR;
495 if (ntohl (hdr->num) != n)
497 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
498 "Expected message %u of size %u, got %u bytes of message %u\n",
499 n, MESSAGESIZE, ntohs (message->size), ntohl (hdr->num));
500 GNUNET_SCHEDULER_cancel (err_task);
501 err_task = GNUNET_SCHEDULER_add_now (&terminate_task_error, NULL);
502 return GNUNET_SYSERR;
504 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got message %u of size %u\n",
505 ntohl (hdr->num), ntohs (message->size));
508 FPRINTF (stderr, "%s", ".");
511 if (running == GNUNET_YES)
512 GNUNET_break (NULL !=
513 GNUNET_CORE_notify_transmit_ready (p1.ch, GNUNET_NO,
514 GNUNET_CORE_PRIO_BEST_EFFORT,
515 FAST_TIMEOUT, &p2.id,
517 &transmit_ready, &p1));
522 static struct GNUNET_CORE_MessageHandler handlers[] = {
523 {&process_mtype, MTYPE, 0},
530 init_notify (void *cls,
531 const struct GNUNET_PeerIdentity *my_identity)
533 struct PeerContext *p = cls;
535 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
536 "Connection to CORE service of `%4s' established\n",
537 GNUNET_i2s (my_identity));
538 GNUNET_assert (NULL != my_identity);
539 p->id = *my_identity;
542 GNUNET_assert (ok == 2);
546 GNUNET_CORE_connect (p2.cfg, &p2, &init_notify, &connect_notify,
547 &disconnect_notify, &inbound_notify, GNUNET_YES,
548 &outbound_notify, GNUNET_YES, handlers);
552 GNUNET_assert (ok == 3);
554 GNUNET_assert (cls == &p2);
555 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
556 "Asking core (1) to connect to peer `%4s'\n",
557 GNUNET_i2s (&p2.id));
558 connect_task = GNUNET_SCHEDULER_add_now (&try_connect, NULL);
564 process_hello (void *cls, const struct GNUNET_MessageHeader *message)
566 struct PeerContext *p = cls;
568 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
569 "Received (my) `%s' from transport service\n", "HELLO");
570 GNUNET_assert (message != NULL);
571 p->hello = GNUNET_malloc (ntohs (message->size));
572 memcpy (p->hello, message, ntohs (message->size));
573 if ((p == &p1) && (p2.th != NULL))
574 GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL);
575 if ((p == &p2) && (p1.th != NULL))
576 GNUNET_TRANSPORT_offer_hello (p1.th, message, NULL, NULL);
578 if ((p == &p1) && (p2.hello != NULL))
579 GNUNET_TRANSPORT_offer_hello (p1.th, p2.hello, NULL, NULL);
580 if ((p == &p2) && (p1.hello != NULL))
581 GNUNET_TRANSPORT_offer_hello (p2.th, p1.hello, NULL, NULL);
587 setup_peer (struct PeerContext *p, const char *cfgname)
591 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
592 p->cfg = GNUNET_CONFIGURATION_create ();
594 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
597 "gnunet-service-arm",
598 "-c", cfgname, NULL);
599 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
600 p->stats = GNUNET_STATISTICS_create ("core", p->cfg);
601 GNUNET_assert (p->stats != NULL);
602 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL);
603 GNUNET_assert (p->th != NULL);
604 p->ats = GNUNET_ATS_connectivity_init (p->cfg);
605 GNUNET_assert (NULL != p->ats);
606 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
607 GNUNET_free (binary);
612 run (void *cls, char *const *args, const char *cfgfile,
613 const struct GNUNET_CONFIGURATION_Handle *cfg)
615 GNUNET_assert (ok == 1);
618 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &terminate_task_error, NULL);
619 if (test == SYMMETRIC)
621 setup_peer (&p1, "test_core_quota_peer1.conf");
622 setup_peer (&p2, "test_core_quota_peer2.conf");
624 else if (test == ASYMMETRIC_SEND_LIMITED)
626 setup_peer (&p1, "test_core_quota_asymmetric_send_limit_peer1.conf");
627 setup_peer (&p2, "test_core_quota_asymmetric_send_limit_peer2.conf");
629 else if (test == ASYMMETRIC_RECV_LIMITED)
631 setup_peer (&p1, "test_core_quota_asymmetric_recv_limited_peer1.conf");
632 setup_peer (&p2, "test_core_quota_asymmetric_recv_limited_peer2.conf");
635 GNUNET_assert (test != -1);
636 GNUNET_assert (GNUNET_SYSERR !=
637 GNUNET_CONFIGURATION_get_value_size (p1.cfg, "ATS",
639 ¤t_quota_p1_in));
640 GNUNET_assert (GNUNET_SYSERR !=
641 GNUNET_CONFIGURATION_get_value_size (p2.cfg, "ATS",
643 ¤t_quota_p2_in));
644 GNUNET_assert (GNUNET_SYSERR !=
645 GNUNET_CONFIGURATION_get_value_size (p1.cfg, "ATS",
647 ¤t_quota_p1_out));
648 GNUNET_assert (GNUNET_SYSERR !=
649 GNUNET_CONFIGURATION_get_value_size (p2.cfg, "ATS",
651 ¤t_quota_p2_out));
654 GNUNET_CORE_connect (p1.cfg, &p1, &init_notify, &connect_notify,
655 &disconnect_notify, &inbound_notify, GNUNET_YES,
656 &outbound_notify, GNUNET_YES, handlers);
661 stop_arm (struct PeerContext *p)
663 if (0 != GNUNET_OS_process_kill (p->arm_proc, GNUNET_TERM_SIG))
664 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
665 if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK)
666 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
667 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ARM process %u stopped\n",
668 GNUNET_OS_process_get_pid (p->arm_proc));
669 GNUNET_OS_process_destroy (p->arm_proc);
671 GNUNET_CONFIGURATION_destroy (p->cfg);
678 char *const argv[] = { "test-core-quota-compliance",
680 "test_core_api_data.conf",
683 struct GNUNET_GETOPT_CommandLineOption options[] = {
684 GNUNET_GETOPT_OPTION_END
687 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
688 "test-core-quota-compliance", "nohelp", options, &run,
697 main (int argc, char *argv[])
702 if (strstr (argv[0], "_symmetric") != NULL)
706 else if (strstr (argv[0], "_asymmetric_send") != NULL)
708 test = ASYMMETRIC_SEND_LIMITED;
710 else if (strstr (argv[0], "_asymmetric_recv") != NULL)
712 test = ASYMMETRIC_RECV_LIMITED;
714 GNUNET_assert (test != -1);
715 if (test == SYMMETRIC)
717 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-quota-sym-peer-1/");
718 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-quota-sym-peer-2/");
720 else if (test == ASYMMETRIC_SEND_LIMITED)
722 GNUNET_DISK_directory_remove
723 ("/tmp/test-gnunet-core-quota-asym-send-lim-peer-1/");
724 GNUNET_DISK_directory_remove
725 ("/tmp/test-gnunet-core-quota-asym-send-lim-peer-2/");
727 else if (test == ASYMMETRIC_RECV_LIMITED)
729 GNUNET_DISK_directory_remove
730 ("/tmp/test-gnunet-core-quota-asym-recv-lim-peer-1/");
731 GNUNET_DISK_directory_remove
732 ("/tmp/test-gnunet-core-quota-asym-recv-lim-peer-2/");
735 GNUNET_log_setup ("test-core-quota-compliance",
739 if (test == SYMMETRIC)
741 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-quota-sym-peer-1/");
742 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-quota-sym-peer-2/");
744 else if (test == ASYMMETRIC_SEND_LIMITED)
746 GNUNET_DISK_directory_remove
747 ("/tmp/test-gnunet-core-quota-asym-send-lim-peer-1/");
748 GNUNET_DISK_directory_remove
749 ("/tmp/test-gnunet-core-quota-asym-send-lim-peer-2/");
751 else if (test == ASYMMETRIC_RECV_LIMITED)
753 GNUNET_DISK_directory_remove
754 ("/tmp/test-gnunet-core-quota-asym-recv-lim-peer-1/");
755 GNUNET_DISK_directory_remove
756 ("/tmp/test-gnunet-core-quota-asym-recv-lim-peer-2/");
761 /* end of test_core_quota_compliance.c */