diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-10-17 13:44:57 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-10-17 13:44:57 +0000 |
commit | 47f77cc899c6fc3f5c8f045fa7f879c1282f0422 (patch) | |
tree | 20e910dc9c9cb53104cc6ccd0d9f72ea94e011f3 /src/testbed/gnunet-testbed-profiler.c | |
parent | 76e897b90794cd1cde6b0a2f79c70104ca6c98f5 (diff) | |
download | gnunet-47f77cc899c6fc3f5c8f045fa7f879c1282f0422.tar.gz gnunet-47f77cc899c6fc3f5c8f045fa7f879c1282f0422.zip |
- interactive option to disable waiting on keystroke but wait instead for termination signal
Diffstat (limited to 'src/testbed/gnunet-testbed-profiler.c')
-rw-r--r-- | src/testbed/gnunet-testbed-profiler.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index 5e4678590..f5d7599c3 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c | |||
@@ -97,6 +97,11 @@ static unsigned int failed_links; | |||
97 | */ | 97 | */ |
98 | static int result; | 98 | static int result; |
99 | 99 | ||
100 | /** | ||
101 | * Are we running non interactively | ||
102 | */ | ||
103 | static int noninteractive; | ||
104 | |||
100 | 105 | ||
101 | /** | 106 | /** |
102 | * Shutdown nicely | 107 | * Shutdown nicely |
@@ -225,7 +230,15 @@ test_run (void *cls, | |||
225 | result = GNUNET_OK; | 230 | result = GNUNET_OK; |
226 | fprintf (stdout, "\n"); | 231 | fprintf (stdout, "\n"); |
227 | print_overlay_links_summary (); | 232 | print_overlay_links_summary (); |
228 | #if !ENABLE_SUPERMUC | 233 | if (noninteractive) |
234 | { | ||
235 | GNUNET_SCHEDULER_cancel (abort_task); | ||
236 | abort_task = GNUNET_SCHEDULER_NO_TASK; | ||
237 | shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | ||
238 | &do_shutdown, NULL); | ||
239 | return; | ||
240 | } | ||
241 | #if (!ENABLE_SUPERMUC) | ||
229 | fprintf (stdout, "Testbed running, waiting for keystroke to shut down\n"); | 242 | fprintf (stdout, "Testbed running, waiting for keystroke to shut down\n"); |
230 | fflush (stdout); | 243 | fflush (stdout); |
231 | (void) getc (stdin); | 244 | (void) getc (stdin); |
@@ -233,6 +246,7 @@ test_run (void *cls, | |||
233 | fprintf (stdout, "Shutting down. Please wait\n"); | 246 | fprintf (stdout, "Shutting down. Please wait\n"); |
234 | fflush (stdout); | 247 | fflush (stdout); |
235 | shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); | 248 | shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); |
249 | return; | ||
236 | } | 250 | } |
237 | 251 | ||
238 | 252 | ||
@@ -281,6 +295,12 @@ main (int argc, char *const *argv) | |||
281 | {'e', "num-errors", "COUNT", | 295 | {'e', "num-errors", "COUNT", |
282 | gettext_noop ("tolerate COUNT number of continious timeout failures"), | 296 | gettext_noop ("tolerate COUNT number of continious timeout failures"), |
283 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_cont_fails}, | 297 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_cont_fails}, |
298 | {'n', "non-interactive", NULL, | ||
299 | gettext_noop ("run profiler in non-interactive mode where upon " | ||
300 | "testbed setup the profiler does not wait for a " | ||
301 | "keystroke but continues to run until a termination " | ||
302 | "signal is received"), | ||
303 | GNUNET_NO, &GNUNET_GETOPT_set_one, &noninteractive}, | ||
284 | #if !ENABLE_SUPERMUC | 304 | #if !ENABLE_SUPERMUC |
285 | {'H', "hosts", "FILENAME", | 305 | {'H', "hosts", "FILENAME", |
286 | gettext_noop ("name of the file with the login information for the testbed"), | 306 | gettext_noop ("name of the file with the login information for the testbed"), |