The test suite we use to indicate functional acceptance of a machine instance
Johnny Hughes
2016-05-18 493f84153236f34bd80242e7a39038813e65e36b
Merge pull request #14 from Altiscale/master

t_CheckExitStatus to have optional error message
4 files modified
57 ■■■■ changed files
tests/0_lib/functions.sh 4 ●●● patch | view | raw | blame | history
tests/p_bzip2/10-bzip2-test.sh 6 ●●●● patch | view | raw | blame | history
tests/p_vconfig/10_test_vconfig.sh 38 ●●●● patch | view | raw | blame | history
tests/r_lamp/50_lamp_check_mysql55.sh 9 ●●●● patch | view | raw | blame | history
tests/0_lib/functions.sh
@@ -14,7 +14,9 @@
{
    [ $1 -eq 0 ] && { t_Log "PASS"; return $PASS; }
    t_Log "FAIL"
  comment=''
  [ "$2" ] && comment=": $2"
    t_Log "FAIL" $comment
    exit $FAIL
}
tests/p_bzip2/10-bzip2-test.sh
@@ -18,11 +18,7 @@
#run file through bzcat
bzcat $FILE.bz2 | grep -q 'bzip2-test of single file'
if [ $? == 1 ]
  then
  t_Log 'bzcat failed'
  exit
fi
t_CheckExitStatus $? 'bzcat failed'
#run file through bunzip2
bunzip2 $FILE.bz2
tests/p_vconfig/10_test_vconfig.sh
@@ -15,44 +15,22 @@
# create VLAN-IF 10 on eth0
vconfig add eth0 10
ip addr list | grep -q eth0.10
if [ $? == 1 ]
  then
  t_Log "VLAN-IF creation failed"
  ret_val=1
else
  t_Log "VLAN-IF successfully created"
fi
t_CheckExitStatus $? "VLAN-IF creation failed"
t_Log "VLAN-IF successfully created"
#assign IP address on VLAN-IF
ifconfig eth0.10 172.16.30.1 netmask 255.255.255.255
ip addr list | grep -q 172.16.30.1
if [ $? == 1 ]
  then
  t_Log "IP address assignment on eth0.10 failed"
  ret_val=1
else
  t_Log "IP address successfully assigned on eth0.10"
fi
t_CheckExitStatus $? "IP address assignment on eth0.10 failed"
t_Log "IP address successfully assigned on eth0.10"
#testing address with ping
ping -c 4 -q 172.16.30.1 | grep -q '4 received'
if [ $? == 1 ]
  then
  t_Log "pinging on eth0.10 failed"
  ret_val=1
else
  t_Log "local ping on VLAN IF worked"
fi
t_CheckExitStatus $? "pinging on eth0.10 failed"
t_Log "local ping on VLAN IF worked"
# delete VLAN-IF 10 on eth0
vconfig rem eth0.10
ip addr list | grep -q eth0.10
if [ $? == 0 ]
  then
  t_Log "Removing VLAN IF failed"
  ret_val=1
else
  t_Log "Removing of VLAN IF worked"
fi
t_CheckExitStatus $ret_val
t_CheckExitStatus $? "Removing VLAN IF failed"
t_Log "Removing of VLAN IF worked"
tests/r_lamp/50_lamp_check_mysql55.sh
@@ -39,14 +39,7 @@
        $SERVICE $D start &>/dev/null
        RETVAL=$?
        if [ $RETVAL -ne 0 ]; then
                t_Log "FAIL: service startup for '$D' failed ($RETVAL)"
                exit $FAIL
        fi
        t_CheckExitStatus $? "FAIL: service startup for '$D' failed ($RETVAL)"
done
for D in "${DAEMONSPID[@]}"
do