mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 09:13:08 +00:00
Merge pull request #4530 from hu-weihua/openbmccase
Add and modify test cases for openbmc hardware control
This commit is contained in:
commit
02444f5c8e
@ -33,10 +33,17 @@ rspconfig_list_ip
|
||||
rspconfig_list_netmask
|
||||
rspconfig_list_vlan
|
||||
rspconfig_noderange_invalid
|
||||
rspconfig_set_all
|
||||
rspconfig_set_all_invalid
|
||||
rspconfig_set_vlan
|
||||
rspconfig_set_vlan_invalid
|
||||
rspconfig_set_hostname_equal_star_with_bmc_is_ip
|
||||
rspconfig_set_hostname_equal_star_with_bmc_is_hostname
|
||||
rspconfig_get_hostname
|
||||
rspconfig_hostname_with_error_input
|
||||
rspconfig_set_hostname
|
||||
rspconfig_set_admin_passwd_with_error_input
|
||||
rspconfig_set_admin_passwd_with_error_origin_password
|
||||
rspconfig_sshcfg_with_error_input
|
||||
rflash_option_c_without_specify_noderange
|
||||
rflash_option_l_without_specify_noderange
|
||||
rflash_option_a_without_specify_noderange
|
||||
@ -74,4 +81,3 @@ rpower_softoff
|
||||
rpower_suspend_OpenpowerBmc
|
||||
rpower_wake_OpenpowerBmc
|
||||
rpower_errorcommand_OpenpowerBmc
|
||||
rpower_wrongpasswd
|
||||
|
@ -446,6 +446,9 @@ cmd:rflash $$CN -d /tmp/bogus123
|
||||
check:output=~Error: Can't open directory
|
||||
check:output!~Attempting to
|
||||
check:rc != 0
|
||||
cmd:rflash $$CN /tmp/bogus123
|
||||
check:output=~Error: Invalid option specified
|
||||
check:rc != 0
|
||||
cmd:mkdir -p /tmp/bogus123
|
||||
check:rc == 0
|
||||
cmd:rflash $$CN /tmp/bogus123 -d
|
||||
@ -478,7 +481,7 @@ hcp:openbmc
|
||||
cmd:rflash -h
|
||||
check:output =~Usage:
|
||||
check:output =~OpenPOWER OpenBMC specific:
|
||||
check:output =~ -d.+–no-host-reboot
|
||||
check:output =~ -d.+no-host-reboot
|
||||
check:output =~ image_id.+--delete
|
||||
check:rc == 0
|
||||
end
|
||||
|
@ -121,7 +121,7 @@ cmd:chdef $$CN bmcpassword=test
|
||||
check:rc==0
|
||||
cmd:rinv $$CN all
|
||||
check:rc==1
|
||||
check:output=~$$CN: Error: Invalid username or password|Error: ERROR: Incorrect password provided
|
||||
check:output=~$$CN: Error:.+Invalid username or password|Error: ERROR: Incorrect password provided
|
||||
cmd:cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza
|
||||
check:rc==0
|
||||
end
|
||||
|
@ -11,7 +11,7 @@ cmd:rspconfig $$CEC iocap
|
||||
check:rc==0
|
||||
check:output=~$$CEC: iocap: \w+
|
||||
end
|
||||
start:
|
||||
|
||||
start:rspconfig_time
|
||||
hcp:fsp
|
||||
cmd:rspconfig $$CEC time
|
||||
@ -57,54 +57,81 @@ check:rc==0
|
||||
end
|
||||
|
||||
start:rspconfig_set_ip
|
||||
description:rspconfig change openbmc ip
|
||||
description:To test change openbmc ip separately by rspconfig. should not support and throw out error message
|
||||
Attribute: $$CN-The operation object of rspconfig command
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -i $$CN $NODEIP
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -c $$CN ip
|
||||
check:rc==0
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN ip=__GETNODEATTR($$CN,bmc)__
|
||||
check:output=~Error: IP, netmask and gateway must be configured together.
|
||||
check:rc!=0
|
||||
end
|
||||
|
||||
start:rspconfig_ip_invalid
|
||||
description:rspconfig could not change openbmc ip using invalid ip
|
||||
Attribute: $$CN-The operation object of rspconfig command
|
||||
cmd:rspconfig $$CN ip=ddd
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN ip=ddd gateway=0.0.0.0 netmask=255.255.0.0
|
||||
check:output=~Error: Invalid parameter for option ip
|
||||
check:rc!=0
|
||||
end
|
||||
|
||||
start:rspconfig_ip_null
|
||||
description:rspconfig could not set ip to null
|
||||
Attribute: $$CN-The operation object of rspconfig command
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN ip=
|
||||
check:output=~Invalid parameter for option ip
|
||||
check:rc!=0
|
||||
cmd:rspconfig $$CN ip= gateway=0.0.0.0 netmask=255.255.0.0
|
||||
check:output=~Invalid parameter for option ip
|
||||
check:rc!=0
|
||||
end
|
||||
|
||||
start:rspconfig_set_netmask
|
||||
description:rspconfig change openbmc netmask
|
||||
description:To test change openbmc netmask separately by rspconfig. should not support and throw out error message
|
||||
Attribute: $$CN-The operation object of rspconfig command
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -n $$CN netmask
|
||||
check:rc==0
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN netmask=255.255.0.0
|
||||
check:output=~Error: IP, netmask and gateway must be configured together.
|
||||
check:rc!=0
|
||||
end
|
||||
|
||||
start:rspconfig_netmask_invalid
|
||||
despcription:rspconfig could not change openbmc netmask using invalid netmask
|
||||
Attribute: $$CN-The operation object of rspconfig command
|
||||
cmd:rspconfig $$CN netmask=ddd
|
||||
check:output=~Error: Invalid parameter for option netmask
|
||||
check:rc!=0
|
||||
cmd:rspconfig $$CN netmask=ddd ip=__GETNODEATTR($$CN,bmc)__ gateway=0.0.0.0
|
||||
check:output=~Error: Invalid parameter for option netmask
|
||||
check:rc!=0
|
||||
cmd:rspconfig $$CN netmask= ip=__GETNODEATTR($$CN,bmc)__ gateway=0.0.0.0
|
||||
check:output=~Error: Invalid parameter for option netmask
|
||||
check:rc!=0
|
||||
end
|
||||
|
||||
start:rspconfig_set_gateway
|
||||
description:rspconfig change openbmc gateway
|
||||
description:To test change openbmc gateway by rspconfig. should not support and throw out error message
|
||||
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
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN gateway=0.0.0.0
|
||||
check:output=~Error: IP, netmask and gateway must be configured together.
|
||||
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
|
||||
cmd:rspconfig $$CN vlan=0
|
||||
check:output=~Error: Invalid parameter for option vlan
|
||||
check:rc!=0
|
||||
cmd:rspconfig $$CN vlan=111
|
||||
check:output=~Error: VLAN must be configured with IP, netmask and gateway
|
||||
check:rc!=0
|
||||
end
|
||||
|
||||
start:rspconfig_set_all
|
||||
@ -117,29 +144,47 @@ end
|
||||
start:rspconfig_gateway_invalid
|
||||
despcription:rspconfig could not change openbmc gatway using invalid gateway
|
||||
Attribute: $$CN-The operation object of rspconfig command
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN gateway=ddd
|
||||
check:output=~Error: Invalid parameter for option gateway
|
||||
check:rc!=0
|
||||
cmd:rspconfig $$CN gateway= ip=__GETNODEATTR($$CN,bmc)__ netmask=255.0.0.0
|
||||
check:output=~Error: Invalid parameter for option gateway
|
||||
check:rc!=0
|
||||
cmd:rspconfig $$CN gateway=
|
||||
check:output=~Error: Invalid parameter for option gateway
|
||||
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
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN vlan=dddsdsdfs
|
||||
check:output=~Error: VLAN must be configured with IP, netmask and gateway
|
||||
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
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN ip=dsd gateway=ooo netmask=asfsf vlan=dddsdsdfs
|
||||
check:output=~Error: Invalid parameter
|
||||
check:rc!=0
|
||||
end
|
||||
|
||||
start:rspconfig_node_invalid
|
||||
despcription:rspconfig could not do any action using invalid node
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi
|
||||
check:rc==0
|
||||
cmd:rspconfig testnode ip
|
||||
check:output=~Error: Invalid nodes and/or groups in noderange
|
||||
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
|
||||
@ -147,9 +192,12 @@ end
|
||||
|
||||
start:rspconfig_noderange_invalid
|
||||
despcription:rspconfig could not do any action using invalid node
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
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:output=~Error: Invalid nodes
|
||||
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
|
||||
@ -199,3 +247,156 @@ check:output=~$$CN: BMC Netmask:
|
||||
check:output=~__GETNODEATTR($$CN,bmc)__
|
||||
end
|
||||
|
||||
|
||||
start:rspconfig_set_hostname_equal_star_with_bmc_is_ip
|
||||
description:when bmc=<ip>, rspconfig <node> hostname=* should throw out error
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
#in automation environment, bmc is ip by default.
|
||||
cmd:lsdef $$CN -i bmc -c
|
||||
check:rc == 0
|
||||
cmd:rspconfig $$CN hostname=*
|
||||
check:rc == 0
|
||||
check:output =~ Invalid OpenBMC Hostname
|
||||
end
|
||||
|
||||
|
||||
start:rspconfig_set_hostname_equal_star_with_bmc_is_hostname
|
||||
description:when bmc=<bmc_hostname>, rspconfig <node> hostname=* should set bmc_hostname into bmc
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:mkdir -p /tmp/rspconfig_set_hostname_equal_star_with_bmc_is_hostname
|
||||
check:rc == 0
|
||||
cmd:lsdef $$CN -z > /tmp/rspconfig_set_hostname_equal_star_with_bmc_is_hostname/$$CN.stanza
|
||||
check:rc == 0
|
||||
cmd:chdef -t node -o bogus_bmc_hostname groups=bmc ip=10.6.17.100
|
||||
check:rc == 0
|
||||
cmd:makehosts bogus_bmc_hostname
|
||||
check:rc == 0
|
||||
cmd:chdef $$CN bmc=bogus_bmc_hostname
|
||||
check:rc == 0
|
||||
cmd:lsdef $$CN -i bmc -c
|
||||
check:rc == 0
|
||||
cmd:rspconfig $$CN hostname=*
|
||||
check:rc == 0
|
||||
check:output =~$$CN: BMC hostname: bogus_bmc_hostname
|
||||
cmd:makehosts -d bogus_bmc_hostname
|
||||
check:rc == 0
|
||||
cmd:rmdef bogus_bmc_hostname
|
||||
check:rc == 0
|
||||
cmd:rmdef $$CN
|
||||
check:rc == 0
|
||||
cmd:cat /tmp/rspconfig_set_hostname_equal_star_with_bmc_is_hostname/$$CN.stanza |mkdef -z
|
||||
check:rc == 0
|
||||
cmd:rm -rf /tmp/rspconfig_set_hostname_equal_star_with_bmc_is_hostname
|
||||
check:rc == 0
|
||||
end
|
||||
|
||||
start:rspconfig_get_hostname
|
||||
description:To test get bmc hostname by rspconfig.
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:mkdir -p /tmp/rspconfig_get_hostname
|
||||
check:rc == 0
|
||||
cmd:rspconfig $$CN sshcfg
|
||||
check:rc == 0
|
||||
cmd:ssh __GETNODEATTR($$CN,bmc)__ "hostname" | tee /tmp/rspconfig_get_hostname/working_hostname
|
||||
check:rc == 0
|
||||
cmd:cat /tmp/rspconfig_get_hostname/working_hostname
|
||||
check:rc == 0
|
||||
cmd:rspconfig $$CN hostname |tee /tmp/rspconfig_get_hostname/rspconfig_output
|
||||
check:rc == 0
|
||||
cmd:awk -F':' '/BMC hostname/ {print $3}' /tmp/rspconfig_get_hostname/rspconfig_output |sed s/\\s//g > /tmp/rspconfig_get_hostname/rspconfig_get_hostname
|
||||
check:rc == 0
|
||||
cmd:cat /tmp/rspconfig_get_hostname/rspconfig_get_hostname
|
||||
cmd:diff /tmp/rspconfig_get_hostname/working_hostname /tmp/rspconfig_get_hostname/rspconfig_get_hostname
|
||||
check:rc == 0
|
||||
cmd:rm -rf /tmp/rspconfig_get_hostname
|
||||
check:rc == 0
|
||||
end
|
||||
|
||||
start:rspconfig_hostname_with_error_input
|
||||
description: To test <get node hostname> with error input, should throw out error message
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN hostname bogus
|
||||
check:output =~Error: Unsupported command
|
||||
check:rc != 0
|
||||
cmd:rspconfig $$CN bogus hostname
|
||||
check:output =~Error: Unsupported command
|
||||
check:rc != 0
|
||||
cmd:rspconfig $$CN hostname=
|
||||
check:output =~Error: Invalid parameter for option hostname
|
||||
check:rc != 0
|
||||
end
|
||||
|
||||
start:rspconfig_set_hostname
|
||||
description:To test set bmc hostname by rspconfig
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:mkdir -p /tmp/rspconfig_set_hostname
|
||||
check:rc == 0
|
||||
cmd:rspconfig $$CN sshcfg
|
||||
check:rc == 0
|
||||
cmd:ssh __GETNODEATTR($$CN,bmc)__ "hostname" | tee /tmp/rspconfig_set_hostname/working_hostname
|
||||
check:rc == 0
|
||||
cmd:cat /tmp/rspconfig_set_hostname/working_hostname
|
||||
check:rc == 0
|
||||
cmd:a=$(cat /tmp/rspconfig_set_hostname/working_hostname); rspconfig $$CN hostname=test_$a |tee /tmp/rspconfig_set_hostname/rspconfig_output
|
||||
check:rc == 0
|
||||
cmd:awk -F':' '/BMC hostname/ {print $3}' /tmp/rspconfig_set_hostname/rspconfig_output |sed s/\\s//g > /tmp/rspconfig_set_hostname/rspconfig_get_hostname
|
||||
check:rc == 0
|
||||
cmd:ssh __GETNODEATTR($$CN,bmc)__ "hostname" | tee /tmp/rspconfig_set_hostname/new_working_hostname
|
||||
check:rc == 0
|
||||
cmd:diff /tmp/rspconfig_set_hostname/rspconfig_get_hostname /tmp/rspconfig_set_hostname/new_working_hostname
|
||||
check:rc == 0
|
||||
cmd:diff /tmp/rspconfig_set_hostname/new_working_hostname /tmp/rspconfig_set_hostname/working_hostname
|
||||
check:rc != 0
|
||||
cmd:a=test_$(cat /tmp/rspconfig_set_hostname/working_hostname);b=$(cat /tmp/rspconfig_set_hostname/new_working_hostname);echo "a=$a b=$b";if [ "$a" = "$b" ];then exit 0;else exit 1; fi
|
||||
check:rc == 0
|
||||
cmd:rm -rf /tmp/rspconfig_set_hostname
|
||||
check:rc == 0
|
||||
end
|
||||
|
||||
start:rspconfig_set_admin_passwd_with_error_input
|
||||
description: To test "rspconfig <node> admin_passwd=xxx,yyy". If the format of "xxx,yyy" is wrong, should throw out error message
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN admin_passwd=cluster,
|
||||
check:output =~Error: Invalid parameter for option admin_passwd
|
||||
check:rc != 0
|
||||
cmd:rspconfig $$CN admin_passwd=,cluster
|
||||
check:output =~Error: Invalid parameter for option admin_passwd
|
||||
check:rc != 0
|
||||
cmd:rspconfig $$CN admin_passwd=,
|
||||
check:output =~Error: Invalid parameter for option admin_passwd
|
||||
check:rc != 0
|
||||
cmd:rspconfig $$CN admin_passwd=
|
||||
check:output =~Error: Invalid parameter for option admin_passwd
|
||||
check:rc != 0
|
||||
cmd:rspconfig $$CN admin_passwd=;
|
||||
check:output =~Error: Invalid parameter for option admin_passwd
|
||||
check:rc != 0
|
||||
end
|
||||
|
||||
start:rspconfig_set_admin_passwd_with_error_origin_password
|
||||
description: To test "rspconfig <node> admin_passwd=xxx,yyy". If the original password is wrong, should throw out error message
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN admin_passwd=bogus__GETNODEATTR(f6u17,bmcpassword)__,cluster
|
||||
check:output =~Current BMC password is incorrect
|
||||
check:rc != 0
|
||||
end
|
||||
|
||||
start:rspconfig_sshcfg_with_error_input
|
||||
description: To test "rspconfig <node> sshcfg" with error input, should throw out error message
|
||||
os:Linux
|
||||
hcp:openbmc
|
||||
cmd:rspconfig $$CN sshcfg aaa
|
||||
check:output =~Error: Configure sshcfg must be issued without other options.
|
||||
check:rc != 0
|
||||
cmd:rspconfig $$CN hostname sshcfg
|
||||
check:output =~Error: Configure sshcfg must be issued without other options.
|
||||
check:rc != 0
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user