]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
use busybox instead of ubuntu to test as it's much more lightweight, also wait contai...
authorS.Çağlar Onur <caglar@10ur.org>
Fri, 13 Sep 2013 18:41:48 +0000 (14:41 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 13 Sep 2013 19:06:13 +0000 (14:06 -0500)
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/tests/concurrent.c

index 41c171b70448fcbac935fc2a03956cc99b1e6d6d..7faf34cb655c744fb92fb4811a48cf3767dfacc7 100644 (file)
@@ -40,7 +40,7 @@ void * concurrent(void *arguments) {
     args->return_code = 1;
     if (strcmp(args->mode, "create") == 0) {
         if (!c->is_defined(c)) {
-            if (!c->create(c, "ubuntu", NULL, NULL, 1, NULL)) {
+            if (!c->create(c, "busybox", NULL, NULL, 1, NULL)) {
                 fprintf(stderr, "Creating the container (%s) failed...\n", name);
                 goto out;
             }
@@ -52,6 +52,10 @@ void * concurrent(void *arguments) {
                 fprintf(stderr, "Starting the container (%s) failed...\n", name);
                 goto out;
             }
+            if (!c->wait(c, "RUNNING", -1)) {
+                fprintf(stderr, "Waiting the container (%s) to start failed...\n", name);
+                goto out;
+            }
         }
     } else if(strcmp(args->mode, "stop") == 0) {
         if (c->is_defined(c) && c->is_running(c)) {
@@ -59,6 +63,10 @@ void * concurrent(void *arguments) {
                 fprintf(stderr, "Stopping the container (%s) failed...\n", name);
                 goto out;
             }
+            if (!c->wait(c, "STOPPED", -1)) {
+                fprintf(stderr, "Waiting the container (%s) to stop failed...\n", name);
+                goto out;
+            }
         }
     } else if(strcmp(args->mode, "destroy") == 0) {
         if (c->is_defined(c) && !c->is_running(c)) {