update
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10127 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
a4faac7b2b
commit
69d65f8ae7
130
xCAT-test/autotest/testcase/xcatstanzafile/cases0
Normal file
130
xCAT-test/autotest/testcase/xcatstanzafile/cases0
Normal file
@ -0,0 +1,130 @@
|
||||
start:xcatstanzafile_normal
|
||||
description:xcatstanzafile in normal format
|
||||
cmd:echo -e "default-node:\n groups=all,compute\ntestnode:\n objtype=node\n xcatmaster=MS02.ppd.pok.com\n nfsserver=IS227.ppd.pok.com" > testfile
|
||||
check:rc==0
|
||||
cmd:cat testfile|chdef -z
|
||||
check:rc==0
|
||||
cmd:lsdef testnode
|
||||
check:output=~groups=all,compute
|
||||
check:output=~xcatmaster=MS02.ppd.pok.com
|
||||
check:output=~nfsserver=IS227.ppd.pok.com
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rm -f testfile
|
||||
end
|
||||
|
||||
start:xcatstanzafile_colon
|
||||
description:xcatstanzafile's header without colon
|
||||
cmd:echo -e "default-node:\n groups=all,compute\ntestnode\n objtype=node\n xcatmaster=MS02.ppd.pok.com\n nfsserver=IS227.ppd.pok.com" > testfile
|
||||
check:rc==0
|
||||
cmd:cat testfile|chdef -z
|
||||
check:rc!=0
|
||||
cmd:lsdef testnode
|
||||
check:output=~Could not find an object named 'testnode' of type 'node'.
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rm -f testfile
|
||||
end
|
||||
|
||||
|
||||
start:xcatstanzafile_attribute
|
||||
description:xcatstanzafile with error attribute line
|
||||
cmd:echo -e "default-node:\n groups=all,compute\ntestnode:\n objtype=node\n xcatmasterMS02.ppd.pok.com\n nfsserver=IS227.ppd.pok.com" > testfile
|
||||
check:rc==0
|
||||
cmd:cat testfile|chdef -z
|
||||
cmd:lsdef testnode
|
||||
check:output!~xcatmaster=MS02.ppd.pok.com
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rm -f testfile
|
||||
cmd:echo -e "default-node:\n groups=all,compute\ntestnode:\n objtype=node\n xcatmaster=\n nfsserver=IS227.ppd.pok.com" > testfile
|
||||
check:rc==0
|
||||
cmd:cat testfile|chdef -z
|
||||
cmd:lsdef testnode
|
||||
check:output!~xcatmaster=
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rm -f testfile
|
||||
cmd:echo -e "default-node:\n groups=all,compute\ntestnode\n objtype=node\n =MS02.ppd.pok.com\n nfsserver=IS227.ppd.pok.com" > testfile
|
||||
check:rc==0
|
||||
cmd:cat testfile|chdef -z
|
||||
cmd:lsdef testnode
|
||||
check:output!~=MS02.ppd.pok.com
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rm -f testfile
|
||||
end
|
||||
|
||||
start:xcatstanzafile_objtype
|
||||
description:xcatstanzafile,a stanza without objtype definition
|
||||
cmd:echo -e "default-node:\n groups=all,compute\ntestnode:\n xcatmaster=MS02.ppd.pok.com\n nfsserver=IS227.ppd.pok.com" > testfile
|
||||
check:rc==0
|
||||
cmd:cat testfile|mkdef -z
|
||||
check:rc!=0
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rm -f testfile
|
||||
end
|
||||
|
||||
|
||||
#start:xcatstanzafile_comment
|
||||
#description:xcatstanzafile,a stanza without objtype definition
|
||||
#cmd:echo -ne "default-node:\n groups=all,compute\ntestnode:\n objtype=node\n xcatmaster=MS02.ppd.pok.com\n nfsserver=IS227.ppd.pok.com" > testfile
|
||||
#check:rc==0
|
||||
#cmd:echo '#abc' >> testfile
|
||||
#cmd:cat testfile|mkdef -z
|
||||
#check:rc!=0
|
||||
#cmd:rmdef -t node testnode
|
||||
#cmd:rm -f testfile
|
||||
#end
|
||||
|
||||
|
||||
start:xcatstanzafile_tab
|
||||
description:xcatstanzafile,line with tab and space
|
||||
cmd:echo -e "default-node:\n groups=all,compute\ntestnode:\n objtype=node\n xcatmaster = MS02.ppd.pok.com\n nfsserver=IS227.ppd.pok.com" > testfile
|
||||
check:rc==0
|
||||
cmd:cat testfile|mkdef -z
|
||||
check:rc==0
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rm -f testfile
|
||||
end
|
||||
|
||||
|
||||
start:xcatstanzafile_multattr
|
||||
description:xcatstanzafile,line with multiple attribute
|
||||
cmd:echo -e "default-node:\n groups=all,compute\ntestnode:\n objtype=node\n xcatmaster= MS02.ppd.pok.com nfsserver=IS227.ppd.pok.com" > testfile
|
||||
check:rc==0
|
||||
cmd:cat testfile|mkdef -z
|
||||
check:rc==0
|
||||
cmd:lsdef testnode
|
||||
check:output=~\s*xcatmaster=MS02.ppd.pok.com\s*nfsserver=IS227.ppd.pok.com
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rm -f testfile
|
||||
end
|
||||
|
||||
|
||||
start:xcatstanzafile_defaultvalue
|
||||
description:xcatstanzafile,If the header name is ``default-<object type>:'' the attribute values in the stanza are considered default values for subsequent definitions in the file that are the same object type.
|
||||
cmd:echo -e "default-node:\n groups=all,compute\ntestnode:\n objtype=node\n xcatmaster= MS02.ppd.pok.com\n nfsserver=IS227.ppd.pok.com" > testfile
|
||||
check:rc==0
|
||||
cmd:cat testfile|mkdef -z
|
||||
check:rc==0
|
||||
cmd:lsdef testnode
|
||||
check:output=~groups=all,compute
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rm -f testfile
|
||||
end
|
||||
|
||||
|
||||
start:xcatstanzafile_specificvalue
|
||||
description:When a specific value for an attribute is provided in the stanza, it takes priority over any default value that had been set.
|
||||
cmd:echo -e "default-node:\n groups=all,compute\ntestnode:\n objtype=node\n groups=all,rhels5.5\n xcatmaster= MS02.ppd.pok.com\n nfsserver=IS227.ppd.pok.com" > testfile
|
||||
check:rc==0
|
||||
cmd:cat testfile|mkdef -z
|
||||
check:rc==0
|
||||
cmd:lsdef testnode
|
||||
check:output=~groups=all,rhels5.5
|
||||
cmd:rmdef -t node testnode
|
||||
cmd:rm -f testfile
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user