From cadcd8f0f6b3f7b9d22c8a39bf860419a75544d4 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Fri, 7 May 2010 12:15:13 +0000 Subject: [PATCH] --- src/transport/test_plugin_transport_http.c | 27 +++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/transport/test_plugin_transport_http.c b/src/transport/test_plugin_transport_http.c index 0ce1766c9..35666ece1 100644 --- a/src/transport/test_plugin_transport_http.c +++ b/src/transport/test_plugin_transport_http.c @@ -110,6 +110,8 @@ static unsigned int timeout_count; */ static int fail; +pid_t pid; + /** * Initialize Environment for this plugin */ @@ -242,7 +244,6 @@ main (int argc, char *const *argv) 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 @@ main (int argc, char *const *argv) "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 */ -- 2.25.1