aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_plugin_cmd_udp_backchannel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/test_transport_plugin_cmd_udp_backchannel.c')
-rw-r--r--src/transport/test_transport_plugin_cmd_udp_backchannel.c39
1 files changed, 4 insertions, 35 deletions
diff --git a/src/transport/test_transport_plugin_cmd_udp_backchannel.c b/src/transport/test_transport_plugin_cmd_udp_backchannel.c
index 537832e61..87065e340 100644
--- a/src/transport/test_transport_plugin_cmd_udp_backchannel.c
+++ b/src/transport/test_transport_plugin_cmd_udp_backchannel.c
@@ -40,32 +40,6 @@
40 40
41#define TOPOLOGY_CONFIG "test_transport_udp_backchannel_topo.conf" 41#define TOPOLOGY_CONFIG "test_transport_udp_backchannel_topo.conf"
42 42
43struct TestState
44{
45 /**
46 * Callback to write messages to the master loop.
47 *
48 */
49 TESTING_CMD_HELPER_write_cb write_message;
50
51 /**
52 * The name for a specific test environment directory.
53 *
54 */
55 char *testdir;
56
57 /**
58 * The name for the configuration file of the specific node.
59 *
60 */
61 char *cfgname;
62
63 /**
64 * The complete topology information.
65 */
66 struct GNUNET_TESTING_NetjailTopology *topology;
67};
68
69static struct GNUNET_TESTING_Command block_send; 43static struct GNUNET_TESTING_Command block_send;
70 44
71static struct GNUNET_TESTING_Command connect_peers; 45static struct GNUNET_TESTING_Command connect_peers;
@@ -136,18 +110,12 @@ handle_result (void *cls,
136 enum GNUNET_GenericReturnValue rv) 110 enum GNUNET_GenericReturnValue rv)
137{ 111{
138 struct TestState *ts = cls; 112 struct TestState *ts = cls;
139 struct GNUNET_MessageHeader *reply;
140 113
141 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 114 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
142 "Local test exits with status %d\n", 115 "Local test exits with status %d\n",
143 rv); 116 rv);
144 reply = GNUNET_TESTING_send_local_test_finished_msg (rv);
145
146 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
147 "message prepared\n");
148 ts->write_message (reply,
149 ntohs (reply->size));
150 117
118 ts->finished_cb ();
151 GNUNET_free (ts->testdir); 119 GNUNET_free (ts->testdir);
152 GNUNET_free (ts->cfgname); 120 GNUNET_free (ts->cfgname);
153 GNUNET_TESTING_free_topology (ts->topology); 121 GNUNET_TESTING_free_topology (ts->topology);
@@ -209,7 +177,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip,
209 char *n, 177 char *n,
210 char *local_m, 178 char *local_m,
211 char *topology_data, 179 char *topology_data,
212 unsigned int *read_file) 180 unsigned int *read_file,
181 TESTING_CMD_HELPER_finish_cb finished_cb)
213{ 182{
214 183
215 unsigned int n_int; 184 unsigned int n_int;
@@ -217,9 +186,9 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip,
217 unsigned int local_m_int; 186 unsigned int local_m_int;
218 unsigned int num; 187 unsigned int num;
219 struct TestState *ts = GNUNET_new (struct TestState); 188 struct TestState *ts = GNUNET_new (struct TestState);
220
221 struct GNUNET_TESTING_NetjailTopology *topology; 189 struct GNUNET_TESTING_NetjailTopology *topology;
222 190
191 ts->finished_cb = finished_cb;
223 if (GNUNET_YES == *read_file) 192 if (GNUNET_YES == *read_file)
224 topology = GNUNET_TESTING_get_topo_from_file (topology_data); 193 topology = GNUNET_TESTING_get_topo_from_file (topology_data);
225 else 194 else