aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_netjail_stop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_netjail_stop.c')
-rw-r--r--src/testing/testing_api_cmd_netjail_stop.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/src/testing/testing_api_cmd_netjail_stop.c b/src/testing/testing_api_cmd_netjail_stop.c
index 99084d9af..c93e5cca3 100644
--- a/src/testing/testing_api_cmd_netjail_stop.c
+++ b/src/testing/testing_api_cmd_netjail_stop.c
@@ -19,7 +19,7 @@
19 */ 19 */
20 20
21/** 21/**
22 * @file testing/testing_api_cmd_hello_world.c 22 * @file testing/testing_api_cmd_netjail_stop.c
23 * @brief Command to stop the netjail script. 23 * @brief Command to stop the netjail script.
24 * @author t3sserakt 24 * @author t3sserakt
25 */ 25 */
@@ -60,8 +60,7 @@ struct NetJailState
60 * 60 *
61 */ 61 */
62static void 62static void
63netjail_stop_cleanup (void *cls, 63netjail_stop_cleanup (void *cls)
64 const struct GNUNET_TESTING_Command *cmd)
65{ 64{
66 struct NetJailState *ns = cls; 65 struct NetJailState *ns = cls;
67 66
@@ -87,13 +86,13 @@ netjail_stop_cleanup (void *cls,
87 * Trait function of this cmd does nothing. 86 * Trait function of this cmd does nothing.
88 * 87 *
89 */ 88 */
90static int 89static enum GNUNET_GenericReturnValue
91netjail_stop_traits (void *cls, 90netjail_stop_traits (void *cls,
92 const void **ret, 91 const void **ret,
93 const char *trait, 92 const char *trait,
94 unsigned int index) 93 unsigned int index)
95{ 94{
96 return GNUNET_OK; 95 return GNUNET_NO;
97} 96}
98 97
99 98
@@ -131,14 +130,15 @@ child_completed_callback (void *cls,
131*/ 130*/
132static void 131static void
133netjail_stop_run (void *cls, 132netjail_stop_run (void *cls,
134 const struct GNUNET_TESTING_Command *cmd,
135 struct GNUNET_TESTING_Interpreter *is) 133 struct GNUNET_TESTING_Interpreter *is)
136{ 134{
137 struct NetJailState *ns = cls; 135 struct NetJailState *ns = cls;
138 char *const script_argv[] = {NETJAIL_STOP_SCRIPT, 136 char *const script_argv[] = {
139 ns->local_m, 137 NETJAIL_STOP_SCRIPT,
140 ns->global_n, 138 ns->local_m,
141 NULL}; 139 ns->global_n,
140 NULL
141 };
142 unsigned int helper_check = GNUNET_OS_check_helper_binary ( 142 unsigned int helper_check = GNUNET_OS_check_helper_binary (
143 NETJAIL_STOP_SCRIPT, 143 NETJAIL_STOP_SCRIPT,
144 GNUNET_YES, 144 GNUNET_YES,
@@ -149,14 +149,14 @@ netjail_stop_run (void *cls,
149 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 149 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
150 "No SUID for %s!\n", 150 "No SUID for %s!\n",
151 NETJAIL_STOP_SCRIPT); 151 NETJAIL_STOP_SCRIPT);
152 GNUNET_TESTING_interpreter_fail (); 152 GNUNET_TESTING_interpreter_fail (is);
153 } 153 }
154 else if (GNUNET_NO == helper_check) 154 else if (GNUNET_NO == helper_check)
155 { 155 {
156 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 156 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
157 "%s not found!\n", 157 "%s not found!\n",
158 NETJAIL_STOP_SCRIPT); 158 NETJAIL_STOP_SCRIPT);
159 GNUNET_TESTING_interpreter_fail (); 159 GNUNET_TESTING_interpreter_fail (is);
160 } 160 }
161 161
162 ns->stop_proc = GNUNET_OS_start_process_vap (GNUNET_OS_INHERIT_STD_ERR, 162 ns->stop_proc = GNUNET_OS_start_process_vap (GNUNET_OS_INHERIT_STD_ERR,
@@ -178,7 +178,7 @@ netjail_stop_run (void *cls,
178 * This function checks the flag NetJailState#finished, if this cmd finished. 178 * This function checks the flag NetJailState#finished, if this cmd finished.
179 * 179 *
180 */ 180 */
181static int 181static enum GNUNET_GenericReturnValue
182netjail_stop_finish (void *cls, 182netjail_stop_finish (void *cls,
183 GNUNET_SCHEDULER_TaskCallback cont, 183 GNUNET_SCHEDULER_TaskCallback cont,
184 void *cont_cls) 184 void *cont_cls)
@@ -211,15 +211,16 @@ GNUNET_TESTING_cmd_netjail_stop (const char *label,
211 ns = GNUNET_new (struct NetJailState); 211 ns = GNUNET_new (struct NetJailState);
212 ns->local_m = local_m; 212 ns->local_m = local_m;
213 ns->global_n = global_n; 213 ns->global_n = global_n;
214 214 {
215 struct GNUNET_TESTING_Command cmd = { 215 struct GNUNET_TESTING_Command cmd = {
216 .cls = ns, 216 .cls = ns,
217 .label = label, 217 .label = label,
218 .run = &netjail_stop_run, 218 .run = &netjail_stop_run,
219 .finish = &netjail_stop_finish, 219 .finish = &netjail_stop_finish,
220 .cleanup = &netjail_stop_cleanup, 220 .cleanup = &netjail_stop_cleanup,
221 .traits = &netjail_stop_traits 221 .traits = &netjail_stop_traits
222 }; 222 };
223 223
224 return cmd; 224 return cmd;
225 }
225} 226}