diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-11-28 13:50:10 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-11-28 13:50:10 +0000 |
commit | 55c7cc4ce969d597387090d2221ae495f943c152 (patch) | |
tree | 5f6db8ba930a2b5e3c3f840e1896a59b5ba66bb5 /src/sysmon | |
parent | e941bd05a62f3e2d53d36beafbaf2eca3f39cc3b (diff) | |
download | gnunet-55c7cc4ce969d597387090d2221ae495f943c152.tar.gz gnunet-55c7cc4ce969d597387090d2221ae495f943c152.zip |
add a test for glibtop
Diffstat (limited to 'src/sysmon')
-rw-r--r-- | src/sysmon/Makefile.am | 14 | ||||
-rw-r--r-- | src/sysmon/gnunet-daemon-sysmon.c | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/sysmon/Makefile.am b/src/sysmon/Makefile.am index 4fed26a3e..4c4cb1a5b 100644 --- a/src/sysmon/Makefile.am +++ b/src/sysmon/Makefile.am | |||
@@ -1,4 +1,4 @@ | |||
1 | INCLUDES = -I$(top_srcdir)/src/include | 1 | INCLUDES = -I$(top_srcdir)/src/include -I/usr/include/glib-2.0 -I/usr/include -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ -I/usr/include/libgtop-2.0/ |
2 | 2 | ||
3 | pkgcfgdir= $(pkgdatadir)/config.d/ | 3 | pkgcfgdir= $(pkgdatadir)/config.d/ |
4 | 4 | ||
@@ -18,6 +18,9 @@ endif | |||
18 | libexec_PROGRAMS = \ | 18 | libexec_PROGRAMS = \ |
19 | gnunet_daemon_sysmon | 19 | gnunet_daemon_sysmon |
20 | 20 | ||
21 | check_PROGRAMS = \ | ||
22 | test_glibtop | ||
23 | |||
21 | gnunet_daemon_sysmon_SOURCES = \ | 24 | gnunet_daemon_sysmon_SOURCES = \ |
22 | gnunet-daemon-sysmon.c | 25 | gnunet-daemon-sysmon.c |
23 | gnunet_daemon_sysmon_LDADD = \ | 26 | gnunet_daemon_sysmon_LDADD = \ |
@@ -25,6 +28,15 @@ gnunet_daemon_sysmon_LDADD = \ | |||
25 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 28 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
26 | $(GN_LIBINTL) | 29 | $(GN_LIBINTL) |
27 | 30 | ||
31 | test_glibtop_SOURCES = \ | ||
32 | test_glibtop.c | ||
33 | test_glibtop_LDADD = \ | ||
34 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
35 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | ||
36 | -lgtop-2.0 \ | ||
37 | $(GN_LIBINTL) | ||
38 | |||
39 | |||
28 | if ENABLE_TEST_RUN | 40 | if ENABLE_TEST_RUN |
29 | TESTS = $(check_PROGRAMS) | 41 | TESTS = $(check_PROGRAMS) |
30 | endif | 42 | endif |
diff --git a/src/sysmon/gnunet-daemon-sysmon.c b/src/sysmon/gnunet-daemon-sysmon.c index 4926a3c1d..387c4bd2e 100644 --- a/src/sysmon/gnunet-daemon-sysmon.c +++ b/src/sysmon/gnunet-daemon-sysmon.c | |||
@@ -224,6 +224,7 @@ static void | |||
224 | exec_cmd_proc (void *cls, const char *line) | 224 | exec_cmd_proc (void *cls, const char *line) |
225 | { | 225 | { |
226 | struct SysmonProperty *sp = cls; | 226 | struct SysmonProperty *sp = cls; |
227 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Property output: `%s'\n", line); | ||
227 | if (NULL == line) | 228 | if (NULL == line) |
228 | { | 229 | { |
229 | GNUNET_OS_command_stop (sp->cmd_exec_handle); | 230 | GNUNET_OS_command_stop (sp->cmd_exec_handle); |
@@ -264,6 +265,7 @@ exec_cmd (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
264 | sp->cmd_exec_handle = NULL; | 265 | sp->cmd_exec_handle = NULL; |
265 | GNUNET_break (0); | 266 | GNUNET_break (0); |
266 | } | 267 | } |
268 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Property `%s': command `%s' `%s'\n", sp->desc, sp->cmd, sp->cmd_args); | ||
267 | if (NULL == (sp->cmd_exec_handle = GNUNET_OS_command_run (&exec_cmd_proc, sp, | 269 | if (NULL == (sp->cmd_exec_handle = GNUNET_OS_command_run (&exec_cmd_proc, sp, |
268 | GNUNET_TIME_UNIT_SECONDS, | 270 | GNUNET_TIME_UNIT_SECONDS, |
269 | sp->cmd, sp->cmd, | 271 | sp->cmd, sp->cmd, |