Test update functionality along with installation

This commit is contained in:
ronivay
2018-08-10 17:48:39 +03:00
parent c3d2856fca
commit fe577df1c3
4 changed files with 57 additions and 16 deletions

View File

@@ -4,19 +4,40 @@ function RunTestsSingle {
export VAGRANT_CWD="$(dirname $0)/$1"
local LOGFILE="$(dirname $0)/$1/installation-test.log"
vagrant up &> $LOGFILE
vagrant up --no-provision &> $LOGFILE
if [[ $? == "1" ]]; then
echo "Vagrant box failed to start, exiting"
exit 1;
fi
vagrant provision --provision-with install >> $LOGFILE 2>&1
sleep 5
echo "" >> $LOGFILE
echo "Curl output:" >> $LOGFILE
echo "Curl output after install:" >> $LOGFILE
curl -s -L 192.168.33.101 >> $LOGFILE 2>&1 || false
if [[ $? == "1" ]]; then
echo "$1 HTTP Check: failed"
echo "$1 install HTTP Check: failed"
else
echo "$1 HTTP Check: success"
echo "$1 install HTTP Check: success"
fi
sleep 5
vagrant destroy -f &> $LOGFILE
vagrant provision --provision-with update >> $LOGFILE 2>&1
sleep 5
echo "" >> $LOGFILE
echo "Curl output after update:" >> $LOGFILE
curl -s -L 192.168.33.101 >> $LOGFILE 2>&1 || false
if [[ $? == "1" ]]; then
echo "$1 update HTTP Check: failed"
else
echo "$1 update HTTP Check: success"
fi
sleep 5
vagrant destroy -f >> $LOGFILE 2>&1
unset VAGRANT_CWD
}
@@ -27,19 +48,39 @@ for x in CentOS Debian Ubuntu; do
export VAGRANT_CWD="$(dirname $0)/$x"
local LOGFILE="$(dirname $0)/$x/installation-test.log"
vagrant up &> $LOGFILE
vagrant up --no-provision &> $LOGFILE
if [[ $? == "1" ]]; then
echo "Vagrant box failed to start, exiting"
exit 1;
fi
vagrant provision --provision-with install >> $LOGFILE 2>&1
sleep 5
echo "" >> $LOGFILE
echo "Curl output:" >> $LOGFILE
echo "Curl output after install:" >> $LOGFILE
curl -s -L -m 5 192.168.33.101 >> $LOGFILE 2>&1 || false
if [[ $? == "1" ]]; then
echo "$x HTTP Check: failed"
echo "$x install HTTP Check: failed"
else
echo "$x HTTP Check: success"
echo "$x install HTTP Check: success"
fi
sleep 5
vagrant destroy -f &> $LOGFILE
vagrant provision --provision-with update >> $LOGFILE 2>&1
sleep 5
echo "" >> $LOGFILE
echo "Curl output after update:" >> $LOGFILE
curl -s -L -m 5 192.168.33.101 >> $LOGFILE 2>&1 || false
if [[ $? == "1" ]]; then
echo "$x update HTTP Check: failed"
else
echo "$x update HTTP Check: success"
fi
vagrant destroy -f >> $LOGFILE 2>&1
unset VAGRANT_CWD
done