From 1abbe67ee9806bf090b1cf8b1ddf12a72297753d Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 8 Mar 2018 12:11:22 -0800 Subject: [PATCH] Add test runner script --- test/vagrant-spec/.runner-vmware.sh | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 test/vagrant-spec/.runner-vmware.sh diff --git a/test/vagrant-spec/.runner-vmware.sh b/test/vagrant-spec/.runner-vmware.sh new file mode 100755 index 000000000..a20e46189 --- /dev/null +++ b/test/vagrant-spec/.runner-vmware.sh @@ -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