GNUnet 0.24.1-15-gab6ed22f1
plugin_testing_arm_probnat.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2021 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your 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 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
26#include "platform.h"
27#include "gnunet_util_lib.h"
28#include "gnunet_testing_lib.h"
31
32
33static const char*
35{
36 const char *conf_name;
37 const char *dash;
38
39 dash = strchr (my_node_id, '-');
40 GNUNET_assert (NULL != dash);
41 dash++;
42
43 if (0 == strcmp ("000000", dash))
44 conf_name = "test_arm_probnat_host.conf";
45 else if (0 == strcmp ("000003", dash))
46 conf_name = "test_arm_probnat_peer1.conf";
47 else if (0 == strcmp ("000006", dash))
48 conf_name = "test_arm_probnat_peer1.conf";
49 else
50 {
52 "Getting conf for id %s failed \n",
54 GNUNET_assert (0);
55 }
56
58 "Using conf %s",
59 conf_name);
60 return conf_name;
61}
62
64 arm,
65 probnat,
69 "system",
73 0,
74 "sleep",
75 "3000",
76 NULL),
78 "start")
79 )
80
81/* end of test_arm_plugin_probnat.c */
static const char * my_node_id
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_stop_peer(const char *label, const char *start_label)
Create command.
struct GNUNET_TESTING_Command GNUNET_TESTING_ARM_cmd_start_peer(const char *label, const char *system_label, const char *cfgname)
Create command.
const struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_exec_va(const char *label, enum GNUNET_OS_ProcessStatusType expected_type, unsigned long int expected_exit_code,...)
Command to execute a command.
struct GNUNET_TESTING_Command GNUNET_TESTBED_cmd_system_create(const char *label, const char *my_node_id)
This command is setting up a test environment for a peer to start.
#define GNUNET_log(kind,...)
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
@ GNUNET_OS_PROCESS_EXITED
The process exited with a return code.
static const char * get_conf_name(const char *my_node_id)
GNUNET_TESTING_MAKE_PLUGIN(libgnunet, udp_backchannel, GNUNET_TESTING_cmd_system_create("system-create", ts->testdir), GNUNET_TRANSPORT_cmd_start_peer("start-peer", "system-create", num, node_ip, handlers, ts->cfgname, notify_connect, GNUNET_NO), GNUNET_TESTING_cmd_send_peer_ready("send-peer-ready", write_message), block_send, connect_peers, GNUNET_TRANSPORT_cmd_backchannel_check("backchannel-check", "start-peer", "system-create", num, m_int, n_int, topology), local_prepared, GNUNET_TRANSPORT_cmd_stop_peer("stop-peer", "start-peer"), GNUNET_TESTING_cmd_system_destroy("system-destroy", "system-create"))