Add test runner script

This commit is contained in:
Chris Roberts 2018-03-08 12:11:22 -08:00
parent f4b7cec162
commit 1abbe67ee9
1 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,44 @@
#!/usr/bin/env bash
function cleanup {
vagrant destroy --force
}
trap cleanup EXIT
GEM_PATH=$(ls vagrant-spec*.gem)
set -ex
if [ -f "${GEM_PATH}" ]
then
mv "${GEM_PATH}" vagrant-spec.gem
fi
guests=$(vagrant status | grep vmware | awk '{print $1}')
vagrant up --no-provision
declare -A pids
for guest in ${guests}
do
vagrant provision ${guest} &
pids[guest]=$!
sleep 60
done
result=0
set +e
for guest in ${guests}
do
wait ${pids[guest]}
if [ $? -ne 0 ]
then
echo "Provision failure for: ${guest}"
result=1
fi
done
exit $result