diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-09-17 10:09:11 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-09-17 10:09:11 +0000 |
commit | 4d3927a9af99becb0671e408bb6dab4e5a0242cc (patch) | |
tree | 554e00474110ca84f41c3b3e05377f41ce3653a9 /src/testbed | |
parent | b09c13d067a61102e236add2545b0f1e1097660f (diff) | |
download | gnunet-4d3927a9af99becb0671e408bb6dab4e5a0242cc.tar.gz gnunet-4d3927a9af99becb0671e408bb6dab4e5a0242cc.zip |
checks for working local SSH
Diffstat (limited to 'src/testbed')
-rw-r--r-- | src/testbed/test_testbed_api_2peers_2controllers.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/testbed/test_testbed_api_2peers_2controllers.c b/src/testbed/test_testbed_api_2peers_2controllers.c index e2d894c82..97f425df2 100644 --- a/src/testbed/test_testbed_api_2peers_2controllers.c +++ b/src/testbed/test_testbed_api_2peers_2controllers.c | |||
@@ -593,6 +593,32 @@ main (int argc, char **argv) | |||
593 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 593 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
594 | GNUNET_GETOPT_OPTION_END | 594 | GNUNET_GETOPT_OPTION_END |
595 | }; | 595 | }; |
596 | char *const remote_args[] = { | ||
597 | "ssh", "-o", "BatchMode=yes", "127.0.0.1", "echo", "SSH", "works", NULL | ||
598 | }; | ||
599 | struct GNUNET_OS_Process *auxp; | ||
600 | enum GNUNET_OS_ProcessStatusType type; | ||
601 | unsigned long code; | ||
602 | |||
603 | auxp = | ||
604 | GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ALL, NULL, | ||
605 | NULL, "ssh", remote_args); | ||
606 | GNUNET_assert (NULL != auxp); | ||
607 | do | ||
608 | { | ||
609 | ret = GNUNET_OS_process_status (auxp, &type, &code); | ||
610 | GNUNET_assert (GNUNET_SYSERR != ret); | ||
611 | (void) usleep (300); | ||
612 | } | ||
613 | while (GNUNET_NO == ret); | ||
614 | GNUNET_OS_process_destroy (auxp); | ||
615 | if (0 != code) | ||
616 | { | ||
617 | (void) printf ("Unable to run the test as this system is not configured " | ||
618 | "to use password less SSH logins to localhost.\n" | ||
619 | "Marking test as successful\n"); | ||
620 | return 0; | ||
621 | } | ||
596 | result = INIT; | 622 | result = INIT; |
597 | ret = | 623 | ret = |
598 | GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2, | 624 | GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2, |