From: Andrew Schoen Date: Wed, 22 Aug 2018 20:37:46 +0000 (-0400) Subject: ceph-volume: retry when 'vagrant up' fails X-Git-Tag: v14.0.1~501^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2c88e70877dcc2a04a69be4ab9c4834d5ced6198;p=ceph.git ceph-volume: retry when 'vagrant up' fails Signed-off-by: Andrew Schoen --- diff --git a/src/ceph-volume/ceph_volume/tests/functional/batch/tox.ini b/src/ceph-volume/ceph_volume/tests/functional/batch/tox.ini index 37a9c1819ab3..6a43a110e47e 100644 --- a/src/ceph-volume/ceph_volume/tests/functional/batch/tox.ini +++ b/src/ceph-volume/ceph_volume/tests/functional/batch/tox.ini @@ -34,7 +34,7 @@ changedir= commands= git clone -b {env:CEPH_ANSIBLE_BRANCH:master} --single-branch https://github.com/ceph/ceph-ansible.git {envdir}/tmp/ceph-ansible - vagrant up {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox} + bash {toxinidir}/../scripts/vagrant_up.sh {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox} bash {toxinidir}/../scripts/generate_ssh_config.sh {changedir} cp {toxinidir}/../playbooks/deploy.yml {envdir}/tmp/ceph-ansible diff --git a/src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini b/src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini index 97f5d51a39ed..d9f325543cd9 100644 --- a/src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini +++ b/src/ceph-volume/ceph_volume/tests/functional/lvm/tox.ini @@ -8,6 +8,7 @@ whitelist_externals = bash git cp + sleep passenv=* setenv= ANSIBLE_SSH_ARGS = -F {changedir}/vagrant_ssh_config @@ -45,7 +46,7 @@ commands= # but the master branch doesn't pin dependencies so we can't guarantee to work correctly #pip install -r {envdir}/tmp/ceph-ansible/requirements.txt - vagrant up {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox} + bash {toxinidir}/../scripts/vagrant_up.sh {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox} bash {toxinidir}/../scripts/generate_ssh_config.sh {changedir} # create logical volumes to test with on the vms diff --git a/src/ceph-volume/ceph_volume/tests/functional/scripts/vagrant_up.sh b/src/ceph-volume/ceph_volume/tests/functional/scripts/vagrant_up.sh new file mode 100644 index 000000000000..2f9a15f84a49 --- /dev/null +++ b/src/ceph-volume/ceph_volume/tests/functional/scripts/vagrant_up.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +retries=0 +until [ $retries -ge 5 ] +do + echo "Attempting to start VMs. Attempts: $retries" + timeout 10m vagrant up "$@" && break + retries=$[$retries+1] + sleep 5 +done + +sleep 10 diff --git a/src/ceph-volume/ceph_volume/tests/functional/simple/tox.ini b/src/ceph-volume/ceph_volume/tests/functional/simple/tox.ini index 632cbb02f2f5..5f506badc499 100644 --- a/src/ceph-volume/ceph_volume/tests/functional/simple/tox.ini +++ b/src/ceph-volume/ceph_volume/tests/functional/simple/tox.ini @@ -42,7 +42,7 @@ commands= # but the master branch doesn't pin dependencies so we can't guarantee to work correctly #pip install -r {envdir}/tmp/ceph-ansible/requirements.txt - vagrant up {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox} + bash {toxinidir}/../scripts/vagrant_up.sh {env:VAGRANT_UP_FLAGS:"--no-provision"} {posargs:--provider=virtualbox} bash {toxinidir}/../scripts/generate_ssh_config.sh {changedir} cp {toxinidir}/../playbooks/deploy.yml {envdir}/tmp/ceph-ansible