-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathtest.sh
executable file
·38 lines (33 loc) · 1.04 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
pushd sample-vm > /dev/null
if [[ "$OSTYPE" == "linux-gnu" ]]; then
VBOXMANAGE=`which vboxmanage`
elif [[ "$OSTYPE" == "darwin"* ]]; then
VBOXMANAGE=`which vboxmanage`
elif [[ "$OSTYPE" == "cygwin" ]]; then
VBOXMANAGE="/c/Program Files/Oracle/VirtualBox/VBoxManage.exe"
elif [[ "$OSTYPE" == "msys" ]]; then
VBOXMANAGE="/c/Program Files/Oracle/VirtualBox/VBoxManage.exe"
elif [[ "$OSTYPE" == "win32" ]]; then
VBOXMANAGE="/c/Program Files/Oracle/VirtualBox/VBoxManage.exe"
elif [[ "$OSTYPE" == "freebsd"* ]]; then
VBOXMANAGE=`which vboxmanage`
else
echo Seriously, what the hell are you running me on????
exit 1
fi
FILES=*.vagrantfile
for f in $FILES
do
echo Testing $f
VAGRANT_VAGRANTFILE="$f" vagrant up --no-color > $f.log
VAGRANT_VAGRANTFILE="$f" vagrant ssh -- "mount | grep -q mysql"
RESULT=$?
if [ $RESULT -eq 0 ]; then
echo ...[PASSED]
else
echo ...[FAILED]
fi
VAGRANT_VAGRANTFILE="$f" vagrant destroy -f --no-color >> $f.log && rm -fv virtualdrive.vdi >> $f.log 2>&1
done
popd > /dev/null