aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/test_testbed_api_controllerlink.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-10-31 09:15:05 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-10-31 09:15:05 +0000
commitf2ac1a162054f0f7646b35d3a03d623c58a24c20 (patch)
tree55b60da9bd2080693e6ac4d138bfc7c491fec645 /src/testbed/test_testbed_api_controllerlink.c
parent0a0036407218d7f9588d2b6b796b2a6f779bf700 (diff)
locate helpers in libexec
Diffstat (limited to 'src/testbed/test_testbed_api_controllerlink.c')
-rw-r--r--src/testbed/test_testbed_api_controllerlink.c59
1 files changed, 10 insertions, 49 deletions
diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c
index abde651664..471fb8630d 100644
--- a/src/testbed/test_testbed_api_controllerlink.c
+++ b/src/testbed/test_testbed_api_controllerlink.c
@@ -633,6 +633,16 @@ run (void *cls, char *const *args, const char *cfgfile,
{
host = GNUNET_TESTBED_host_create (NULL, NULL, 0);
GNUNET_assert (NULL != host);
+ if (GNUNET_YES != GNUNET_TESTBED_is_host_habitable (host, config))
+ {
+ GNUNET_TESTBED_host_destroy (host);
+ host = NULL;
+ (void) PRINTF ("%s",
+ "Unable to run the test as this system is not configured "
+ "to use password less SSH logins to localhost.\n"
+ "Marking test as successful\n");
+ return;
+ }
cfg = GNUNET_CONFIGURATION_dup (config);
cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb,
NULL);
@@ -644,46 +654,6 @@ run (void *cls, char *const *args, const char *cfgfile,
/**
- * Function to check if
- * 1. Password-less SSH logins to given ip work
- * 2. gnunet-helper-testbed is found on the PATH on the remote side
- *
- * @param host_str numeric representation of the host's ip
- * @return GNUNET_YES if password-less SSH login to the given host works;
- * GNUNET_NO if not
- */
-static int
-check_ssh (char *host_str)
-{
- char *const remote_args[] = {
- "ssh", "-o", "BatchMode=yes", "-o", "CheckHostIP=no",
- "-o", "NoHostAuthenticationForLocalhost=yes", "-q",
- host_str, "which", "gnunet-helper-testbed", NULL
- };
- // FIXME: the above no longer works with libexec/-installation!
- struct GNUNET_OS_Process *auxp;
- enum GNUNET_OS_ProcessStatusType type;
- unsigned long code;
- int ret;
-
- auxp =
- GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ALL, NULL,
- NULL, "ssh", remote_args);
- GNUNET_assert (NULL != auxp);
- do
- {
- ret = GNUNET_OS_process_status (auxp, &type, &code);
- GNUNET_assert (GNUNET_SYSERR != ret);
- (void) usleep (300);
- }
- while (GNUNET_NO == ret);
- (void) GNUNET_OS_process_wait (auxp);
- GNUNET_OS_process_destroy (auxp);
- return (0 != code) ? GNUNET_NO : GNUNET_YES;
-}
-
-
-/**
* Main function
*/
int
@@ -698,8 +668,6 @@ main (int argc, char **argv)
};
int ret;
- if (GNUNET_YES != check_ssh ("127.0.0.1"))
- goto error_exit;
result = INIT;
ret =
GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2,
@@ -708,13 +676,6 @@ main (int argc, char **argv)
if ((GNUNET_OK != ret) || (SLAVE3_LINK_SUCCESS != result))
return 1;
return 0;
-
- error_exit:
- (void) PRINTF ("%s",
- "Unable to run the test as this system is not configured "
- "to use password less SSH logins to localhost.\n"
- "Marking test as successful\n");
- return 0;
}
/* end of test_testbed_api_controllerlink.c */