aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_simple_send.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/test_transport_simple_send.c')
-rw-r--r--src/transport/test_transport_simple_send.c86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/transport/test_transport_simple_send.c b/src/transport/test_transport_simple_send.c
new file mode 100644
index 000000000..924990d0a
--- /dev/null
+++ b/src/transport/test_transport_simple_send.c
@@ -0,0 +1,86 @@
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
21/**
22 * @file transport/test_transport_api_cmd_simple_send.c
23 * @brief Test case executing a script which sends a test message between two peers.
24 * @author t3sserakt
25 */
26#include "platform.h"
27#include "gnunet_testing_ng_lib.h"
28#include "gnunet_util_lib.h"
29
30#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120)
31
32/**
33 * Return value of the test.
34 *
35 */
36static unsigned int rv = 0;
37
38
39/**
40 * Main function to run the test cases.
41 *
42 * @param cls not used.
43 *
44 */
45static void
46run (void *cls)
47{
48 struct GNUNET_TESTING_Command commands[] = {
49 GNUNET_TESTING_cmd_netjail_start ("netjail-start",
50 "2",
51 "1"),
52 GNUNET_TESTING_cmd_netjail_start_testing_system ("netjail-start-testbed",
53 "2",
54 "1",
55 "libgnunet_test_transport_plugin_cmd_simple_send",
56 &rv),
57 GNUNET_TESTING_cmd_stop_testing_system ("stop-testbed",
58 "netjail-start-testbed",
59 "2",
60 "1"),
61 GNUNET_TESTING_cmd_netjail_stop ("netjail-stop",
62 "2",
63 "1"),
64 GNUNET_TESTING_cmd_end ()
65 };
66
67 GNUNET_TESTING_run (NULL,
68 commands,
69 TIMEOUT);
70}
71
72
73int
74main (int argc,
75 char *const *argv)
76{
77 GNUNET_log_setup ("test-netjail",
78 "DEBUG",
79 NULL);
80 GNUNET_SCHEDULER_run (&run,
81 NULL);
82
83 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
84 "Test finished!\n");
85 return rv;
86}