aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2021-08-30 15:04:46 +0200
committert3sserakt <t3ss@posteo.de>2021-08-30 15:04:46 +0200
commitc66295e27c44c3ad4453f0d7ba9ccd905a6decb8 (patch)
tree4df73912ace5e31c9e16ac778edd1d1ee2cfd997 /src/transport
parent744538ba3d388c3befa367c75d9a85126430cf8e (diff)
downloadgnunet-c66295e27c44c3ad4453f0d7ba9ccd905a6decb8.tar.gz
gnunet-c66295e27c44c3ad4453f0d7ba9ccd905a6decb8.zip
- introduced nested namespace in test script to get rid of the permission problem, renamed test file.
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/Makefile.am10
-rw-r--r--src/transport/test_transport_api_cmd_simple_send.c86
2 files changed, 5 insertions, 91 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 61b3bab7c..4ea3b58c4 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -556,7 +556,7 @@ libgnunet_plugin_transport_https_server_la_CFLAGS = \
556 556
557if HAVE_TESTING 557if HAVE_TESTING
558check_PROGRAMS = \ 558check_PROGRAMS = \
559 test_transport_api_cmd_simple_send \ 559 test_transport_simple_send \
560 test_transport_address_switch_tcp \ 560 test_transport_address_switch_tcp \
561 test_transport_testing_startstop \ 561 test_transport_testing_startstop \
562 test_transport_testing_restart \ 562 test_transport_testing_restart \
@@ -705,7 +705,7 @@ test_transport_api_slow_ats
705endif 705endif
706if HAVE_EXPERIMENTAL 706if HAVE_EXPERIMENTAL
707TESTS += \ 707TESTS += \
708 test_transport_api_cmd_simple_send \ 708 test_transport_simple_send \
709 test_transport_address_switch_udp \ 709 test_transport_address_switch_udp \
710 test_plugin_udp \ 710 test_plugin_udp \
711 test_transport_api_udp \ 711 test_transport_api_udp \
@@ -726,9 +726,9 @@ endif
726check_SCRIPTS= \ 726check_SCRIPTS= \
727 test_transport_simple_send.sh 727 test_transport_simple_send.sh
728 728
729test_transport_api_cmd_simple_send_SOURCES = \ 729test_transport_simple_send_SOURCES = \
730 test_transport_api_cmd_simple_send.c 730 test_transport_simple_send.c
731test_transport_api_cmd_simple_send_LDADD = \ 731test_transport_simple_send_LDADD = \
732 $(top_builddir)/src/testing/libgnunettesting.la \ 732 $(top_builddir)/src/testing/libgnunettesting.la \
733 $(top_builddir)/src/util/libgnunetutil.la \ 733 $(top_builddir)/src/util/libgnunetutil.la \
734 $(top_builddir)/src/testbed/libgnunettestbed.la \ 734 $(top_builddir)/src/testbed/libgnunettestbed.la \
diff --git a/src/transport/test_transport_api_cmd_simple_send.c b/src/transport/test_transport_api_cmd_simple_send.c
deleted file mode 100644
index 27b9f95de..000000000
--- a/src/transport/test_transport_api_cmd_simple_send.c
+++ /dev/null
@@ -1,86 +0,0 @@
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}