From 5894cf31014d15af1f352d15fc2633eec1d99237 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Sun, 19 Mar 2023 15:31:18 -0500 Subject: [PATCH] console-log test: make sure container is stopped before restarting Closes #4237 Signed-off-by: Serge Hallyn --- src/tests/console_log.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tests/console_log.c b/src/tests/console_log.c index 77ca87deb..a20b90987 100644 --- a/src/tests/console_log.c +++ b/src/tests/console_log.c @@ -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; -- 2.47.2