]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
console-log test: make sure container is stopped before restarting 4287/head
authorSerge Hallyn <serge@hallyn.com>
Sun, 19 Mar 2023 20:31:18 +0000 (15:31 -0500)
committerSerge Hallyn <serge@hallyn.com>
Sun, 19 Mar 2023 21:04:46 +0000 (16:04 -0500)
Closes #4237

Signed-off-by: Serge Hallyn <serge@hallyn.com>
src/tests/console_log.c

index 77ca87deb0c1acd8c398a8e819147d7bdb060fb2..a20b909871bede9353f4b10b5005ae31d88998fa 100644 (file)
@@ -133,6 +133,11 @@ int main(int argc, char *argv[])
                goto on_error_stop;
        }
 
+       if (!c->wait(c, "STOPPED", 5)) {
+               lxc_error("%s\n", "Failed waiting for container \"console-log\" to stop");
+               goto on_error_stop;
+       }
+
        c->clear_config(c);
 
        if (!c->load_config(c, NULL)) {
@@ -165,6 +170,11 @@ int main(int argc, char *argv[])
                goto on_error_stop;
        }
 
+       if (!c->wait(c, "STOPPED", 5)) {
+               lxc_error("%s\n", "Failed waiting for container \"console-log\" to stop");
+               goto on_error_stop;
+       }
+
        if (!c->startl(c, 0, NULL)) {
                lxc_error("%s\n", "Failed to start container \"console-log\" daemonized");
                goto on_error_destroy;