tests: health check: OK if consumerd is not running
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 9 Oct 2013 18:06:18 +0000 (14:06 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 9 Oct 2013 18:06:18 +0000 (14:06 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/regression/tools/health/health_check.c

index 22cbcf12dfaad9ff0db002000ddc717d02c50baa..fbf45c81329bba7161e7cc8bcd3dc83c135ee3dd 100644 (file)
 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);
 
This page took 0.027387 seconds and 4 git commands to generate.