Skip to content
Snippets Groups Projects
Commit 7ec170a9 authored by Jeffrey Zhang's avatar Jeffrey Zhang
Browse files

Validate that all the containers are started

Container maybe exit after deployed. But the print_failure
never runs if the kolla-ansible run success.
This PS checks all the containers status after deploy and
failed the test if the container status is exited

TrivialFix
Change-Id: Ia461b280855eda500e143ee1d6cfd5f215eaf6fe
parent 1057dcd5
No related branches found
No related tags found
No related merge requests found
...@@ -5,13 +5,18 @@ set -o errexit ...@@ -5,13 +5,18 @@ set -o errexit
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
function print_failure { function check_failure {
docker ps -a docker ps -a
for failed in $(docker ps -a --format "{{.Names}}" --filter status=exited); do failed_containers=$(docker ps -a --format "{{.Names}}" --filter status=exited)
docker logs --tail=all $failed
for failed in ${failed_containers}; do
docker logs --tail all ${failed}
done done
echo "FAILED"
exit 1 if [[ -n ${failed_containers} ]]; then
echo 'FAILED'
exit 1
fi
} }
# Populate globals.yml # Populate globals.yml
...@@ -29,9 +34,8 @@ EOF ...@@ -29,9 +34,8 @@ EOF
ip l a fake_interface type dummy ip l a fake_interface type dummy
# Actually do the deployment # Actually do the deployment
tools/kolla-ansible deploy || print_failure tools/kolla-ansible deploy
# TODO(SamYaple): Actually validate that all containers are started check_failure
docker ps -a
# TODO(SamYaple): Actually do functional testing of OpenStack # TODO(SamYaple): Actually do functional testing of OpenStack
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment