From f77b68abc657173b698c20a8b6bad8ee90d3f138 Mon Sep 17 00:00:00 2001 From: Oliver Gutierrez Date: Tue, 6 Jul 2021 15:07:47 +0100 Subject: [PATCH] tests: Added a test for checking a container starts properly --- test/system/103-run.bats | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/system/103-run.bats b/test/system/103-run.bats index 8b58e425b..5ce1757ae 100644 --- a/test/system/103-run.bats +++ b/test/system/103-run.bats @@ -19,6 +19,29 @@ teardown() { cd "$CURDIR" || return 1 } +@test "run: containerstart: Check container starts without issues" { + + create_default_container + + run $PODMAN start "$(get_system_id)-toolbox-$(get_system_version)" + + CONTAINER_INITIALIZED=0 + + for TRIES in 1 2 3 4 5 + do + run $PODMAN logs "$(get_system_id)-toolbox-$(get_system_version)" + CONTAINER_OUTPUT=$output + run grep 'Listening to file system and ticker events' <<< $output + if [[ "$status" -eq 0 ]]; then + CONTAINER_INITIALIZED=1 + break + fi + sleep 1 + done + + echo $CONTAINER_OUTPUT + assert [ "$CONTAINER_INITIALIZED" -eq 1 ] +} @test "run: Try to run echo 'Hello World' with no containers created" { run $TOOLBOX run echo "Hello World"