Skip to content

Commit

Permalink
tests: Added a test for checking a container starts properly
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergs committed Jul 6, 2021
1 parent 27605eb commit f77b68a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/system/103-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f77b68a

Please sign in to comment.