diff tests/span_containers.c @ 7:8339ab15527d

Add running/stopped containers global statistics and refactor some things
author Louis Opter <louis@dotcloud.com>
date Sat, 01 Jan 2011 17:46:40 +0100
parents 6ce4443e7545
children
line wrap: on
line diff
--- a/tests/span_containers.c	Sat Jan 01 16:18:17 2011 +0100
+++ b/tests/span_containers.c	Sat Jan 01 17:46:40 2011 +0100
@@ -23,7 +23,8 @@
 int
 main(int argc, char *argv[])
 {
-    lxcst_handle   *hdl;
+    lxcst_handle            *hdl;
+    struct lxcst_globals    globals;
 
     hdl = lxcst_open();
     if (!hdl)
@@ -35,6 +36,13 @@
 
     printf("%s: spanned %d containers.\n", *argv, n);
 
+    lxcst_globals_statistics(&globals);
+
+    if (globals.running_containers != n)
+        errx(EXIT_FAILURE, "running_containers != spanned containers");
+
+    printf("%s: %d running containers, %d stopped containers.\n", *argv, globals.running_containers, globals.stopped_containers);
+
     return (EXIT_SUCCESS);
     (void)argc;
 }