From: xrs Date: Wed, 2 Aug 2017 21:37:07 +0000 (+0200) Subject: test_multicast: test 12 peers in line and star topology X-Git-Tag: gnunet-0.11.0rc0~183 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2ee79796bd4693a43f20f984a781ffcaf0e4df10;p=oweals%2Fgnunet.git test_multicast: test 12 peers in line and star topology --- diff --git a/src/multicast/Makefile.am b/src/multicast/Makefile.am index f26c6ef4b..13212bca3 100644 --- a/src/multicast/Makefile.am +++ b/src/multicast/Makefile.am @@ -51,7 +51,8 @@ gnunet_service_multicast_LDADD = \ check_PROGRAMS = \ test_multicast \ - test_multicast_multipeer + test_multicast_multipeer_star \ + test_multicast_multipeer_line # test_multicast_2peers if ENABLE_TEST_RUN @@ -65,10 +66,15 @@ test_multicast_LDADD = \ libgnunetmulticast.la \ $(top_builddir)/src/testing/libgnunettesting.la \ $(top_builddir)/src/util/libgnunetutil.la - -test_multicast_multipeer_SOURCES = \ +test_multicast_multipeer_star_SOURCES = \ + test_multicast_multipeer.c +test_multicast_multipeer_star_LDADD = \ + libgnunetmulticast.la \ + $(top_builddir)/src/testbed/libgnunettestbed.la \ + $(top_builddir)/src/util/libgnunetutil.la +test_multicast_multipeer_line_SOURCES = \ test_multicast_multipeer.c -test_multicast_multipeer_LDADD = \ +test_multicast_multipeer_line_LDADD = \ libgnunetmulticast.la \ $(top_builddir)/src/testbed/libgnunettestbed.la \ $(top_builddir)/src/util/libgnunetutil.la diff --git a/src/multicast/test_multicast.conf b/src/multicast/test_multicast.conf deleted file mode 100644 index 45bf39618..000000000 --- a/src/multicast/test_multicast.conf +++ /dev/null @@ -1,56 +0,0 @@ -[testbed] -HOSTNAME = localhost -OVERLAY_TOPOLOGY = STAR - -[arm] -GLOBAL_POSTFIX=-L ERROR - -[hostlist] -# Do not use a hostlist server -SERVERS = - -[multicast] -#PREFIX = tmux split-window -v gdb -x ./cmd.gdb --args -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock - -[vpn] -AUTOSTART = NO - -[peerinfo] -# Do not use shipped gnunet HELLOs -USE_INCLUDED_HELLOS = NO - -# Option to disable all disk IO; only useful for testbed runs -# (large-scale experiments); disables persistence of HELLOs! -NO_IO = YES - -[nat] -ENABLE_UPNP = NO - -[fs] -FORCESTART = NO -AUTOSTART = NO - -[vpn] -FORCESTART = NO -AUTOSTART = NO - -[revocation] -FORCESTART = NO -AUTOSTART = NO - -[gns] -FORCESTART = NO -AUTOSTART = NO - -[namestore] -FORCESTART = NO -AUTOSTART = NO - -[namecache] -FORCESTART = NO -AUTOSTART = NO - -[topology] -FORCESTART = NO -AUTOSTART = NO diff --git a/src/multicast/test_multicast_line.conf b/src/multicast/test_multicast_line.conf new file mode 100644 index 000000000..23358e565 --- /dev/null +++ b/src/multicast/test_multicast_line.conf @@ -0,0 +1,60 @@ +[testbed] +HOSTNAME = localhost +OVERLAY_TOPOLOGY = LINE + +[arm] +GLOBAL_POSTFIX=-L ERROR + +[multicast] +#PREFIX = tmux new-window gdb -x ./cmd.gdb --args +#PREFIX = valgrind --leak-check=full +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock + +[vpn] +AUTOSTART = NO + +[peerinfo] +# Do not use shipped gnunet HELLOs +USE_INCLUDED_HELLOS = NO + +# Option to disable all disk IO; only useful for testbed runs +# (large-scale experiments); disables persistence of HELLOs! +NO_IO = YES + +[cadet] +ID_ANNOUNCE_TIME = 5 s + +[hostlist] +FORCESTART = NO +AUTOSTART = NO + +[nat] +ENABLE_UPNP = NO + +[fs] +FORCESTART = NO +AUTOSTART = NO + +[vpn] +FORCESTART = NO +AUTOSTART = NO + +[revocation] +FORCESTART = NO +AUTOSTART = NO + +[gns] +FORCESTART = NO +AUTOSTART = NO + +[namestore] +FORCESTART = NO +AUTOSTART = NO + +[namecache] +FORCESTART = NO +AUTOSTART = NO + +[topology] +FORCESTART = NO +AUTOSTART = NO diff --git a/src/multicast/test_multicast_multipeer.c b/src/multicast/test_multicast_multipeer.c index 29ee1e48f..5f4493993 100644 --- a/src/multicast/test_multicast_multipeer.c +++ b/src/multicast/test_multicast_multipeer.c @@ -33,7 +33,7 @@ #include "gnunet_testbed_service.h" #include "gnunet_multicast_service.h" -#define NUM_PEERS 10 +#define PEERS_REQUESTED 12 struct multicast_peer { @@ -65,11 +65,11 @@ static struct multicast_peer **mc_peers; static struct GNUNET_TESTBED_Peer **peers; // FIXME: refactor -static struct GNUNET_TESTBED_Operation *op[NUM_PEERS]; -static struct GNUNET_TESTBED_Operation *pi_op[NUM_PEERS]; +static struct GNUNET_TESTBED_Operation *op[PEERS_REQUESTED]; +static struct GNUNET_TESTBED_Operation *pi_op[PEERS_REQUESTED]; static struct GNUNET_MULTICAST_Origin *origin; -static struct GNUNET_MULTICAST_Member *member[NUM_PEERS]; /* first element always empty */ +static struct GNUNET_MULTICAST_Member *member[PEERS_REQUESTED]; /* first element always empty */ static struct GNUNET_SCHEDULER_Task *timeout_tid; @@ -77,8 +77,8 @@ static struct GNUNET_CRYPTO_EddsaPrivateKey group_key; static struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; static struct GNUNET_HashCode group_pub_key_hash; -static struct GNUNET_CRYPTO_EcdsaPrivateKey *member_key[NUM_PEERS]; -static struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key[NUM_PEERS]; +static struct GNUNET_CRYPTO_EcdsaPrivateKey *member_key[PEERS_REQUESTED]; +static struct GNUNET_CRYPTO_EcdsaPublicKey *member_pub_key[PEERS_REQUESTED]; /** @@ -93,7 +93,7 @@ static int result; static void shutdown_task (void *cls) { - for (int i=0;itest_ok) return; @@ -313,7 +313,7 @@ origin_notify (void *cls, *data_size = sizeof (struct pingpong_msg); memcpy(data, pp_msg, *data_size); - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin sends pong (to all)\n"); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "origin sends pong\n"); return GNUNET_YES; } @@ -520,7 +520,7 @@ service_connect (void *cls, if (0 == mc_peer->peer) { // Get GNUnet identity of members - for (int i = 0; ipeer = i; @@ -600,12 +600,26 @@ int main (int argc, char *argv[]) { int ret; + char const *config_file; + + if (strstr (argv[0], "_line") != NULL) + { + config_file = "test_multicast_line.conf"; + } + else if (strstr(argv[0], "_star") != NULL) + { + config_file = "test_multicast_star.conf"; + } + else + { + config_file = "test_multicast_star.conf"; + } result = GNUNET_SYSERR; ret = GNUNET_TESTBED_test_run ("test-multicast-multipeer", /* test case name */ - "test_multicast.conf", /* template configuration */ - NUM_PEERS, /* number of peers to start */ + config_file, /* template configuration */ + PEERS_REQUESTED, /* number of peers to start */ 0LL, /* Event mask - set to 0 for no event notifications */ NULL, /* Controller event callback */ NULL, /* Closure for controller event callback */ diff --git a/src/multicast/test_multicast_star.conf b/src/multicast/test_multicast_star.conf new file mode 100644 index 000000000..8eb98d986 --- /dev/null +++ b/src/multicast/test_multicast_star.conf @@ -0,0 +1,60 @@ +[testbed] +HOSTNAME = localhost +OVERLAY_TOPOLOGY = STAR + +[arm] +GLOBAL_POSTFIX=-L ERROR + +[multicast] +#PREFIX = tmux new-window gdb -x ./cmd.gdb --args +#PREFIX = valgrind --leak-check=full +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-multicast.sock + +[vpn] +AUTOSTART = NO + +[peerinfo] +# Do not use shipped gnunet HELLOs +USE_INCLUDED_HELLOS = NO + +# Option to disable all disk IO; only useful for testbed runs +# (large-scale experiments); disables persistence of HELLOs! +NO_IO = YES + +[cadet] +ID_ANNOUNCE_TIME = 5 s + +[hostlist] +FORCESTART = NO +AUTOSTART = NO + +[nat] +ENABLE_UPNP = NO + +[fs] +FORCESTART = NO +AUTOSTART = NO + +[vpn] +FORCESTART = NO +AUTOSTART = NO + +[revocation] +FORCESTART = NO +AUTOSTART = NO + +[gns] +FORCESTART = NO +AUTOSTART = NO + +[namestore] +FORCESTART = NO +AUTOSTART = NO + +[namecache] +FORCESTART = NO +AUTOSTART = NO + +[topology] +FORCESTART = NO +AUTOSTART = NO