2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

add cases for issue 4085 :

Usage: chdef - Change xCAT data object definitions.

  chdef [-h | --help ] [-t object-types]

  chdef [-t object-types] [-o object-names] [-n new-name] [node]

  chdef [-V | --verbose] [-t object-types] [-o object-names] [-d | --dynamic]
    [-z | --stanza] [-m | --minus] [-p | --plus]
    [-w attr==val [-w attr=~val] ... ] [noderange] [attr=val [attr=val...]]

The following data object types are supported by xCAT:

auditlog,boottarget,eventlog,firmware,group,kit,kitcomponent,kitrepo,monitoring,network,node,notification,osdistro,osdistroupdate,osimage,pdu,policy,rack,route,site,taskstate,zone,zvmivp

Use the '-h' option together with the '-t' option to
 get a list of valid attribute names for each object type. fails without  and  parameters
This commit is contained in:
litingt 2018-12-16 22:19:48 -05:00
parent 339cefc5de
commit c13741c010

View File

@ -273,3 +273,46 @@ check:output=~300
cmd:if [ -f /tmp/sitevalue ];then var=`cat /tmp/sitevalue`;chdef -t site clustersite dhcplease=$var;rm -rf /tmp/sitevalue;fi
check:rc==0
end
start:chdef_network_not_exist
description:This case is use to create a network, but not set net and mask.
label:mn_only,db
cmd:chdef -t network aaaaa_not_exist
check:output=~No object definitions have been created or modified
#check:rc!=0
cmd:chdef -t network aaaaa_not_exist mtu=1500
check:rc!=0
check:output=~Net or mask value should not be empty
cmd:chdef -t network aaaaa_not_exist mtu=1500 net=10.0.0.0
check:rc!=0
check:output=~Net or mask value should not be empty
cmd:chdef -t network aaaaa_not_exist mtu=1500 mask=255.255.255.0
check:rc!=0
check:output=~Net or mask value should not be empty
cmd:chdef -t network aaaaa_not_exist mask=255.255.255.0 net=100.0.0.0 mtu=1500
check:rc==0
check:output=~1 object definitions have been created or modified
cmd:lsdef -t network aaaaa_not_exist
check:rc==0
cmd:chdef -t network aaaaa_not_exist gateway=10.0.0.101
check:rc==0
cmd:lsdef -t network aaaaa_not_exist -i gateway
check:output=~10.0.0.101
cmd:chdef -t network bbbbb_not_exist mask=255.255.255.0 net=100.0.0.0
check:rc!=0
check:output=~A network definition called 'aaaaa_not_exist' already exists
cmd:echo '
bbbbb_not_exist:
objtype=network
net=150.0.0.0
' > /tmp/bbbbb_not_exist.def
cmd:cat /tmp/bbbbb_not_exist.def |mkdef -z
check:rc!=0
check:output=~Net or mask value should not be empty
cmd:lsdef -t network -o bbbbb_not_exist
check:rc!=0
cmd:rmdef -t network -o aaaaa_not_exist
check:rc==0
cmd:rm -rf /tmp/bbbbb_not_exist.def
end