diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-10 14:56:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-10 14:56:13 +0000 |
commit | c4a3cadf446bdc115a2efb37b10715c2ad8b4575 (patch) | |
tree | 1d74a099c6dec581236643e69520742a8d3499f9 /src | |
parent | af85737a10af00264c3913d0c53efa9acb7f3535 (diff) | |
download | gnunet-c4a3cadf446bdc115a2efb37b10715c2ad8b4575.tar.gz gnunet-c4a3cadf446bdc115a2efb37b10715c2ad8b4575.zip |
remove redundant test
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/Makefile.am | 11 | ||||
-rw-r--r-- | src/transport/test_transport_startonly.c | 169 | ||||
-rw-r--r-- | src/transport/test_transport_startonly.conf | 11 |
3 files changed, 0 insertions, 191 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 8054aa414..34fbe9caf 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am | |||
@@ -435,7 +435,6 @@ check_PROGRAMS = \ | |||
435 | test_transport_address_switch_udp \ | 435 | test_transport_address_switch_udp \ |
436 | test_transport_testing_startstop \ | 436 | test_transport_testing_startstop \ |
437 | test_transport_testing_restart \ | 437 | test_transport_testing_restart \ |
438 | test_transport_startonly \ | ||
439 | test_plugin_tcp \ | 438 | test_plugin_tcp \ |
440 | test_plugin_udp \ | 439 | test_plugin_udp \ |
441 | $(UNIX_TEST) \ | 440 | $(UNIX_TEST) \ |
@@ -512,7 +511,6 @@ TESTS = \ | |||
512 | test_transport_testing_startstop \ | 511 | test_transport_testing_startstop \ |
513 | test_transport_testing_restart \ | 512 | test_transport_testing_restart \ |
514 | test_transport_testing \ | 513 | test_transport_testing \ |
515 | test_transport_startonly \ | ||
516 | test_plugin_tcp \ | 514 | test_plugin_tcp \ |
517 | test_plugin_udp \ | 515 | test_plugin_udp \ |
518 | $(UNIX_TEST) \ | 516 | $(UNIX_TEST) \ |
@@ -667,15 +665,6 @@ test_transport_api_disconnect_tcp_LDADD = \ | |||
667 | $(top_builddir)/src/util/libgnunetutil.la \ | 665 | $(top_builddir)/src/util/libgnunetutil.la \ |
668 | libgnunettransporttesting.la | 666 | libgnunettransporttesting.la |
669 | 667 | ||
670 | test_transport_startonly_SOURCES = \ | ||
671 | test_transport_startonly.c | ||
672 | test_transport_startonly_LDADD = \ | ||
673 | libgnunettransport.la \ | ||
674 | $(top_builddir)/src/hello/libgnunethello.la \ | ||
675 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | ||
676 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
677 | libgnunettransporttesting.la | ||
678 | |||
679 | test_plugin_tcp_SOURCES = \ | 668 | test_plugin_tcp_SOURCES = \ |
680 | test_plugin_transport.c | 669 | test_plugin_transport.c |
681 | test_plugin_tcp_LDADD = \ | 670 | test_plugin_tcp_LDADD = \ |
diff --git a/src/transport/test_transport_startonly.c b/src/transport/test_transport_startonly.c deleted file mode 100644 index 6f218f2c6..000000000 --- a/src/transport/test_transport_startonly.c +++ /dev/null | |||
@@ -1,169 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2009, 2010 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | 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 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | /** | ||
21 | * @file transport/test_transport_api.c | ||
22 | * @brief base test case for transport implementations | ||
23 | * | ||
24 | * This test case serves as a base for tcp, udp, and udp-nat | ||
25 | * transport test cases. Based on the executable being run | ||
26 | * the correct test case will be performed. Conservation of | ||
27 | * C code apparently. | ||
28 | */ | ||
29 | #include "platform.h" | ||
30 | #include "gnunet_transport_service.h" | ||
31 | #include "transport-testing.h" | ||
32 | |||
33 | /** | ||
34 | * How long until we give up on transmitting the message? | ||
35 | */ | ||
36 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 90) | ||
37 | |||
38 | #define ITERATIONS 10 | ||
39 | |||
40 | struct GNUNET_SCHEDULER_Task * timeout_task; | ||
41 | |||
42 | static struct GNUNET_TRANSPORT_TESTING_PeerContext *p1; | ||
43 | |||
44 | struct GNUNET_TRANSPORT_TESTING_Handle *tth; | ||
45 | |||
46 | static int connected = GNUNET_NO; | ||
47 | |||
48 | static int ret = 0; | ||
49 | |||
50 | static int i; | ||
51 | |||
52 | static void | ||
53 | end () | ||
54 | { | ||
55 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); | ||
56 | |||
57 | if (timeout_task != NULL) | ||
58 | { | ||
59 | GNUNET_SCHEDULER_cancel (timeout_task); | ||
60 | timeout_task = NULL; | ||
61 | } | ||
62 | GNUNET_TRANSPORT_TESTING_done (tth); | ||
63 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting\n"); | ||
64 | } | ||
65 | |||
66 | |||
67 | static void | ||
68 | end_badly (void *cls) | ||
69 | { | ||
70 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
71 | "Fail! Stopping peers\n"); | ||
72 | timeout_task = NULL; | ||
73 | if (p1 != NULL) | ||
74 | GNUNET_TRANSPORT_TESTING_stop_peer (p1); | ||
75 | if (NULL != tth) | ||
76 | GNUNET_TRANSPORT_TESTING_done (tth); | ||
77 | ret = GNUNET_SYSERR; | ||
78 | } | ||
79 | |||
80 | |||
81 | static void | ||
82 | notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer) | ||
83 | { | ||
84 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%s' connected \n", | ||
85 | GNUNET_i2s (peer)); | ||
86 | connected++; | ||
87 | } | ||
88 | |||
89 | |||
90 | static void | ||
91 | notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | ||
92 | { | ||
93 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%s' disconnected \n", | ||
94 | GNUNET_i2s (peer)); | ||
95 | } | ||
96 | |||
97 | |||
98 | static void | ||
99 | notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | ||
100 | const struct GNUNET_MessageHeader *message) | ||
101 | { | ||
102 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving\n"); | ||
103 | } | ||
104 | |||
105 | |||
106 | static void | ||
107 | run (void *cls, char *const *args, const char *cfgfile, | ||
108 | const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
109 | { | ||
110 | tth = GNUNET_TRANSPORT_TESTING_init (); | ||
111 | |||
112 | timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); | ||
113 | |||
114 | i = 1; | ||
115 | FPRINTF (stderr, "%i", i); | ||
116 | while (i <= ITERATIONS) | ||
117 | { | ||
118 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting peer\n"); | ||
119 | p1 = GNUNET_TRANSPORT_TESTING_start_peer (tth, | ||
120 | "test_transport_startonly.conf", | ||
121 | 1, ¬ify_receive, | ||
122 | ¬ify_connect, | ||
123 | ¬ify_disconnect, NULL, p1); | ||
124 | |||
125 | |||
126 | if (p1 != NULL) | ||
127 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer was successfully started\n"); | ||
128 | else | ||
129 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
130 | "Peer1 was not started successfully\n"); | ||
131 | GNUNET_assert (p1 != NULL); | ||
132 | GNUNET_assert (p1->th != NULL); | ||
133 | |||
134 | GNUNET_TRANSPORT_TESTING_stop_peer (p1); | ||
135 | |||
136 | i++; | ||
137 | if (i <= ITERATIONS) | ||
138 | FPRINTF (stderr, "..%i", i); | ||
139 | } | ||
140 | |||
141 | FPRINTF (stderr, "%s", "\n"); | ||
142 | end (); | ||
143 | } | ||
144 | |||
145 | int | ||
146 | main (int argc, char *argv[]) | ||
147 | { | ||
148 | GNUNET_log_setup ("test_transport_testing", | ||
149 | "WARNING", | ||
150 | |||
151 | NULL); | ||
152 | |||
153 | char *const argv_1[] = { "test_transport_testing", | ||
154 | "-c", | ||
155 | "test_transport_api_data.conf", | ||
156 | NULL | ||
157 | }; | ||
158 | |||
159 | struct GNUNET_GETOPT_CommandLineOption options[] = { | ||
160 | GNUNET_GETOPT_OPTION_END | ||
161 | }; | ||
162 | |||
163 | GNUNET_PROGRAM_run ((sizeof (argv_1) / sizeof (char *)) - 1, argv_1, | ||
164 | "test_transport_testing", "nohelp", options, &run, &ret); | ||
165 | |||
166 | return ret; | ||
167 | } | ||
168 | |||
169 | /* end of test_transport_api.c */ | ||
diff --git a/src/transport/test_transport_startonly.conf b/src/transport/test_transport_startonly.conf deleted file mode 100644 index 164a38f69..000000000 --- a/src/transport/test_transport_startonly.conf +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | @INLINE@ test_transport_defaults.conf | ||
2 | [PATHS] | ||
3 | |||
4 | [transport-tcp] | ||
5 | PORT = 2094 | ||
6 | |||
7 | [transport-udp] | ||
8 | PORT = 2094 | ||
9 | |||
10 | |||
11 | |||