GNUnet 0.24.1-16-gbc519cf4b
plugin_testing_transport_simple_send.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_testing_lib.h"
31
32#define MY_CONF_PREFIX "test_transport_simple_send"
33
34static const char*
36{
37 const char *conf_name;
38 const char *dash;
39
41 "Getting conf for id %s\n",
43 dash = strchr (my_node_id, '-');
44 GNUNET_assert (NULL != dash);
45 dash++;
46
47 if (0 == strcmp ("000000", dash))
48 conf_name = MY_CONF_PREFIX "_host.conf";
49 else if (0 == strcmp ("000003", dash))
50 conf_name = MY_CONF_PREFIX "_peer1.conf";
51 else if (0 == strcmp ("000004", dash))
52 conf_name = MY_CONF_PREFIX "_peer1.conf";
53 else
54 {
56 "Getting conf for id %s failed \n",
58 GNUNET_assert (0);
59 }
60
62 "Using conf %s",
63 conf_name);
64 return conf_name;
65}
66
67
70 simple_send,
74 "system",
78 0,
79 "sleep",
80 "3",
81 NULL),
82 // GNUNET_TRANSPORT_cmd_send_simple ("send", "start", "system", 10),
84 "start")
85 )
86
87 /* end of test_plugin_transport_simple_send.c */
static const char * my_node_id
struct GNUNET_TRANSPORT_ApplicationHandle * transport
Handle to Transport service.
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"))