gnunet

Main GNUnet Logic
Log | Files | Refs | Submodules | README | LICENSE

commit 7779993f5d43e7af0770bda52c73d3c21a96ec2d
parent 74cf40d70247245a7a538879e0eaa02d1fc48846
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Sun, 22 Dec 2024 12:19:19 +0100

transport(arm): properly name testing plugin

Diffstat:
Msrc/service/arm/Makefile.am | 8++++----
Asrc/service/arm/plugin_testing_arm_probnat.c | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/service/arm/test_arm_plugin_probnat.c | 81-------------------------------------------------------------------------------
Msrc/service/arm/test_arm_probnat_topo.conf | 2+-
4 files changed, 86 insertions(+), 86 deletions(-)

diff --git a/src/service/arm/Makefile.am b/src/service/arm/Makefile.am @@ -101,11 +101,11 @@ EXTRA_DIST = \ test_arm_api_data.conf plugin_LTLIBRARIES = \ - libgnunet_test_arm_plugin_probnat.la + libgnunet_plugin_testing_arm_probnat.la -libgnunet_test_arm_plugin_probnat_la_SOURCES = \ - test_arm_plugin_probnat.c -libgnunet_test_arm_plugin_probnat_la_LIBADD = \ +libgnunet_plugin_testing_arm_probnat_la_SOURCES = \ + plugin_testing_arm_probnat.c +libgnunet_plugin_testing_arm_probnat_la_LIBADD = \ libgnunettestingarm.la \ $(top_builddir)/src/lib/testing/libgnunettesting.la \ $(top_builddir)/src/service/testbed/libgnunettestbed.la \ diff --git a/src/service/arm/plugin_testing_arm_probnat.c b/src/service/arm/plugin_testing_arm_probnat.c @@ -0,0 +1,81 @@ +/* + This file is part of GNUnet + Copyright (C) 2021 GNUnet e.V. + + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + SPDX-License-Identifier: AGPL3.0-or-later + */ + +/** + * @file testing/test_arm_plugin_probnat.c + * @brief a plugin to test burst nat traversal.. + * @author t3sserakt + */ +#include "platform.h" +#include "gnunet_util_lib.h" +#include "gnunet_testing_lib.h" +#include "gnunet_testing_arm_lib.h" +#include "gnunet_testing_testbed_lib.h" + + +static const char* +get_conf_name (const char *my_node_id) +{ + const char *conf_name; + const char *dash; + + dash = strchr (my_node_id, '-'); + GNUNET_assert (NULL != dash); + dash++; + + if (0 == strcmp ("000000", dash)) + conf_name = "test_arm_probnat_host.conf"; + else if (0 == strcmp ("000003", dash)) + conf_name = "test_arm_probnat_peer1.conf"; + else if (0 == strcmp ("000006", dash)) + conf_name = "test_arm_probnat_peer1.conf"; + else + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Getting conf for id %s failed \n", + my_node_id); + GNUNET_assert (0); + } + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Using conf %s", + conf_name); + return conf_name; +} + +GNUNET_TESTING_MAKE_PLUGIN ( + arm, + probnat, + GNUNET_TESTBED_cmd_system_create ("system", + my_node_id), + GNUNET_TESTING_ARM_cmd_start_peer ("start", + "system", + get_conf_name (my_node_id)), + GNUNET_TESTING_cmd_exec_va ("sleep", + GNUNET_OS_PROCESS_EXITED, + 0, + "sleep", + "3000", + NULL), + GNUNET_TESTING_cmd_stop_peer ("stop", + "start") + ) + +/* end of test_arm_plugin_probnat.c */ diff --git a/src/service/arm/test_arm_plugin_probnat.c b/src/service/arm/test_arm_plugin_probnat.c @@ -1,81 +0,0 @@ -/* - This file is part of GNUnet - Copyright (C) 2021 GNUnet e.V. - - GNUnet is free software: you can redistribute it and/or modify it - under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - GNUnet is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - - SPDX-License-Identifier: AGPL3.0-or-later - */ - -/** - * @file testing/test_arm_plugin_probnat.c - * @brief a plugin to test burst nat traversal.. - * @author t3sserakt - */ -#include "platform.h" -#include "gnunet_util_lib.h" -#include "gnunet_testing_lib.h" -#include "gnunet_testing_arm_lib.h" -#include "gnunet_testing_testbed_lib.h" - - -static const char* -get_conf_name (const char *my_node_id) -{ - const char *conf_name; - const char *dash; - - dash = strchr (my_node_id, '-'); - GNUNET_assert (NULL != dash); - dash++; - - if (0 == strcmp ("000000", dash)) - conf_name = "test_arm_probnat_host.conf"; - else if (0 == strcmp ("000003", dash)) - conf_name = "test_arm_probnat_peer1.conf"; - else if (0 == strcmp ("000006", dash)) - conf_name = "test_arm_probnat_peer1.conf"; - else - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Getting conf for id %s failed \n", - my_node_id); - GNUNET_assert (0); - } - - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Using conf %s", - conf_name); - return conf_name; -} - -GNUNET_TESTING_MAKE_PLUGIN ( - libgnunet_test_arm, - probnat, - GNUNET_TESTBED_cmd_system_create ("system", - my_node_id), - GNUNET_TESTING_ARM_cmd_start_peer ("start", - "system", - get_conf_name (my_node_id)), - GNUNET_TESTING_cmd_exec_va ("sleep", - GNUNET_OS_PROCESS_EXITED, - 0, - "sleep", - "3000", - NULL), - GNUNET_TESTING_cmd_stop_peer ("stop", - "start") - ) - -/* end of test_arm_plugin_probnat.c */ diff --git a/src/service/arm/test_arm_probnat_topo.conf b/src/service/arm/test_arm_probnat_topo.conf @@ -3,7 +3,7 @@ SUBNETS = 1 CARRIER_SETUP_PROGRAMMS = iptables -A INPUT -p icmp -j DROP;tc qdisc add dev $UPLINK root netm delay 100ms 10ms; SUBNET_SETUP_PROGRAMMS = iptables -A INPUT -p icmp -j DROP;tc qdisc add dev $UPLINK root netm delay 100ms 10ms; PEER_SETUP_PROGRAMMS = iptables -A INPUT -p icmp -j DROP;tc qdisc add dev $UPLINK root netm delay 100ms 10ms; -TESTBED_PLUGIN = libgnunet_test_arm_plugin_probnat +TESTBED_PLUGIN = libgnunet_plugin_testing_arm_probnat CARRIER_PEERS = 0 SUBNET_PEERS = 1