2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 01:26:38 +00:00

modify rspconfig testcase

This commit is contained in:
junxiawang 2017-09-04 09:06:55 -04:00
parent 69598e0b51
commit e9a8d0121c
2 changed files with 61 additions and 18 deletions

View File

@ -41,7 +41,7 @@ check:rc==0
check:output=~__GETNODEATTR($$CN,hcp)__: \w+
end
start:rspconfig_ip
start:rspconfig_set_ip
description:rspconfig change openbmc ip
Attribute: $$CN-The operation object of rspconfig command
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -i $$CN $NODEIP
@ -64,7 +64,7 @@ cmd:rspconfig $$CN ip=
check:rc!=0
end
start:rspconfig_netmask
start:rspconfig_set_netmask
description:rspconfig change openbmc netmask
Attribute: $$CN-The operation object of rspconfig command
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -n $$CN netmask
@ -78,12 +78,19 @@ cmd:rspconfig $$CN netmask=ddd
check:rc!=0
end
start:rspconfig_gateway
start:rspconfig_set_gateway
description:rspconfig change openbmc gateway
Attribute: $$CN-The operation object of rspconfig command
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -g $$CN gateway
check:rc==0
end
start:rspconfig_set_vlan
description:rspconfig change openbmc gateway
Attribute: $$CN-The operation object of rspconfig command
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -v $$CN vlan
check:rc==0
end
start:rspconfig_gateway_invalid
despcription:rspconfig could not change openbmc gatway using invalid gateway
@ -101,4 +108,38 @@ check:rc!=0
cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi
check:rc==0
end
start:rspconfig_list_ip
despcription:rspconfig list bmc ip
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -lip $$CN
check:rc==0
end
start:rspconfig_list_gateway
description:rspconfig list openbmc gateway
Attribute: $$CN-The operation object of rspconfig command
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -lg $$CN
check:rc==0
end
start:rspconfig_list_netmask
description:rspconfig list openbmc netmask
Attribute: $$CN-The operation object of rspconfig command
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -ln $$CN
check:rc==0
end
start:rspconfig_list_vlan
description:rspconfig list openbmc netmask
Attribute: $$CN-The operation object of rspconfig command
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -lv $$CN
check:rc==0
end
start:rspconfig_list_all
description:rspconfig list openbmc netmask
Attribute: $$CN-The operation object of rspconfig command
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -la $$CN
check:rc==0
end

View File

@ -199,7 +199,7 @@ do
;;
"-lip"|"--list ip" )
echo "--------------------To test bmc ip could be listed using rspconfig.--------------------"
BMCIP_LSDEF=`lsdef $2 |grep bmc |awk -F "=" '{print $2}'`
BMCIP_LSDEF=`lsdef $2 |grep "bmc=" |awk -F "=" '{print $2}'`
rspconfig $2 ip
if [[ $? -eq 0 ]];then
BMCIP=`rspconfig $2 ip |awk -F":" '{print $3}'`
@ -234,17 +234,18 @@ do
fi
;;
"-lg"|"--list gateway" )
output=rpconfig $2 gateway
output=`rspconfig $2 gateway`
echo "output is $output"
if [[ $? -eq 0 ]];then
if [[ $output =~ "$2 BMC Gateway:" ]];then
echo "-------------------To test bmc gateway could be listed using rspconfig successfully.-----------------"
if [[ $output =~ "$2: BMC Gateway:" ]];then
echo "--1-----------------To test bmc gateway could be listed using rspconfig successfully.-----------------"
exit 0;
else
echo "-----------------To test bmc gateway could be listed using rsconfig failed.-------------------"
echo "---2--------------To test bmc gateway could be listed using rsconfig failed.-------------------"
exit 1;
fi
else
echo "-------------------To test bmc gateway could be listed using rspconfig failed.---------------"
echo "------------3-------To test bmc gateway could be listed using rspconfig failed.---------------"
exit 1;
fi
;;
@ -266,9 +267,9 @@ do
fi
;;
"-ln"|"--list netmask" )
output=rpconfig $2 netmask
output=`rspconfig $2 netmask`
if [[ $? -eq 0 ]];then
if [[ $output =~ "$2 BMC Netmask:" ]];then
if [[ $output =~ "$2: BMC Netmask:" ]];then
echo "-------------------To test bmc Netmask could be listed using rspconfig successfully.-----------------"
exit 0;
else
@ -281,7 +282,7 @@ do
fi
;;
"-v"|"--vlan" )
output=rspconfig $2 vlan
output=`rspconfig $2 vlan`
echo "---------------------To test bmc vlan could be changed using rspconfig.--------------------"
if [[ $? -eq 0 ]]&&[[ $output =~ "BMC VLAN ID enabled" ]];then
BMCVLAN=`rspconfig $2 vlan |awk -F":" '{print $3}'`
@ -299,9 +300,9 @@ do
fi
;;
"-lv"|"--list vlan" )
output=rpconfig $2 vlan
output=`rspconfig $2 vlan`
if [[ $? -eq 0 ]];then
if [[ $output =~ "$2 BMC VLAN ID:" ]];then
if [[ $output =~ "$2: BMC VLAN ID" ]];then
echo "-------------------To test bmc Vlan could be listed using rspconfig successfully.-----------------"
exit 0;
else
@ -324,11 +325,12 @@ do
fi
;;
"-la"|"--list all" )
BMCIP_LSDEF=`lsdef $2 |grep bmc |awk -F "=" '{print $2}'`
BMCIP_LSDEF=`lsdef $2 |grep "bmc=" |awk -F "=" '{print $2}'`
BMCIP=`rspconfig $2 ip |awk -F":" '{print $3}'`
output=rspconfig $2 ip gateway netmask vlan
output=`rspconfig $2 ip gateway netmask vlan`
if [[ $? -eq 0 ]];then
if [[ $output =~ "$2 BMC VLAN ID:" ]]&&[[ $output =~ "$2 BMC Netmask:" ]]&&[[ $output =~ "$2 BMC Gateway:" ]]&&[[ $BMCIP =~ "$BMCIP_LSDEF" ]];then
#if [[ $output =~ "BMC VLAN ID:" ]]&&[[ $output =~ "BMC Netmask:" ]]&&[[ $output =~ "BMC Gateway:" ]]&&[[ $BMCIP =~ "$BMCIP_LSDEF" ]];then
if [[ $output =~ "$2: BMC VLAN ID" ]]&&[[ $output =~ "BMC Netmask:" ]]&&[[ $output =~ "BMC Gateway:" ]]&&[[ $BMCIP =~ "$BMCIP_LSDEF" ]];then
echo "------------------To test bmc's all option could be listed using rspconfig succssfully.-----------------"
exit 0
else