tests: retry to fire up VMs on vagrant failure

Add a script to retry several times to fire up VMs to avoid vagrant
failures.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
Co-authored-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 1ecb3a9352)
pull/5036/head
Guillaume Abrioux 2019-04-02 14:53:19 +02:00
parent d437593e85
commit b7a21d94d3
3 changed files with 14 additions and 3 deletions

View File

@ -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

View File

@ -43,8 +43,7 @@ setenv=
changedir={toxinidir}/tests/functional/all_daemons{env:CONTAINER_DIR:}
commands=
vagrant up --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}
# use the stable-3.1 branch to deploy a jewel cluster

View File

@ -244,7 +244,7 @@ changedir=
commands=
rhcs: ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/rhcs_setup.yml --extra-vars "change_dir={changedir}" --tags "vagrant_setup"
vagrant up --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/vagrant_up.sh --no-provision {posargs:--provider=virtualbox}
bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir}
# configure lvm