Skip to content
Snippets Groups Projects
Commit a78f8087 authored by Johnny Hughes's avatar Johnny Hughes
Browse files

Revert "t_CheckExitStatus to have optional error message"

parent 493f8415
No related branches found
No related tags found
No related merge requests found
......@@ -14,9 +14,7 @@ function t_CheckExitStatus
{
[ $1 -eq 0 ] && { t_Log "PASS"; return $PASS; }
comment=''
[ "$2" ] && comment=": $2"
t_Log "FAIL" $comment
t_Log "FAIL"
exit $FAIL
}
......
......@@ -18,7 +18,11 @@ bzip2 $FILE
#run file through bzcat
bzcat $FILE.bz2 | grep -q 'bzip2-test of single file'
t_CheckExitStatus $? 'bzcat failed'
if [ $? == 1 ]
then
t_Log 'bzcat failed'
exit
fi
#run file through bunzip2
bunzip2 $FILE.bz2
......
......@@ -15,22 +15,44 @@ fi
# create VLAN-IF 10 on eth0
vconfig add eth0 10
ip addr list | grep -q eth0.10
t_CheckExitStatus $? "VLAN-IF creation failed"
t_Log "VLAN-IF successfully created"
if [ $? == 1 ]
then
t_Log "VLAN-IF creation failed"
ret_val=1
else
t_Log "VLAN-IF successfully created"
fi
#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
t_CheckExitStatus $? "IP address assignment on eth0.10 failed"
t_Log "IP address successfully assigned on eth0.10"
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
#testing address with ping
ping -c 4 -q 172.16.30.1 | grep -q '4 received'
t_CheckExitStatus $? "pinging on eth0.10 failed"
t_Log "local ping on VLAN IF worked"
if [ $? == 1 ]
then
t_Log "pinging on eth0.10 failed"
ret_val=1
else
t_Log "local ping on VLAN IF worked"
fi
# delete VLAN-IF 10 on eth0
vconfig rem eth0.10
ip addr list | grep -q eth0.10
t_CheckExitStatus $? "Removing VLAN IF failed"
t_Log "Removing of VLAN IF worked"
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
......@@ -39,7 +39,14 @@ do
$SERVICE $D start &>/dev/null
t_CheckExitStatus $? "FAIL: service startup for '$D' failed ($RETVAL)"
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
t_Log "FAIL: service startup for '$D' failed ($RETVAL)"
exit $FAIL
fi
done
for D in "${DAEMONSPID[@]}"
do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment