gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r23843 - gnunet/src/testbed


From: gnunet
Subject: [GNUnet-SVN] r23843 - gnunet/src/testbed
Date: Mon, 17 Sep 2012 12:09:11 +0200

Author: harsha
Date: 2012-09-17 12:09:11 +0200 (Mon, 17 Sep 2012)
New Revision: 23843

Modified:
   gnunet/src/testbed/test_testbed_api_2peers_2controllers.c
Log:
checks for working local SSH

Modified: gnunet/src/testbed/test_testbed_api_2peers_2controllers.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_2peers_2controllers.c   2012-09-17 
10:06:58 UTC (rev 23842)
+++ gnunet/src/testbed/test_testbed_api_2peers_2controllers.c   2012-09-17 
10:09:11 UTC (rev 23843)
@@ -593,6 +593,32 @@
   struct GNUNET_GETOPT_CommandLineOption options[] = {
     GNUNET_GETOPT_OPTION_END
   };
+  char *const remote_args[] = {
+    "ssh", "-o", "BatchMode=yes", "127.0.0.1", "echo", "SSH", "works", NULL
+  };
+  struct GNUNET_OS_Process *auxp;
+  enum GNUNET_OS_ProcessStatusType type;
+  unsigned long code;
+
+  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);
+  GNUNET_OS_process_destroy (auxp);
+  if (0 != code)
+  {
+    (void) printf ("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;
+  }
   result = INIT;
   ret =
       GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]