diff options
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/gnunet-testing-run-service.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/testing/gnunet-testing-run-service.c b/src/testing/gnunet-testing-run-service.c index cbd4763c5..988b67e4f 100644 --- a/src/testing/gnunet-testing-run-service.c +++ b/src/testing/gnunet-testing-run-service.c | |||
@@ -28,8 +28,8 @@ | |||
28 | * Outputs the path to the temporary configuration file to stdout. | 28 | * Outputs the path to the temporary configuration file to stdout. |
29 | * | 29 | * |
30 | * The peer will run until this program is killed, | 30 | * The peer will run until this program is killed, |
31 | * or stdin is closed. When reading the character 'r' from stdin, the running service is | 31 | * or stdin is closed. When reading the character 'r' from stdin, |
32 | * restarted with the same configuration. | 32 | * the running service is restarted with the same configuration. |
33 | * | 33 | * |
34 | * This executable is intended to be used by gnunet-java, in order to reliably | 34 | * This executable is intended to be used by gnunet-java, in order to reliably |
35 | * start and stop services for test cases. | 35 | * start and stop services for test cases. |
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | 44 | ||
45 | /** | 45 | /** |
46 | * FIXME | 46 | * File handle to STDIN, for reading restart/quit commands. |
47 | */ | 47 | */ |
48 | static struct GNUNET_DISK_FileHandle *fh; | 48 | static struct GNUNET_DISK_FileHandle *fh; |
49 | 49 | ||
@@ -129,7 +129,8 @@ stdin_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
129 | fprintf (stderr, _("Unknown command, use 'q' to quit or 'r' to restart peer\n")); | 129 | fprintf (stderr, _("Unknown command, use 'q' to quit or 'r' to restart peer\n")); |
130 | break; | 130 | break; |
131 | } | 131 | } |
132 | tid = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, fh, &stdin_cb, NULL); | 132 | tid = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, fh, |
133 | &stdin_cb, NULL); | ||
133 | } | 134 | } |
134 | 135 | ||
135 | 136 | ||
@@ -153,16 +154,18 @@ testing_main (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
153 | return; | 154 | return; |
154 | } | 155 | } |
155 | if (GNUNET_SYSERR == | 156 | if (GNUNET_SYSERR == |
156 | GNUNET_CONFIGURATION_write ((struct GNUNET_CONFIGURATION_Handle *) cfg, tmpfilename)) | 157 | GNUNET_CONFIGURATION_write ((struct GNUNET_CONFIGURATION_Handle *) cfg, |
158 | tmpfilename)) | ||
157 | { | 159 | { |
158 | GNUNET_break (0); | 160 | GNUNET_break (0); |
159 | return; | 161 | return; |
160 | } | 162 | } |
161 | printf("%s\n", tmpfilename); | 163 | printf("ok\n%s\n", tmpfilename); |
162 | fflush(stdout); | 164 | fflush(stdout); |
163 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, NULL); | 165 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, NULL); |
164 | fh = GNUNET_DISK_get_handle_from_native (stdin); | 166 | fh = GNUNET_DISK_get_handle_from_native (stdin); |
165 | tid = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, fh, &stdin_cb, NULL); | 167 | tid = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, fh, |
168 | &stdin_cb, NULL); | ||
166 | } | 169 | } |
167 | 170 | ||
168 | 171 | ||
@@ -180,7 +183,7 @@ main (int argc, char *const *argv) | |||
180 | static char *srv_name; | 183 | static char *srv_name; |
181 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 184 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
182 | {'c', "config", "FILENAME", | 185 | {'c', "config", "FILENAME", |
183 | gettext_noop ("name of the configuration file to use"), 1, | 186 | gettext_noop ("name of the template configuration file to use (optional)"), 1, |
184 | &GNUNET_GETOPT_set_string, &cfg_name}, | 187 | &GNUNET_GETOPT_set_string, &cfg_name}, |
185 | {'s', "service", "SERVICE", | 188 | {'s', "service", "SERVICE", |
186 | gettext_noop ("name of the service to run"), 1, | 189 | gettext_noop ("name of the service to run"), 1, |