From 6fe93b9cb83488cbe083e141f3d11fadcd28d0d1 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 12 Sep 2017 04:46:24 -0400 Subject: [PATCH] modify rspconfig testcase for get more debug information --- xCAT-test/autotest/testcase/rspconfig/cases0 | 31 +++++++++++++++++++ .../autotest/testcase/rspconfig/rspconfig.sh | 15 ++++----- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/rspconfig/cases0 b/xCAT-test/autotest/testcase/rspconfig/cases0 index 32cf4618b..8266cc402 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases0 +++ b/xCAT-test/autotest/testcase/rspconfig/cases0 @@ -91,6 +91,13 @@ 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_set_all +description:rspconfig change openbmc ip/netmask/gateway/vlan +Attribute: $$CN-The operation object of rspconfig command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -a $$CN +check:rc==0 +end start:rspconfig_gateway_invalid despcription:rspconfig could not change openbmc gatway using invalid gateway @@ -99,6 +106,20 @@ cmd:rspconfig $$CN gateway=ddd check:rc!=0 end +start:rspconfig_set_vlan_invalid +despcription:rspconfig could not change openbmc gatway using invalid vlan +Attribute: $$CN-The operation object of rspconfig command +cmd:rspconfig $$CN vlan=dddsdsdfs +check:rc!=0 +end + +start:rspconfig_set_all_invalid +despcription:rspconfig could not change openbmc gatway using invalid vlan +Attribute: $$CN-The operation object of rspconfig command +cmd:rspconfig $$CN ip=dsd gateway=ooo netmask=asfsf vlan=dddsdsdfs +check:rc!=0 +end + start:rspconfig_node_invalid despcription:rspconfig could not do any action using invalid node cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi @@ -109,6 +130,16 @@ cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;r check:rc==0 end +start:rspconfig_noderange_invalid +despcription:rspconfig could not do any action using invalid node +cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi +check:rc==0 +cmd:rspconfig testnode,$$CN ip +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 diff --git a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh index 6b7657d68..1a5ea8667 100755 --- a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh +++ b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh @@ -180,19 +180,20 @@ function change_all { echo "Prepare to change all for bmc." echo "Start to change all for bmc." - rspconfig $2 gateway netmask vlan ip + rspconfig $1 gateway netmask vlan ip if [[ $? -eq 0 ]];then - BMCIP=`rspconfig $2 ip |awk -F":" '{print $3}'`; - BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'`; - BMCGGATEWAY=`rspconfig $2 gateway |awk -F":" '{print $3}'`; - output=`rspconfig $2 vlan` + BMCIP=`rspconfig $1 ip |awk -F":" '{print $3}'|sed s/[[:space:]]//g`; + BMCNETMASK=`rspconfig $1 netmask |awk -F":" '{print $3}'|sed s/[[:space:]]//g`; + BMCGGATEWAY=`rspconfig $1 gateway |awk -F":" '{print $3}'|sed s/[[:space:]]//g`; + output=`rspconfig $1 vlan` if [[ $output =~ "BMC VLAN ID enabled" ]];then - BMCVLAN=`rspconfig $2 vlan |awk -F":" '{print $3}'` + BMCVLAN=`rspconfig $1 vlan |awk -F":" '{print $3}'|sed s/[[:space:]]//g` else echo "------------------Bmc vlan disabled so could not change vlan id using rspconfig.--------------------" return 1; fi - rspconfig $2 ip=$BMCIP netmask=$BMCNETMASK gateway=$BMCGGATEWAY vlan=$BMCVLAN + + rspconfig $1 ip=$BMCIP netmask=$BMCNETMASK gateway=$BMCGGATEWAY vlan=$BMCVLAN if [[ $? -eq 0 ]];then echo "Could set BMC IP/netmask/gateway/vlan."; else