aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_netjail_stop_testsystem.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-10-04 12:15:43 +0200
committerChristian Grothoff <christian@grothoff.org>2021-10-04 12:15:43 +0200
commitf146e80752e73247acb9d6c7463188a82d26a774 (patch)
tree13ed03d817ce04daa133507778ac6a1b71bf147f /src/testing/testing_api_cmd_netjail_stop_testsystem.c
parent7ecc3a03a0670a1620c603502c9958b95e6dc1d0 (diff)
downloadgnunet-f146e80752e73247acb9d6c7463188a82d26a774.tar.gz
gnunet-f146e80752e73247acb9d6c7463188a82d26a774.zip
-taking a first stab at cleaning up the testing mess
Diffstat (limited to 'src/testing/testing_api_cmd_netjail_stop_testsystem.c')
-rw-r--r--src/testing/testing_api_cmd_netjail_stop_testsystem.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/testing/testing_api_cmd_netjail_stop_testsystem.c b/src/testing/testing_api_cmd_netjail_stop_testsystem.c
index 0ae82a26a..04b0e4e94 100644
--- a/src/testing/testing_api_cmd_netjail_stop_testsystem.c
+++ b/src/testing/testing_api_cmd_netjail_stop_testsystem.c
@@ -55,10 +55,8 @@ struct StopHelperState
55* @param cmd current CMD being cleaned up. 55* @param cmd current CMD being cleaned up.
56*/ 56*/
57static void 57static void
58stop_testing_system_cleanup (void *cls, 58stop_testing_system_cleanup (void *cls)
59 const struct GNUNET_TESTING_Command *cmd)
60{ 59{
61
62} 60}
63 61
64 62
@@ -66,13 +64,13 @@ stop_testing_system_cleanup (void *cls,
66 * Trait function of this cmd does nothing. 64 * Trait function of this cmd does nothing.
67 * 65 *
68 */ 66 */
69static int 67static enum GNUNET_GenericReturnValue
70stop_testing_system_traits (void *cls, 68stop_testing_system_traits (void *cls,
71 const void **ret, 69 const void **ret,
72 const char *trait, 70 const char *trait,
73 unsigned int index) 71 unsigned int index)
74{ 72{
75 return GNUNET_OK; 73 return GNUNET_NO;
76} 74}
77 75
78 76
@@ -80,12 +78,10 @@ stop_testing_system_traits (void *cls,
80* This function stops the helper process for each node. 78* This function stops the helper process for each node.
81* 79*
82* @param cls closure. 80* @param cls closure.
83* @param cmd CMD being run.
84* @param is interpreter state. 81* @param is interpreter state.
85*/ 82*/
86static void 83static void
87stop_testing_system_run (void *cls, 84stop_testing_system_run (void *cls,
88 const struct GNUNET_TESTING_Command *cmd,
89 struct GNUNET_TESTING_Interpreter *is) 85 struct GNUNET_TESTING_Interpreter *is)
90{ 86{
91 struct StopHelperState *shs = cls; 87 struct StopHelperState *shs = cls;
@@ -93,6 +89,7 @@ stop_testing_system_run (void *cls,
93 const struct GNUNET_TESTING_Command *start_helper_cmd; 89 const struct GNUNET_TESTING_Command *start_helper_cmd;
94 90
95 start_helper_cmd = GNUNET_TESTING_interpreter_lookup_command ( 91 start_helper_cmd = GNUNET_TESTING_interpreter_lookup_command (
92 is,
96 shs->helper_start_label); 93 shs->helper_start_label);
97 GNUNET_TESTING_get_trait_helper_handles (start_helper_cmd, 94 GNUNET_TESTING_get_trait_helper_handles (start_helper_cmd,
98 &helper); 95 &helper);
@@ -121,8 +118,7 @@ struct GNUNET_TESTING_Command
121GNUNET_TESTING_cmd_stop_testing_system (const char *label, 118GNUNET_TESTING_cmd_stop_testing_system (const char *label,
122 const char *helper_start_label, 119 const char *helper_start_label,
123 char *local_m, 120 char *local_m,
124 char *global_n 121 char *global_n)
125 )
126{ 122{
127 struct StopHelperState *shs; 123 struct StopHelperState *shs;
128 124
@@ -130,14 +126,15 @@ GNUNET_TESTING_cmd_stop_testing_system (const char *label,
130 shs->helper_start_label = helper_start_label; 126 shs->helper_start_label = helper_start_label;
131 shs->local_m = local_m; 127 shs->local_m = local_m;
132 shs->global_n = global_n; 128 shs->global_n = global_n;
133 129 {
134 struct GNUNET_TESTING_Command cmd = { 130 struct GNUNET_TESTING_Command cmd = {
135 .cls = shs, 131 .cls = shs,
136 .label = label, 132 .label = label,
137 .run = &stop_testing_system_run, 133 .run = &stop_testing_system_run,
138 .cleanup = &stop_testing_system_cleanup, 134 .cleanup = &stop_testing_system_cleanup,
139 .traits = &stop_testing_system_traits 135 .traits = &stop_testing_system_traits
140 }; 136 };
141 137
142 return cmd; 138 return cmd;
139 }
143} 140}