2 This file is part of GNUnet.
3 (C) 2011 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., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
21 * @file mesh/test_mesh_small.c
23 * @brief Test for the mesh service: retransmission of traffic.
26 #include "gnunet_testing_lib.h"
27 #include "gnunet_mesh_service.h"
29 #define VERBOSE GNUNET_YES
30 #define REMOVE_DIR GNUNET_YES
34 struct MeshPeer *prev;
36 struct MeshPeer *next;
38 struct GNUNET_TESTING_Daemon *daemon;
40 struct GNUNET_MESH_Handle *mesh_handle;
46 unsigned long long total_mesh_bytes;
51 * How long until we give up on connecting the peers?
53 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1500)
56 * Time to wait for stuff that should be rather fast
58 #define SHORT_TIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120)
61 * DIFFERENT TESTS TO RUN
68 * Which test are we running?
73 * How many events have happened
77 static int peers_in_tunnel;
79 static int peers_responded;
87 * Total number of peers in the test.
89 static unsigned long long num_peers;
92 * Global configuration file
94 static struct GNUNET_CONFIGURATION_Handle *testing_cfg;
97 * Total number of currently running peers.
99 static unsigned long long peers_running;
102 * Total number of connections in the whole network.
104 static unsigned int total_connections;
107 * The currently running peer group.
109 static struct GNUNET_TESTING_PeerGroup *pg;
112 * File to report results to.
114 static struct GNUNET_DISK_FileHandle *output_file;
117 * File to log connection info, statistics to.
119 static struct GNUNET_DISK_FileHandle *data_file;
122 * How many data points to capture before triggering next round?
124 static struct GNUNET_TIME_Relative wait_time;
127 * Task called to disconnect peers.
129 static GNUNET_SCHEDULER_TaskIdentifier disconnect_task;
132 * Task To perform tests
134 static GNUNET_SCHEDULER_TaskIdentifier test_task;
137 * Task called to shutdown test.
139 static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
141 static char *topology_file;
143 static struct GNUNET_TESTING_Daemon *d1;
145 static GNUNET_PEER_Id pid1;
147 static struct GNUNET_TESTING_Daemon *d2;
149 static struct GNUNET_TESTING_Daemon *d3;
151 static struct GNUNET_MESH_Handle *h1;
153 static struct GNUNET_MESH_Handle *h2;
155 static struct GNUNET_MESH_Handle *h3;
157 static struct GNUNET_MESH_Tunnel *t;
159 static struct GNUNET_MESH_Tunnel *incoming_t;
161 static struct GNUNET_MESH_Tunnel *incoming_t2;
163 static uint16_t *mesh_peers;
166 * Check whether peers successfully shut down.
169 shutdown_callback (void *cls, const char *emsg)
174 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
175 "***************** test: Shutdown of peers failed!\n");
182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
183 "***************** test: All peers successfully shut down!\n");
190 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
193 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
194 "***************** test: Ending test.\n");
197 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
199 GNUNET_SCHEDULER_cancel (disconnect_task);
200 disconnect_task = GNUNET_SCHEDULER_NO_TASK;
203 if (data_file != NULL)
204 GNUNET_DISK_file_close (data_file);
205 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
206 GNUNET_CONFIGURATION_destroy (testing_cfg);
211 disconnect_mesh_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
213 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
214 "***************** test: disconnecting mesh service of peers\n");
215 disconnect_task = GNUNET_SCHEDULER_NO_TASK;
216 GNUNET_MESH_disconnect (h1);
217 GNUNET_MESH_disconnect (h2);
218 if (test == MULTICAST)
219 GNUNET_MESH_disconnect (h3);
220 if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle)
222 GNUNET_SCHEDULER_cancel (shutdown_handle);
223 shutdown_handle = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
229 * Transmit ready callback
232 tmt_rdy (void *cls, size_t size, void *buf)
234 struct GNUNET_MessageHeader *msg = buf;
236 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
237 "***************** test: tmt_rdy called\n");
238 if (size < sizeof (struct GNUNET_MessageHeader) || NULL == buf)
240 msg->size = htons (sizeof (struct GNUNET_MessageHeader));
241 msg->type = htons ((long) cls);
242 return sizeof (struct GNUNET_MessageHeader);
247 * Function is called whenever a message is received.
249 * @param cls closure (set from GNUNET_MESH_connect)
250 * @param tunnel connection to the other end
251 * @param tunnel_ctx place to store local state associated with the tunnel
252 * @param sender who sent the message
253 * @param message the actual message
254 * @param atsi performance data for the connection
255 * @return GNUNET_OK to keep the connection open,
256 * GNUNET_SYSERR to close it (signal serious error)
259 data_callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
260 const struct GNUNET_PeerIdentity *sender,
261 const struct GNUNET_MessageHeader *message,
262 const struct GNUNET_ATS_Information *atsi)
264 long client = (long) cls;
269 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
270 "***************** test: Origin client got a response!\n");
273 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
275 GNUNET_SCHEDULER_cancel (disconnect_task);
277 GNUNET_SCHEDULER_add_delayed (SHORT_TIME, &disconnect_mesh_peers,
280 if (test == MULTICAST && peers_responded < 2)
282 GNUNET_MESH_tunnel_destroy (tunnel);
286 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
287 "***************** test: Destination client %u got a message.\n",
290 GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0,
291 GNUNET_TIME_UNIT_FOREVER_REL, sender,
292 sizeof (struct GNUNET_MessageHeader),
293 &tmt_rdy, (void *) 1L);
294 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
296 GNUNET_SCHEDULER_cancel (disconnect_task);
298 GNUNET_SCHEDULER_add_delayed (SHORT_TIME, &disconnect_mesh_peers,
310 * Handlers, for diverse services
312 static struct GNUNET_MESH_MessageHandler handlers[] = {
313 {&data_callback, 1, sizeof (struct GNUNET_MessageHeader)},
319 * Method called whenever another peer has added us to a tunnel
320 * the other peer initiated.
323 * @param tunnel new handle to the tunnel
324 * @param initiator peer that started the tunnel
325 * @param atsi performance information for the tunnel
326 * @return initial tunnel context for the tunnel
327 * (can be NULL -- that's not an error)
330 incoming_tunnel (void *cls, struct GNUNET_MESH_Tunnel *tunnel,
331 const struct GNUNET_PeerIdentity *initiator,
332 const struct GNUNET_ATS_Information *atsi)
334 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
335 "***************** test: Incoming tunnel from %s to peer %d\n",
336 GNUNET_i2s (initiator), (long) cls);
338 if ((long) cls == 1L)
341 incoming_t2 = tunnel;
342 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
344 GNUNET_SCHEDULER_cancel (disconnect_task);
346 GNUNET_SCHEDULER_add_delayed (SHORT_TIME, &disconnect_mesh_peers, NULL);
352 * Function called whenever an inbound tunnel is destroyed. Should clean up
353 * any associated state.
355 * @param cls closure (set from GNUNET_MESH_connect)
356 * @param tunnel connection to the other end (henceforth invalid)
357 * @param tunnel_ctx place where local state associated
358 * with the tunnel is stored
361 tunnel_cleaner (void *cls, const struct GNUNET_MESH_Tunnel *tunnel,
366 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
367 "***************** test: Incoming tunnel disconnected at peer %d\n",
374 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
375 "***************** test: Unknown peer! %d\n", i);
377 if (peers_in_tunnel > 0)
380 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
382 GNUNET_SCHEDULER_cancel (disconnect_task);
383 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_mesh_peers, NULL);
391 * Method called whenever a tunnel falls apart.
394 * @param peer peer identity the tunnel stopped working with
397 dh (void *cls, const struct GNUNET_PeerIdentity *peer)
399 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
400 "***************** test: peer %s disconnected\n",
407 * Method called whenever a peer connects to a tunnel.
410 * @param peer peer identity the tunnel was created to, NULL on timeout
411 * @param atsi performance data for the connection
414 ch (void *cls, const struct GNUNET_PeerIdentity *peer,
415 const struct GNUNET_ATS_Information *atsi)
417 struct GNUNET_PeerIdentity *dest;
419 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
420 "***************** test: peer %s connected\n", GNUNET_i2s (peer));
422 if (0 == memcmp (&d2->id, peer, sizeof (d2->id)) && (long) cls == 1L)
424 if (test == MULTICAST && 0 == memcmp (&d3->id, peer, sizeof (d3->id)) &&
434 if (peers_in_tunnel < 2)
441 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
443 GNUNET_SCHEDULER_cancel (disconnect_task);
445 GNUNET_SCHEDULER_add_delayed (SHORT_TIME, &disconnect_mesh_peers, NULL);
446 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
447 "***************** test: Sending data...\n");
449 GNUNET_MESH_notify_transmit_ready (t, GNUNET_NO, 0,
450 GNUNET_TIME_UNIT_FOREVER_REL, dest,
451 sizeof (struct GNUNET_MessageHeader),
452 &tmt_rdy, (void *) 1L);
456 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
457 "***************** test: Disconnect already run?\n");
458 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
459 "***************** test: Aborting...\n");
466 do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
468 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: test_task\n");
469 if (test == MULTICAST)
471 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
472 "***************** test: add peer 3\n");
473 GNUNET_MESH_peer_request_connect_add (t, &d3->id);
475 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: add peer 2\n");
476 GNUNET_MESH_peer_request_connect_add (t, &d2->id);
477 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
478 "***************** test: schedule timeout in 90s\n");
479 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
481 GNUNET_SCHEDULER_cancel (disconnect_task);
483 GNUNET_SCHEDULER_add_delayed (SHORT_TIME, &disconnect_mesh_peers, NULL);
489 * Prototype of a callback function indicating that two peers
490 * are currently connected.
493 * @param first peer id for first daemon
494 * @param second peer id for the second daemon
495 * @param distance distance between the connected peers
496 * @param emsg error message (NULL on success)
499 topo_cb (void *cls, const struct GNUNET_PeerIdentity *first,
500 const struct GNUNET_PeerIdentity *second, const char *emsg)
504 struct GNUNET_PeerIdentity id;
506 GNUNET_PEER_resolve (1, &id);
507 p1 = GNUNET_PEER_search (first);
510 p2 = GNUNET_PEER_search (second);
511 if (p2 == 0 || p2 > num_peers)
513 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
514 "***************** test: %s is UNKNOWN!? (%u)\n",
515 GNUNET_i2s (second), p2);
519 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
520 "***************** test: %s IS a neighbor\n",
521 GNUNET_i2s (second));
524 p1 = GNUNET_PEER_search (second);
527 p2 = GNUNET_PEER_search (first);
528 if (p2 == 0 || p2 > num_peers)
530 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
531 "***************** test: %s is UNKNOWN!? (%u)\n",
532 GNUNET_i2s (first), p2);
536 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
537 "***************** test: %s IS a neighbor\n",
544 * connect_mesh_service: connect to the mesh service of one of the peers
548 connect_mesh_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
550 GNUNET_MESH_ApplicationType app;
552 struct GNUNET_PeerIdentity id;
554 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
555 "***************** test: connect_mesh_service\n");
557 for (i = 1; i <= num_peers; i++)
559 GNUNET_PEER_resolve (i, &id);
560 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
561 "***************** test: peer %s has %u conns to d1\n",
562 GNUNET_i2s (&id), mesh_peers[i]);
563 if (mesh_peers[i] == 0)
566 GNUNET_assert (i < num_peers);
567 d2 = GNUNET_TESTING_daemon_get_by_id (pg, &id);
568 if (test == MULTICAST)
570 for (i++; i <= num_peers; i++)
572 GNUNET_PEER_resolve (i, &id);
573 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
574 "***************** test: peer %s has %u conns to d1\n",
575 GNUNET_i2s (&id), mesh_peers[i]);
576 if (mesh_peers[i] == 0)
579 GNUNET_assert (i < num_peers);
580 d3 = GNUNET_TESTING_daemon_get_by_id (pg, &id);
582 app = (GNUNET_MESH_ApplicationType) 0;
585 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
586 "***************** test: connecting to mesh service of peer %s (%u)\n",
587 GNUNET_i2s (&d1->id), mesh_peers[0]);
588 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
589 "***************** test: connecting to mesh service of peer %s (%u)\n",
590 GNUNET_i2s (&d2->id), i);
591 if (test == MULTICAST)
593 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
594 "***************** test: connecting to mesh service of peer %s (%u)\n",
595 GNUNET_i2s (&d3->id), i);
598 h1 = GNUNET_MESH_connect (d1->cfg, 10, (void *) 1L, NULL, &tunnel_cleaner,
600 h2 = GNUNET_MESH_connect (d2->cfg, 10, (void *) 2L, &incoming_tunnel,
601 &tunnel_cleaner, handlers, &app);
602 if (test == MULTICAST)
604 h3 = GNUNET_MESH_connect (d3->cfg, 10, (void *) 3L, &incoming_tunnel,
605 &tunnel_cleaner, handlers, &app);
607 t = GNUNET_MESH_tunnel_create (h1, NULL, &ch, &dh, (void *) 1L);
610 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
611 (GNUNET_TIME_UNIT_SECONDS, 6), &do_test,
618 * peergroup_ready: start test when all peers are connected
620 * @param emsg error message
623 peergroup_ready (void *cls, const char *emsg)
631 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
632 "***************** test: Peergroup callback called with error, aborting test!\n");
633 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
634 "***************** test: Error from testing: `%s'\n", emsg);
636 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
640 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
641 "************************************************************\n");
642 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
643 "***************** test: Peer Group started successfully!\n");
644 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
645 "***************** test: Have %u connections\n",
649 if (data_file != NULL)
652 buf_len = GNUNET_asprintf (&buf, "CONNECTIONS_0: %u\n", total_connections);
654 GNUNET_DISK_file_write (data_file, buf, buf_len);
657 peers_running = GNUNET_TESTING_daemons_running (pg);
658 for (i = 0; i < num_peers; i++)
660 GNUNET_PEER_Id peer_id;
662 d1 = GNUNET_TESTING_daemon_get (pg, i);
663 peer_id = GNUNET_PEER_intern (&d1->id);
664 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: %u: %s\n",
665 peer_id, GNUNET_i2s (&d1->id));
667 d1 = GNUNET_TESTING_daemon_get (pg, 0);
668 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
669 "***************** test: Peer looking: %s\n",
670 GNUNET_i2s (&d1->id));
671 pid1 = GNUNET_PEER_intern (&d1->id);
672 mesh_peers[pid1] = 100;
673 GNUNET_TESTING_get_topology (pg, &topo_cb, NULL);
675 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
676 (GNUNET_TIME_UNIT_SECONDS, 4),
677 &connect_mesh_service, NULL);
679 GNUNET_SCHEDULER_add_delayed (wait_time, &disconnect_mesh_peers, NULL);
685 * Function that will be called whenever two daemons are connected by
686 * the testing library.
689 * @param first peer id for first daemon
690 * @param second peer id for the second daemon
691 * @param distance distance between the connected peers
692 * @param first_cfg config for the first daemon
693 * @param second_cfg config for the second daemon
694 * @param first_daemon handle for the first daemon
695 * @param second_daemon handle for the second daemon
696 * @param emsg error message (NULL on success)
699 connect_cb (void *cls, const struct GNUNET_PeerIdentity *first,
700 const struct GNUNET_PeerIdentity *second, uint32_t distance,
701 const struct GNUNET_CONFIGURATION_Handle *first_cfg,
702 const struct GNUNET_CONFIGURATION_Handle *second_cfg,
703 struct GNUNET_TESTING_Daemon *first_daemon,
704 struct GNUNET_TESTING_Daemon *second_daemon, const char *emsg)
712 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
713 "***************** test: Problem with new connection (%s)\n",
715 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: (%s)\n",
717 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: (%s)\n",
718 GNUNET_i2s (second));
725 * run: load configuration options and schedule test to run (start peergroup)
728 * @param cfgfile configuration file name (can be NULL)
729 * @param cfg configuration handle
732 run (void *cls, char *const *args, const char *cfgfile,
733 const struct GNUNET_CONFIGURATION_Handle *cfg)
736 struct GNUNET_TESTING_Host *hosts;
740 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
742 GNUNET_log_setup ("test_mesh_small",
751 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
752 "***************** test: Starting daemons.\n");
753 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
754 "use_progressbars", "YES");
758 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing",
759 "num_peers", &num_peers))
761 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
762 "Option TESTING:NUM_PEERS is required!\n");
766 mesh_peers = GNUNET_malloc (sizeof (uint16_t) * (num_peers + 1));
769 GNUNET_CONFIGURATION_get_value_time (testing_cfg, "test_mesh_small",
770 "WAIT_TIME", &wait_time))
772 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
773 "Option test_mesh_small:wait_time is required!\n");
778 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "testing",
779 "topology_output_file",
782 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
783 "Option test_mesh_small:topology_output_file is required!\n");
788 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small",
793 GNUNET_DISK_file_open (data_filename,
794 GNUNET_DISK_OPEN_READWRITE |
795 GNUNET_DISK_OPEN_CREATE,
796 GNUNET_DISK_PERM_USER_READ |
797 GNUNET_DISK_PERM_USER_WRITE);
798 if (data_file == NULL)
800 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
802 GNUNET_free (data_filename);
807 GNUNET_CONFIGURATION_get_value_string (cfg, "test_mesh_small",
808 "output_file", &temp_str))
811 GNUNET_DISK_file_open (temp_str,
812 GNUNET_DISK_OPEN_READWRITE |
813 GNUNET_DISK_OPEN_CREATE,
814 GNUNET_DISK_PERM_USER_READ |
815 GNUNET_DISK_PERM_USER_WRITE);
816 if (output_file == NULL)
817 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
820 GNUNET_free_non_null (temp_str);
822 hosts = GNUNET_TESTING_hosts_load (testing_cfg);
824 pg = GNUNET_TESTING_peergroup_start (testing_cfg, num_peers, TIMEOUT,
825 &connect_cb, &peergroup_ready, NULL,
827 GNUNET_assert (pg != NULL);
829 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (),
830 &shutdown_task, NULL);
836 * test_mesh_small command line options
838 static struct GNUNET_GETOPT_CommandLineOption options[] = {
839 {'V', "verbose", NULL,
840 gettext_noop ("be verbose (print progress information)"),
841 0, &GNUNET_GETOPT_set_one, &verbose},
842 GNUNET_GETOPT_OPTION_END
850 main (int argc, char *argv[])
852 char *const argv2[] = {
855 "test_mesh_small.conf",
863 /* Each peer is supposed to generate the following callbacks:
864 * 1 incoming tunnel (@dest)
865 * 1 connected peer (@orig)
866 * 1 received data packet (@dest)
867 * 1 received data packet (@orig)
868 * 1 received tunnel destroy (@dest)
869 * _________________________________
870 * 5 x ok expected per peer
874 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: Start\n");
875 if (strstr (argv[0], "test_mesh_small_unicast") != NULL)
877 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: UNICAST\n");
881 else if (strstr (argv[0], "test_mesh_small_multicast") != NULL)
883 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: MULTICAST\n");
889 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: UNKNOWN\n");
894 GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2,
896 gettext_noop ("Test mesh in a small network."), options,
899 GNUNET_DISK_directory_remove ("/tmp/test_mesh_small");
903 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
904 "***************** test: FAILED! (%d/%d)\n", ok, ok_goal);
907 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "***************** test: success\n");
911 /* end of test_mesh_small.c */