From 26401f030b51e8f6e7f03bb2cb7e9b2337ac61af Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 9 Oct 2013 14:06:18 -0400 Subject: [PATCH] tests: health check: OK if consumerd is not running Signed-off-by: Mathieu Desnoyers --- tests/regression/tools/health/health_check.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/regression/tools/health/health_check.c b/tests/regression/tools/health/health_check.c index 22cbcf12d..fbf45c813 100644 --- a/tests/regression/tools/health/health_check.c +++ b/tests/regression/tools/health/health_check.c @@ -24,12 +24,16 @@ static const char *relayd_path; static -int check_component(struct lttng_health *lh, const char *component_name) +int check_component(struct lttng_health *lh, const char *component_name, + int ok_if_not_running) { const struct lttng_health_thread *thread; int nr_threads, i, status; if (lttng_health_query(lh)) { + if (ok_if_not_running) { + return 0; + } fprintf(stderr, "Error querying %s health\n", component_name); return -1; @@ -78,7 +82,7 @@ int check_sessiond(void) return -1; } - status = check_component(lh, "sessiond"); + status = check_component(lh, "sessiond", 0); lttng_health_destroy(lh); @@ -102,7 +106,7 @@ int check_consumerd(enum lttng_health_consumerd hc) return -1; } - status = check_component(lh, cnames[hc]); + status = check_component(lh, cnames[hc], 1); lttng_health_destroy(lh); @@ -121,7 +125,7 @@ int check_relayd(const char *path) return -1; } - status = check_component(lh, "relayd"); + status = check_component(lh, "relayd", 0); lttng_health_destroy(lh); -- 2.34.1