gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11255 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r11255 - gnunet/src/transport
Date: Fri, 7 May 2010 14:15:13 +0200

Author: wachs
Date: 2010-05-07 14:15:13 +0200 (Fri, 07 May 2010)
New Revision: 11255

Modified:
   gnunet/src/transport/test_plugin_transport_http.c
Log:


Modified: gnunet/src/transport/test_plugin_transport_http.c
===================================================================
--- gnunet/src/transport/test_plugin_transport_http.c   2010-05-07 12:03:55 UTC 
(rev 11254)
+++ gnunet/src/transport/test_plugin_transport_http.c   2010-05-07 12:15:13 UTC 
(rev 11255)
@@ -110,6 +110,8 @@
  */
 static int fail;
 
+pid_t pid;
+
 /**
  * Initialize Environment for this plugin
  */
@@ -242,7 +244,6 @@
   static struct GNUNET_GETOPT_CommandLineOption options[] = {
     GNUNET_GETOPT_OPTION_END
   };
-  int ret;
   char *const argv_prog[] = {
     "test_plugin_transport_http",
     "-c",
@@ -262,14 +263,34 @@
                     "WARNING",
 #endif
                     NULL);
-  ret = (GNUNET_OK ==
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting statistics service\n");
+  pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
+                                 "gnunet-service-statistics",
+                                 "-L", "DEBUG",
+                                 "-c", "test_plugin_transport_data_http.conf", 
NULL);
+
+  fail = GNUNET_YES;
+  if (pid==-1 )
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Failed to start statistics 
service\n");
+    return fail;
+  }
+
+  fail = (GNUNET_OK ==
          GNUNET_PROGRAM_run (5,
                              argv_prog,
                              "test_plugin_transport_http",
                              "testcase", options, &run, NULL)) ? GNUNET_YES : 
1;
   GNUNET_DISK_directory_remove ("/tmp/test_plugin_transport_http");
 
-  return GNUNET_NO;
+
+  if (0 != PLIBC_KILL (pid, SIGTERM))
+  {
+    GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "Failed to kill statistics 
service");
+    fail = GNUNET_YES;
+  }
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Killed statistics service\n");
+  return fail;
 }
 
 /* end of test_plugin_transport_http.c */





reply via email to

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