1
0
mirror of https://github.com/jcwimer/startup-infrastructure synced 2026-03-24 22:34:42 +00:00
Files
startup-infrastructure/tests/vagrant-tests.sh

27 lines
631 B
Bash

#!/bin/bash
project_dir="$(dirname $( dirname $(readlink -f ${BASH_SOURCE[0]})))"
source ${project_dir}/tests/lib/test-function.sh
function main {
cd ${project_dir}
run-tests
destroy-infrastructure
}
function run-tests {
trap "destroy-infrastructure; exit 1" ERR
echo Building vagrant infrastructure
test "Building infrastructure with vagrant up should not fail." \
"vagrant up > /dev/null"
test "Running command on a vagrant node should not fail." \
vagrant ssh bootstrap -c ls
}
function destroy-infrastructure {
echo Tearing down vagrant infrastructure
vagrant destroy -f > /dev/null
}
main
exit 0