gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r24103 - gnunet/src/regex


From: gnunet
Subject: [GNUnet-SVN] r24103 - gnunet/src/regex
Date: Fri, 28 Sep 2012 15:27:33 +0200

Author: bartpolot
Date: 2012-09-28 15:27:32 +0200 (Fri, 28 Sep 2012)
New Revision: 24103

Modified:
   gnunet/src/regex/test_regex_big.c
Log:
- WiP

Modified: gnunet/src/regex/test_regex_big.c
===================================================================
--- gnunet/src/regex/test_regex_big.c   2012-09-28 13:06:08 UTC (rev 24102)
+++ gnunet/src/regex/test_regex_big.c   2012-09-28 13:27:32 UTC (rev 24103)
@@ -111,7 +111,11 @@
   /**
    * Connecting to slave controller
    */
-  LINKING
+  LINKING,
+
+  CREATING_PEER,
+
+  STARTING_PEER,
 };
 
 
@@ -448,12 +452,14 @@
   long i = (long) cls;
   long peer_id;
 
-  GNUNET_TESTBED_operation_done(op[i]);
+//   GNUNET_TESTBED_operation_done(op[i]);
   peer_id = i; // FIXME  A * i + B
   peers[peer_id] = peer;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Peer created\n");
   op[i] = GNUNET_TESTBED_peer_start (peer, peer_start_cb, (void *) i);
 }
 
+
 /**
  * Signature of the event handler function called by the
  * respective event controller.
@@ -490,14 +496,18 @@
     {
       case INIT:
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  Init\n");
+        break;
+      case LINKING:
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  Link\n");
+        state[i] = CREATING_PEER;
         op[i] = GNUNET_TESTBED_peer_create (master_ctrl,
                                             slave_hosts[i],
                                             cfg,
                                             peer_create_cb,
                                             (void *) i);
         break;
-      case LINKING:
-        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  Link\n");
+      case CREATING_PEER:
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  Peer create\n");
         break;
       default:
         GNUNET_break (0);
@@ -560,6 +570,9 @@
 {
   unsigned int i;
 
+  if (NULL == config)
+    return;
+
   event_mask = 0;
   event_mask |= (1L << GNUNET_TESTBED_ET_PEER_START);
   event_mask |= (1L << GNUNET_TESTBED_ET_PEER_STOP);
@@ -620,6 +633,7 @@
 int main (int argc, char **argv)
 {
   int ret;
+  int test_hosts;
   unsigned int i;
 
   struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -630,15 +644,18 @@
     NULL
   };
 
+  test_hosts = GNUNET_OK;
   for (i = 0; i < NUM_HOSTS; i++)
   {
     char *const remote_args[] = {
-      "ssh", "-o", "BatchMode=yes", slave_ips[i], "echo", "Hello", "World", 
NULL
+      "ssh", "-o", "BatchMode=yes", slave_ips[i],
+      ". .bashrc; gnunet-helper-testbed --help > /dev/null", NULL
     };
     struct GNUNET_OS_Process *auxp;
     enum GNUNET_OS_ProcessStatusType type;
     unsigned long code;
 
+    fprintf (stderr, "Testing host %i\n", i);
     auxp =
       GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ALL, NULL,
                                  NULL, "ssh", remote_args);
@@ -654,12 +671,19 @@
     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 host %s.\n"
-                    "Marking test as successful\n", slave_ips[i]);
-      return 0;
+      fprintf (stderr,
+               "Unable to run the test as this system is not configured "
+               "to use password less SSH logins to host %s.\n",
+               slave_ips[i]);
+      test_hosts = GNUNET_SYSERR;
     }
   }
+  if (test_hosts != GNUNET_OK)
+  {
+    fprintf (stderr, "Some hosts have failed the ssh check. Exiting.\n");
+    return 1;
+  }
+  fprintf (stderr, "START.\n");
 
   result = GNUNET_SYSERR;
 
@@ -668,7 +692,9 @@
                           "test_regex_big", "nohelp", options,
                           &run, NULL);
 
-  if (GNUNET_SYSERR == result || 0 != ret)
+  fprintf (stderr, "END.\n");
+
+  if (GNUNET_SYSERR == result || GNUNET_OK != ret)
     return 1;
   return 0;
 }




reply via email to

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