diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-08-21 13:46:43 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-08-21 13:46:43 +0000 |
commit | 77463bc3a995cf19a1bfb7512530c29aa1bc80cc (patch) | |
tree | 690c5c7e5ed1cad5e957e928e7ff030559716888 | |
parent | 89080e0fd7f5641fec564a3c1ccc4c4296598122 (diff) | |
download | gnunet-77463bc3a995cf19a1bfb7512530c29aa1bc80cc.tar.gz gnunet-77463bc3a995cf19a1bfb7512530c29aa1bc80cc.zip |
added checks for passwordless ssh login during tests
-rw-r--r-- | src/testbed/Makefile.am | 3 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_controllerlink.c | 24 | ||||
-rw-r--r-- | src/testbed/testbed_api.c | 5 |
3 files changed, 28 insertions, 4 deletions
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am index 0e703750b..22870bd9a 100644 --- a/src/testbed/Makefile.am +++ b/src/testbed/Makefile.am | |||
@@ -81,7 +81,8 @@ if ENABLE_TEST_RUN | |||
81 | test_testbed_api_hosts \ | 81 | test_testbed_api_hosts \ |
82 | test_testbed_api_2peers \ | 82 | test_testbed_api_2peers \ |
83 | test_testbed_api_operations \ | 83 | test_testbed_api_operations \ |
84 | test_gnunet_testbed_helper | 84 | test_gnunet_testbed_helper \ |
85 | test_testbed_api_controllerlink | ||
85 | endif | 86 | endif |
86 | 87 | ||
87 | test_testbed_api_hosts_SOURCES = \ | 88 | test_testbed_api_hosts_SOURCES = \ |
diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c index d002da7f2..70f6fa846 100644 --- a/src/testbed/test_testbed_api_controllerlink.c +++ b/src/testbed/test_testbed_api_controllerlink.c | |||
@@ -330,7 +330,6 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
330 | int main (int argc, char **argv) | 330 | int main (int argc, char **argv) |
331 | { | 331 | { |
332 | int ret; | 332 | int ret; |
333 | |||
334 | char *const argv2[] = { "test_testbed_api_controllerlink", | 333 | char *const argv2[] = { "test_testbed_api_controllerlink", |
335 | "-c", "test_testbed_api.conf", | 334 | "-c", "test_testbed_api.conf", |
336 | NULL | 335 | NULL |
@@ -338,6 +337,29 @@ int main (int argc, char **argv) | |||
338 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 337 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
339 | GNUNET_GETOPT_OPTION_END | 338 | GNUNET_GETOPT_OPTION_END |
340 | }; | 339 | }; |
340 | char *const remote_args[] = { | ||
341 | "ssh", "-o", "BatchMode=yes", "127.0.0.1", "echo", "Hello", "World", NULL | ||
342 | }; | ||
343 | struct GNUNET_OS_Process *auxp; | ||
344 | enum GNUNET_OS_ProcessStatusType type; | ||
345 | unsigned long code; | ||
346 | |||
347 | auxp = GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ALL, | ||
348 | NULL, NULL, "ssh", remote_args); | ||
349 | GNUNET_assert (NULL != auxp); | ||
350 | do | ||
351 | { | ||
352 | ret = GNUNET_OS_process_status (auxp, &type, &code); | ||
353 | GNUNET_assert (GNUNET_SYSERR != ret); | ||
354 | (void) usleep (300); | ||
355 | } while (GNUNET_NO == ret); | ||
356 | if (0 != code) | ||
357 | { | ||
358 | (void) printf ("Unable to run the test as this system is not configured " | ||
359 | "to use password less SSH logins to localhost.\n" | ||
360 | "Marking test as successful\n"); | ||
361 | return 0; | ||
362 | } | ||
341 | result = INIT; | 363 | result = INIT; |
342 | ret = GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2, | 364 | ret = GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2, |
343 | "test_testbed_api_controllerlink", "nohelp", options, &run, | 365 | "test_testbed_api_controllerlink", "nohelp", options, &run, |
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 01abc97a8..213e5542b 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -888,8 +888,9 @@ struct GNUNET_TESTBED_ControllerProc | |||
888 | * | 888 | * |
889 | * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing | 889 | * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing |
890 | */ | 890 | */ |
891 | static int helper_mst (void *cls, void *client, | 891 | static int |
892 | const struct GNUNET_MessageHeader *message) | 892 | helper_mst (void *cls, void *client, |
893 | const struct GNUNET_MessageHeader *message) | ||
893 | { | 894 | { |
894 | struct GNUNET_TESTBED_ControllerProc *cp = cls; | 895 | struct GNUNET_TESTBED_ControllerProc *cp = cls; |
895 | const struct GNUNET_TESTBED_HelperReply *msg; | 896 | const struct GNUNET_TESTBED_HelperReply *msg; |