822dc2c46f1261fa5fd9e5ec612f4972da510941
[oweals/gnunet.git] / src / core / test_core_quota_compliance.c
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 core/test_core_quota_compliance.c
22  * @brief testcase for core_api.c focusing quota compliance on core level
23  *
24  * FIXME:
25  * - make sure connect callback is invoked properly as well!
26  */
27 #include "platform.h"
28 #include "gnunet_common.h"
29 #include "gnunet_constants.h"
30 #include "gnunet_arm_service.h"
31 #include "gnunet_core_service.h"
32 #include "gnunet_getopt_lib.h"
33 #include "gnunet_os_lib.h"
34 #include "gnunet_program_lib.h"
35 #include "gnunet_scheduler_lib.h"
36 #include "gnunet_transport_service.h"
37 #include "gnunet_statistics_service.h"
38
39 #define VERBOSE GNUNET_YES
40
41 #define START_ARM GNUNET_YES
42 #define DEBUG_CONNECTIONS GNUNET_NO
43
44 /**
45  * Note that this value must not significantly exceed
46  * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise
47  * messages may be dropped even for a reliable transport.
48  */
49 #define TOTAL_MSGS (600 * 10)
50
51 #define MEASUREMENT_MSG_SIZE 10240
52 #define MEASUREMENT_MAX_QUOTA 1024 * 1024 * 1024
53 #define MEASUREMENT_MIN_QUOTA 1024
54 #define MEASUREMENT_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
55
56 /**
57  * How long until we give up on transmitting the message?
58  */
59 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 6000)
60
61 /**
62  * What delay do we request from the core service for transmission?
63  * Any value smaller than the CORK delay will disable CORKing, which
64  * is what we want here.
65  */
66 #define FAST_TIMEOUT GNUNET_TIME_relative_divide (GNUNET_CONSTANTS_MAX_CORK_DELAY, 2)
67
68 #define MTYPE 12345
69
70 static int is_asymmetric_send_constant;
71 static int is_asymmetric_recv_constant;
72 static unsigned long long current_quota_p1_in;
73 static unsigned long long current_quota_p1_out;
74 static unsigned long long current_quota_p2_in;
75 static unsigned long long current_quota_p2_out;
76
77 static unsigned long long total_bytes;
78 static unsigned long long total_bytes_sent;
79 static unsigned long long total_bytes_recv;
80
81 static struct GNUNET_TIME_Absolute start_time;
82
83 static GNUNET_SCHEDULER_TaskIdentifier err_task;
84
85 static GNUNET_SCHEDULER_TaskIdentifier send_task;
86
87 static GNUNET_SCHEDULER_TaskIdentifier measure_task;
88
89 struct PeerContext
90 {
91   struct GNUNET_CONFIGURATION_Handle *cfg;
92   struct GNUNET_STATISTICS_Handle *stats;
93   struct GNUNET_CORE_Handle *ch;
94   struct GNUNET_PeerIdentity id;   
95   struct GNUNET_TRANSPORT_Handle *th;
96   struct GNUNET_MessageHeader *hello;
97
98   int connect_status;
99 #if START_ARM
100   struct GNUNET_OS_Process *arm_proc;
101 #endif
102 };
103
104 static struct PeerContext p1;
105
106 static struct PeerContext p2;
107
108 static int ok;
109 static int measurement_running;
110
111 struct GNUNET_CORE_TransmitHandle * ch;
112
113 #if VERBOSE
114 #define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
115 #else
116 #define OKPP do { ok++; } while (0)
117 #endif
118
119 struct TestMessage 
120 {
121   struct GNUNET_MessageHeader header;
122   uint32_t num;
123 };
124
125 static void
126 terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
127 {
128   unsigned long long delta;
129
130   GNUNET_CORE_disconnect (p1.ch);
131   p1.ch = NULL;
132   GNUNET_CORE_disconnect (p2.ch);
133   p2.ch = NULL;
134   GNUNET_TRANSPORT_disconnect (p1.th);
135   p1.th = NULL;
136   GNUNET_TRANSPORT_disconnect (p2.th);
137   p2.th = NULL;
138   delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
139   ok = 0;
140 }
141
142
143 static void
144 terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
145 {
146   GNUNET_break (0);
147   if (send_task != GNUNET_SCHEDULER_NO_TASK)
148           GNUNET_SCHEDULER_cancel (send_task);
149   GNUNET_CORE_disconnect (p1.ch);
150   p1.ch = NULL;
151   GNUNET_CORE_disconnect (p2.ch);
152   p2.ch = NULL;
153   GNUNET_TRANSPORT_disconnect (p1.th);
154   p1.th = NULL;
155   GNUNET_TRANSPORT_disconnect (p2.th);
156   p2.th = NULL;
157   ok = 42;
158 }
159
160 static void
161 connect_notify (void *cls,
162                 const struct GNUNET_PeerIdentity *peer,
163                 struct GNUNET_TIME_Relative latency,
164                 uint32_t distance)
165 {
166   struct PeerContext *pc = cls;
167   GNUNET_assert (pc->connect_status == 0);
168   pc->connect_status = 1;
169 #if DEBUG_CONNECTIONS
170   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
171               "Encrypted connection established to peer `%4s'\n",
172               GNUNET_i2s (peer));
173 #endif
174 }
175
176
177 static void
178 disconnect_notify (void *cls,
179                    const struct GNUNET_PeerIdentity *peer)
180 {
181   struct PeerContext *pc = cls;
182   pc->connect_status = 0;
183 #if DEBUG_CONNECTIONS
184   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
185               "Encrypted connection to `%4s' cut\n", GNUNET_i2s (peer));
186 #endif
187 }
188
189
190 static int
191 inbound_notify (void *cls,
192                 const struct GNUNET_PeerIdentity *other,
193                 const struct GNUNET_MessageHeader *message,
194                 struct GNUNET_TIME_Relative latency,
195                 uint32_t distance)
196 {
197   total_bytes_recv += ntohs (message->size);
198   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
199               "Core provides inbound data from `%4s' size %u.\n", GNUNET_i2s (other), ntohs (message->size));
200 #if DEBUG_CONNECTIONS
201   #endif
202   return GNUNET_OK;
203 }
204
205
206 static int
207 outbound_notify (void *cls,
208                  const struct GNUNET_PeerIdentity *other,
209                  const struct GNUNET_MessageHeader *message,
210                  struct GNUNET_TIME_Relative latency,
211                  uint32_t distance)
212 {
213 #if DEBUG_CONNECTIONS
214   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
215               "Core notifies about outbound data for `%4s'.\n",
216               GNUNET_i2s (other));
217 #endif
218   return GNUNET_OK;
219 }
220
221 static void
222 next_fin (void *cls, int success)
223 {
224
225 }
226
227
228 static int
229 check_2 (void *cls,
230          const char *subsystem,
231          const char *name, uint64_t value, int is_persistent)
232 {
233  fprintf(stderr, "%s %s %llu\n", subsystem, name, (long long unsigned int) value);
234  return GNUNET_OK;
235 }
236
237 static void
238 measurement_end (void *cls,
239            const struct GNUNET_SCHEDULER_TaskContext *tc)
240 {
241           struct GNUNET_TIME_Relative duration;
242
243           measure_task  = GNUNET_SCHEDULER_NO_TASK;
244           if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
245                 return;
246
247           if (err_task != GNUNET_SCHEDULER_NO_TASK)
248                   GNUNET_SCHEDULER_cancel (err_task);
249           if (send_task != GNUNET_SCHEDULER_NO_TASK)
250                   GNUNET_SCHEDULER_cancel (send_task);
251
252           GNUNET_STATISTICS_get(p1.stats,"core","# discarded CORE_SEND requests",GNUNET_TIME_UNIT_SECONDS, &next_fin, &check_2, &p1);
253           GNUNET_STATISTICS_get(p1.stats,"core","# discarded CORE_SEND requests",GNUNET_TIME_UNIT_SECONDS, &next_fin, &check_2, &p2);
254           GNUNET_STATISTICS_get(p1.stats,"core","# discarded lower priority CORE_SEND requests",GNUNET_TIME_UNIT_SECONDS, &next_fin, &check_2, &p1);
255           GNUNET_STATISTICS_get(p1.stats,"core","# discarded lower priority CORE_SEND requests",GNUNET_TIME_UNIT_SECONDS, &next_fin, &check_2, &p2);
256
257           GNUNET_STATISTICS_get(p1.stats,"core","# discarded CORE_SEND request bytes",GNUNET_TIME_UNIT_SECONDS, &next_fin, &check_2, &p1);
258           GNUNET_STATISTICS_get(p1.stats,"core","# discarded CORE_SEND request bytes",GNUNET_TIME_UNIT_SECONDS, &next_fin, &check_2, &p2);
259           GNUNET_STATISTICS_get(p1.stats,"core","# discarded lower priority CORE_SEND request bytes",GNUNET_TIME_UNIT_SECONDS, &next_fin, &check_2, &p1);
260           GNUNET_STATISTICS_get(p1.stats,"core","# discarded lower priority CORE_SEND request bytes",GNUNET_TIME_UNIT_SECONDS, &next_fin, &check_2, &p2);
261           measurement_running = GNUNET_NO;
262           duration = GNUNET_TIME_absolute_get_difference(start_time, GNUNET_TIME_absolute_get());
263           GNUNET_log (GNUNET_ERROR_TYPE_INFO,
264                           "\nQuota compliance: \n"\
265                           "Receive rate: %10llu kB/s\n"
266                           "Send rate   : %10llu kB/s\n"\
267                           "Quota       : %10llu kB/s\n",
268                           (total_bytes_recv/(duration.rel_value / 1000)/1024),
269                           (total_bytes_sent/(duration.rel_value / 1000)/1024),current_quota_p1_in/1024);
270
271
272       GNUNET_SCHEDULER_add_now (&terminate_task, NULL);
273 }
274
275 static size_t
276 transmit_ready (void *cls, size_t size, void *buf);
277
278 static void
279 send_tsk (void *cls,
280            const struct GNUNET_SCHEDULER_TaskContext *tc)
281 {
282          send_task = GNUNET_SCHEDULER_NO_TASK;
283
284           ch = GNUNET_CORE_notify_transmit_ready (p1.ch,
285                                                                  0,
286                                                                  FAST_TIMEOUT,
287                                                                  &p2.id,
288                                                                  sizeof (struct TestMessage) + MEASUREMENT_MSG_SIZE,
289                                                                  &transmit_ready, &p1);
290 }
291
292 static void measure (unsigned long long quota_p1, unsigned long long quota_p2 )
293 {
294 #if VERBOSE
295   if ((is_asymmetric_send_constant == GNUNET_YES) || (is_asymmetric_recv_constant == GNUNET_YES))
296           GNUNET_log (GNUNET_ERROR_TYPE_INFO,
297               "Starting core level measurement for %u seconds receiving peer quota %llu kB/s, sending peer quota %llu kB/s\n", MEASUREMENT_INTERVALL.rel_value / 1000 , current_quota_p1_in / 1024, current_quota_p2_out / 1024);
298   else
299           GNUNET_log (GNUNET_ERROR_TYPE_INFO,
300               "Starting core level measurement for %u seconds, symmetric quota %llu kB/s\n", MEASUREMENT_INTERVALL.rel_value / 1000 , current_quota_p2_out / 1024);
301
302 #endif
303 #if DEBUG_CONNECTIONS
304   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
305               "Asking core (1) for transmission to peer `%4s'\n",
306               GNUNET_i2s (&p2.id));
307 #endif
308   err_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
309                               &terminate_task_error,
310                               NULL);
311   measure_task = GNUNET_SCHEDULER_add_delayed (MEASUREMENT_INTERVALL,
312                               &measurement_end,
313                               NULL);
314   start_time = GNUNET_TIME_absolute_get ();
315   measurement_running = GNUNET_YES;
316   total_bytes = 0;
317   total_bytes_sent = 0;
318   ch = GNUNET_CORE_notify_transmit_ready (p1.ch,
319                                                0,
320                                                TIMEOUT,
321                                                &p2.id,
322                                                sizeof (struct TestMessage) + MEASUREMENT_MSG_SIZE,
323                                                &transmit_ready, &p1);
324 }
325
326 static int tr_n;
327
328
329 static int
330 process_mtype (void *cls,
331                const struct GNUNET_PeerIdentity *peer,
332                const struct GNUNET_MessageHeader *message,
333                struct GNUNET_TIME_Relative latency,
334                uint32_t distance)
335 {
336   static int n;
337   unsigned int s;
338   const struct TestMessage *hdr;
339
340   hdr = (const struct TestMessage*) message;
341   s = sizeof (struct TestMessage) + MEASUREMENT_MSG_SIZE;
342   if (MTYPE != ntohs (message->type))
343     return GNUNET_SYSERR;
344
345 #if DEBUG_CONNECTIONS
346   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
347               "Got message %u of size %u\n",
348               ntohl (hdr->num),
349               ntohs (message->size));         
350 #endif
351   n++;
352   if (0 == (n % (TOTAL_MSGS/100)))
353     fprintf (stderr, ".");
354
355   return GNUNET_OK;
356 }
357
358
359 static struct GNUNET_CORE_MessageHandler handlers[] = {
360   {&process_mtype, MTYPE, 0},
361   {NULL, 0, 0}
362 };
363
364
365 static size_t
366 transmit_ready (void *cls, size_t size, void *buf)
367 {
368   char *cbuf = buf;
369   struct TestMessage hdr;
370   unsigned int s;
371   unsigned int ret;
372
373   if (measurement_running != GNUNET_YES)
374         return 0;
375
376   GNUNET_assert (size <= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE); 
377   if (buf == NULL)
378     {
379       if (p1.ch != NULL)
380       {
381                 ch = GNUNET_CORE_notify_transmit_ready (p1.ch,
382                                                          0,
383                                                          FAST_TIMEOUT,
384                                                          &p2.id,
385                                                          sizeof (struct TestMessage) + MEASUREMENT_MSG_SIZE,
386                                                          &transmit_ready, &p1);
387                 GNUNET_break (NULL != ch);
388       }
389       return 0;
390     }
391   ret = 0;
392   ch = NULL;
393   s = sizeof (struct TestMessage) + MEASUREMENT_MSG_SIZE;
394
395   GNUNET_assert (size >= s);
396   GNUNET_assert (buf != NULL);
397   cbuf = buf;
398   do
399     {
400 #if DEBUG_CONNECTIONS
401       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
402                   "Sending message %u of size %u at offset %u\n",
403                   tr_n,
404                   s,
405                   ret);
406 #endif
407       hdr.header.size = htons (s);
408       hdr.header.type = htons (MTYPE);
409       hdr.num = htonl (tr_n);
410       memcpy (&cbuf[ret], &hdr, sizeof (struct TestMessage));
411       ret += sizeof (struct TestMessage);
412       memset (&cbuf[ret], tr_n, s - sizeof (struct TestMessage));
413       ret += s - sizeof (struct TestMessage);
414       tr_n++;
415       if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16))
416         break; /* sometimes pack buffer full, sometimes not */
417     }
418   while (size - ret >= s);
419   GNUNET_SCHEDULER_cancel (err_task);
420   err_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
421                                   &terminate_task_error, 
422                                   NULL);
423
424   total_bytes += ret;
425   total_bytes_sent += ret;
426   if (send_task != GNUNET_SCHEDULER_NO_TASK)
427           GNUNET_SCHEDULER_cancel(send_task);
428   send_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 20), &send_tsk, NULL);
429
430   return ret;
431 }
432
433
434
435 static void
436 init_notify (void *cls,
437              struct GNUNET_CORE_Handle *server,
438              const struct GNUNET_PeerIdentity *my_identity,
439              const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *publicKey)
440 {
441   struct PeerContext *p = cls;
442 #if DEBUG_CONNECTIONS
443   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
444               "Connection to CORE service of `%4s' established\n",
445               GNUNET_i2s (my_identity));
446 #endif
447   GNUNET_assert (server != NULL);
448   p->id = *my_identity;
449   p->ch = server;
450   if (cls == &p1)
451     {
452       GNUNET_assert (ok == 2);
453       OKPP;
454       /* connect p2 */
455       GNUNET_CORE_connect (p2.cfg,
456                            TIMEOUT,
457                            &p2,
458                            &init_notify,                         
459                            &connect_notify,
460                            &disconnect_notify,
461                            NULL,
462                            &inbound_notify,
463                            GNUNET_YES,
464                            &outbound_notify, GNUNET_YES, handlers);
465     }
466   else
467     {
468       GNUNET_assert (ok == 3);
469       OKPP;
470       GNUNET_assert (cls == &p2);
471
472       measure (MEASUREMENT_MIN_QUOTA, MEASUREMENT_MIN_QUOTA);
473     }
474 }
475
476
477 static void
478 process_hello (void *cls,
479                const struct GNUNET_MessageHeader *message)
480 {
481   struct PeerContext *p = cls;
482
483   GNUNET_TRANSPORT_get_hello_cancel (p->th, &process_hello, p);
484 #if DEBUG_CONNECTIONS
485   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
486               "Received (my) `%s' from transport service\n",
487               "HELLO");
488 #endif
489   GNUNET_assert (message != NULL);
490   p->hello = GNUNET_malloc (ntohs (message->size));
491   memcpy (p->hello, message, ntohs (message->size));
492   if ((p == &p1) && (p2.th != NULL))
493     GNUNET_TRANSPORT_offer_hello (p2.th, message);
494   if ((p == &p2) && (p1.th != NULL))
495     GNUNET_TRANSPORT_offer_hello (p1.th, message);
496
497   if ((p == &p1) && (p2.hello != NULL))
498     GNUNET_TRANSPORT_offer_hello (p1.th, p2.hello);
499   if ((p == &p2) && (p1.hello != NULL))
500     GNUNET_TRANSPORT_offer_hello (p2.th, p1.hello);
501 }
502
503
504
505 static void
506 setup_peer (struct PeerContext *p, const char *cfgname)
507 {
508   p->cfg = GNUNET_CONFIGURATION_create ();
509 #if START_ARM
510   p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
511                                         "gnunet-service-arm",
512 #if VERBOSE
513                                         "-L", "DEBUG",
514 #endif
515                                         "-c", cfgname, NULL);
516 #endif
517   GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
518   p->stats = GNUNET_STATISTICS_create ("core", p->cfg);
519   GNUNET_assert (p->stats != NULL);
520   p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL);
521   GNUNET_assert (p->th != NULL);
522   GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
523 }
524
525
526 static void
527 run (void *cls,
528      char *const *args,
529      const char *cfgfile,
530      const struct GNUNET_CONFIGURATION_Handle *cfg)
531 {
532   GNUNET_assert (ok == 1);
533   OKPP;
534   setup_peer (&p1, "test_core_quota_peer1.conf");
535   setup_peer (&p2, "test_core_quota_peer2.conf");
536   GNUNET_CORE_connect (p1.cfg,
537                        TIMEOUT,
538                        &p1,
539                        &init_notify,
540                        &connect_notify,
541                        &disconnect_notify,
542                        NULL,
543                        &inbound_notify,
544                        GNUNET_YES, &outbound_notify, GNUNET_YES, handlers);
545
546   GNUNET_assert (GNUNET_SYSERR != GNUNET_CONFIGURATION_get_value_number (p1.cfg,
547                                          "CORE",
548                                          "TOTAL_QUOTA_IN",
549                                          &current_quota_p1_in));
550   GNUNET_assert (GNUNET_SYSERR != GNUNET_CONFIGURATION_get_value_number (p2.cfg,
551                                          "CORE",
552                                          "TOTAL_QUOTA_IN",
553                                          &current_quota_p2_in));
554   GNUNET_assert (GNUNET_SYSERR != GNUNET_CONFIGURATION_get_value_number (p1.cfg,
555                                          "CORE",
556                                          "TOTAL_QUOTA_OUT",
557                                          &current_quota_p1_out));
558   GNUNET_assert (GNUNET_SYSERR != GNUNET_CONFIGURATION_get_value_number (p2.cfg,
559                                          "CORE",
560                                          "TOTAL_QUOTA_OUT",
561                                          &current_quota_p2_out));
562 }
563
564
565 static void
566 stop_arm (struct PeerContext *p)
567 {
568 #if START_ARM
569   if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM))
570         GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
571   if (GNUNET_OS_process_wait(p->arm_proc) != GNUNET_OK)
572         GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
573
574   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"ARM process stopped\n");
575   GNUNET_OS_process_close (p->arm_proc);
576   p->arm_proc = NULL;
577 #endif
578   GNUNET_STATISTICS_destroy (p->stats, 0);
579   GNUNET_CONFIGURATION_destroy (p->cfg);
580 }
581
582 static int
583 check ()
584 {
585   char *const argv[] = { "test-core-quota-compliance",
586     "-c",
587     "test_core_api_data.conf",
588 #if VERBOSE
589     "-L", "DEBUG",
590 #endif
591     NULL
592   };
593   struct GNUNET_GETOPT_CommandLineOption options[] = {
594     GNUNET_GETOPT_OPTION_END
595   };
596   ok = 1;
597   GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
598                       argv, "test_core_quota_compliance", "nohelp", options, &run, &ok);
599   stop_arm (&p1);
600   stop_arm (&p2);
601   return ok;
602 }
603
604 int
605 main (int argc, char *argv[])
606 {
607   int ret;
608
609   GNUNET_log_setup ("test-core-api",
610 #if VERBOSE
611                     "DEBUG",
612 #else
613                     "WARNING",
614 #endif
615                     NULL);
616   ret = check ();
617   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-quota-peer-2");
618   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-quota-peer-2");
619
620   return ret;
621 }
622
623 /* end of test_core_quota_compliance.c */