From 69d65f8ae742126782492a70a559a898ed329846 Mon Sep 17 00:00:00 2001 From: amy0701 Date: Wed, 20 Jul 2011 09:53:49 +0000 Subject: [PATCH] update git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10127 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../autotest/testcase/xcatstanzafile/cases0 | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 xCAT-test/autotest/testcase/xcatstanzafile/cases0 diff --git a/xCAT-test/autotest/testcase/xcatstanzafile/cases0 b/xCAT-test/autotest/testcase/xcatstanzafile/cases0 new file mode 100644 index 000000000..a03fc656f --- /dev/null +++ b/xCAT-test/autotest/testcase/xcatstanzafile/cases0 @@ -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-:'' 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 + + + + + + +