diff options
| author | Jeffrey Zhang <jeffrey.zhang@99cloud.net> | 2016-02-02 16:30:20 +0800 |
|---|---|---|
| committer | Jeffrey Zhang <jeffrey.zhang@99cloud.net> | 2016-02-02 19:47:38 +0800 |
| commit | 7ec170a9ff6efe58afecf4474efa006cf823e181 (patch) | |
| tree | 7d80ec654063153b9da255cc2d2879fe40059e07 | |
| parent | 1057dcd50a8963e5220f7ca5cc7b66183a06340e (diff) | |
| download | kolla-7ec170a9ff6efe58afecf4474efa006cf823e181.tar.gz kolla-7ec170a9ff6efe58afecf4474efa006cf823e181.zip | |
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
| -rwxr-xr-x | tools/deploy_aio.sh | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/deploy_aio.sh b/tools/deploy_aio.sh index 9ca10164b..63b841fd6 100755 --- a/tools/deploy_aio.sh +++ b/tools/deploy_aio.sh @@ -5,13 +5,18 @@ set -o errexit export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -function print_failure { +function check_failure { docker ps -a - for failed in $(docker ps -a --format "{{.Names}}" --filter status=exited); do - docker logs --tail=all $failed + failed_containers=$(docker ps -a --format "{{.Names}}" --filter status=exited) + + for failed in ${failed_containers}; do + docker logs --tail all ${failed} done - echo "FAILED" - exit 1 + + if [[ -n ${failed_containers} ]]; then + echo 'FAILED' + exit 1 + fi } # Populate globals.yml @@ -29,9 +34,8 @@ EOF ip l a fake_interface type dummy # Actually do the deployment -tools/kolla-ansible deploy || print_failure +tools/kolla-ansible deploy -# TODO(SamYaple): Actually validate that all containers are started -docker ps -a +check_failure # TODO(SamYaple): Actually do functional testing of OpenStack |
