From e4c231b6170f9556509001d0a75940c590464d2a Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Mon, 4 Jul 2016 02:12:27 -0400 Subject: [PATCH 1/7] complete lsdef cases --- xCAT-test/autotest/testcase/lsdef/cases0 | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/xCAT-test/autotest/testcase/lsdef/cases0 b/xCAT-test/autotest/testcase/lsdef/cases0 index c002bdd06..dc466dd30 100644 --- a/xCAT-test/autotest/testcase/lsdef/cases0 +++ b/xCAT-test/autotest/testcase/lsdef/cases0 @@ -209,3 +209,43 @@ check:rc==0 cmd:lsdef testnode1 check:output=~Could not find end + +start:lsdef_template +os:linux +description:check xCAT supported template +cmd:lsdef --template +check:rc==0 +check:output=~hmc\-template \(node\) +check:output=~ppc64le\-template \(node\) +check:output=~ppc64lekvmguest\-template \(node\) +check:output=~switch\-template \(node\) +check:output=~x86_64\-template \(node\) +check:output=~x86_64kvmguest\-template \(node\) +end + +start:lsdef_template_switch_template +os:linux +description:check xCAT supported template for switch template +cmd:lsdef --template switch-template +check:rc==0 +check:output=~Object name\: switch-template +check:output=~groups=switch +check:output=~nodetype=switch +check:output=~postbootscripts\=otherpkgs +check:output=~postscripts\=syslog\,remoteshell\,syncfiles +check:output=~usercomment\=the switch definition template +check:output=~postscripts\=syslog\,remoteshell\,syncfiles +check:output=~ip\=OPTIONAL\:the ip address of the switch +check:output=~mac\=OPTIONAL\:the MAC address of the switch +check:output=~switchtype\=OPTIONAL\:The type of switch +end + +start:lsdef_template_with_invalid_name +os:linux +description:lsdef --template with invalid template name +cmd:lsdef --template | grep "test_with_invalid_name" +check:rc==1 +cmd:lsdef --template "test_with_invalid_name" +check:rc==1 +check:output=~Error: Could not find test_with_invalid_name in xCAT templates. +end From e1c5bb103321cb0373d0f130a1298d76386a0204 Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Mon, 4 Jul 2016 04:58:16 -0400 Subject: [PATCH 2/7] complete mkdef test cases --- xCAT-test/autotest/testcase/mkdef/cases0 | 122 +++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/xCAT-test/autotest/testcase/mkdef/cases0 b/xCAT-test/autotest/testcase/mkdef/cases0 index 1419103f2..a0363af14 100644 --- a/xCAT-test/autotest/testcase/mkdef/cases0 +++ b/xCAT-test/autotest/testcase/mkdef/cases0 @@ -159,4 +159,126 @@ check:output=~not a valid end +start:mkdef_template_switch_template_without_attribute +os:linux +description:create a node with swtich template without any attributes +cmd:result=`lsdef | grep auto_test_node_1`; if [[ $result =~ "auto_test_node_1" ]]; then echo $result; noderm auto_test_node_1; fi +cmd:mkdef -t node -o auto_test_node_1 --template switch-template +check:rc==0 +check:output=~1 object definitions have been created or modified. +cmd:lsdef auto_test_node_1 +check:rc==0 +check:output=~Object name\: auto_test_node_1 +check:output=~groups=switch +check:output=~nodetype=switch +check:output=~postbootscripts\=otherpkgs +check:output=~postscripts\=syslog\,remoteshell\,syncfiles +check:output=~usercomment\=the switch definition template +check:output=~postscripts\=syslog\,remoteshell\,syncfiles +check:output!=ip\=OPTIONAL\:the ip address of the switch +check:output!=mac\=OPTIONAL\:the MAC address of the switch +check:output!=switchtype\= +cmd:noderm auto_test_node_1 +check:rc==0 +end +start:mkdef_template_cec_template_without_remainder +os:linux +description:create a node with cec template once +cmd:result=`lsdef | grep auto_test_cec_node_1`; if [[ $result =~ "auto_test_cec_node_1" ]]; then echo $result; noderm auto_test_cec_node_1; fi +cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test mtm=test hcp=test +check:rc==0 +check:output=~1 object definitions have been created or modified +cmd:lsdef auto_test_cec_node_1 +check:output=~Object name\: auto\_test\_cec\_node\_1 +check:output=~groups\=cec\,all +check:output=~hwtype\=cec +check:output=~mgt\=hmc +check:output=~nodetype\=ppc +check:output=~postbootscripts\=otherpkgs +check:output=~postscripts\=syslog\,remoteshell\,syncfiles +check:output=~usercomment\=the cec definition template +check:output=~hcp\=test +check:output=~mtm\=test +check:output=~serial\=test +cmd:noderm auto_test_cec_node_1 +check:rc==0 +end + +start:mkdef_template_invalid_template +os:linux +description:create a node with invalid template +cmd:result=`lsdef | grep auto_test_node`; if [[ $result =~ "auto_test_node" ]]; then echo $result; noderm auto_test_node; fi +cmd:result=`lsdef | grep auto_test_invalid_template`; if [[ $result =~ "auto_test_invalid_template" ]]; then echo $result; noderm auto_test_invalid_template; fi +cmd:lsdef --template auto_test_invalid_template +check:rc==1 +check:output=~Error\: Could not find auto\_test\_invalid\_template in xCAT templates +cmd:mkdef -t node -o auto_test_node --template auto_test_invalid_template +check:rc==1 +check:output=~Error\: Could not find the template object named \'auto\_test\_invalid\_template\' of type \'node\' +end + +start:mkdef_node_with_a_node_template +os:linux +description:create a node with a node template, using cec template to create node at beginning +cmd:result=`lsdef | grep auto_test_cec_node_1`; if [[ $result =~ "auto_test_cec_node_1" ]]; then echo $result; noderm auto_test_cec_node_1; fi +cmd:result=`lsdef | grep auto_test_cec_node_2`; if [[ $result =~ "auto_test_cec_node_2" ]]; then echo $result; noderm auto_test_cec_node_2; fi +cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test mtm=test hcp=test groups=test_template +check:rc==0 +check:output=~1 object definitions have been created or modified +check:chdef -t node auto_test_cec_node_1 -o groups=test_template +check:rc==0 +check:output=~created +cmd:mkdef -t node -o auto_test_cec_node_2 --template auto_test_cec_node_1 serial=test2 mtm=test2 hcp=test2 +check:rc==0 +check:output=~1 object definitions have been created or modified +cmd:lsdef auto_test_cec_node_2 +check:output=~Object name\: auto\_test\_cec\_node\_2 +check:output=~groups\=test\_template +check:output!=groups\=cec\,all +check:output=~hwtype\=cec +check:output=~mgt\=hmc +check:output=~nodetype\=ppc +check:output=~postbootscripts\=otherpkgs +check:output=~postscripts\=syslog\,remoteshell\,syncfiles +check:output=~usercomment\=the cec definition template +check:output=~hcp\=test2 +check:output=~mtm\=test2 +check:output=~serial\=test2 +cmd:noderm auto_test_cec_node_1 +check:rc==0 +cmd:noderm auto_test_cec_node_2 +check:rc==0 +end + +start:mkdef_template_cec_template_step_by_step +os:linux +description:create a node with cec template step by step +cmd:result=`lsdef | grep auto_test_cec_node_1`; if [[ $result =~ "auto_test_cec_node_1" ]]; then echo $result; noderm auto_test_cec_node_1; fi +cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template +check:rc==1 +check:output=~Error\: The attribute \"serial\" must be specified! +cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test +check:rc==1 +check:output=~Error\: The attribute \"mtm\" must be specified! +cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test mtm=test +check:rc==1 +check:output=~Error\: The attribute \"hcp\" must be specified! +cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test mtm=test hcp=test +check:rc==0 +check:output=~1 object definitions have been created or modified +cmd:lsdef auto_test_cec_node_1 +check:output=~Object name\: auto\_test\_cec\_node\_1 +check:output=~groups\=cec\,all +check:output=~hwtype\=cec +check:output=~mgt\=hmc +check:output=~nodetype\=ppc +check:output=~postbootscripts\=otherpkgs +check:output=~postscripts\=syslog\,remoteshell\,syncfiles +check:output=~usercomment\=the cec definition template +check:output=~hcp\=test +check:output=~mtm\=test +check:output=~serial\=test +cmd:noderm auto_test_cec_node_1 +check:rc==0 +end From 79ad627c441bb68df6188f915121954b0cb5ef59 Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Mon, 4 Jul 2016 05:10:36 -0400 Subject: [PATCH 3/7] add mkdef new case --- xCAT-test/autotest/testcase/mkdef/cases0 | 33 ++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/mkdef/cases0 b/xCAT-test/autotest/testcase/mkdef/cases0 index a0363af14..99e272667 100644 --- a/xCAT-test/autotest/testcase/mkdef/cases0 +++ b/xCAT-test/autotest/testcase/mkdef/cases0 @@ -226,8 +226,6 @@ cmd:result=`lsdef | grep auto_test_cec_node_2`; if [[ $result =~ "auto_test_cec cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test mtm=test hcp=test groups=test_template check:rc==0 check:output=~1 object definitions have been created or modified -check:chdef -t node auto_test_cec_node_1 -o groups=test_template -check:rc==0 check:output=~created cmd:mkdef -t node -o auto_test_cec_node_2 --template auto_test_cec_node_1 serial=test2 mtm=test2 hcp=test2 check:rc==0 @@ -282,3 +280,34 @@ check:output=~serial\=test cmd:noderm auto_test_cec_node_1 check:rc==0 end + +start:check_mkdef_node_with_template_priority +os:linux +description:create node named cec-template with cec template at beginning, the node is priority high than tempalate to create a new node +cmd:result=`lsdef | grep cec-template`; if [[ $result =~ "cec-template" ]]; then echo $result; noderm cec-template; fi +cmd:result=`lsdef | grep auto_test_cec_node`; if [[ $result =~ "auto_test_cec_node" ]]; then echo $result; noderm auto_test_cec_node; fi +cmd:mkdef -t node -o cec-template --template cec-template serial=test mtm=test hcp=test groups=test_template_priority +check:rc==0 +check:output=~1 object definitions have been created or modified +cmd:mkdef -t node -o auto_test_cec_node --template cec-template serial=test2 mtm=test2 hcp=test2 +check:rc==0 +check:output=~1 object definitions have been created or modified +cmd:lsdef auto_test_cec_node +check:output=~Object name\: auto\_test\_cec\_node\_2 +check:output=~groups\=test\_template\_priority +check:output!=groups\=cec\,all +check:output=~hwtype\=cec +check:output=~mgt\=hmc +check:output=~nodetype\=ppc +check:output=~postbootscripts\=otherpkgs +check:output=~postscripts\=syslog\,remoteshell\,syncfiles +check:output=~usercomment\=the cec definition template +check:output=~hcp\=test2 +check:output=~mtm\=test2 +check:output=~serial\=test2 +cmd:noderm cec-template +check:rc==0 +cmd:noderm auto_test_cec_node +check:rc==0 +end + From acd85daaf3c3cde917093cbc6e2668aa007042f0 Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Mon, 4 Jul 2016 05:31:07 -0400 Subject: [PATCH 4/7] update failed issues --- xCAT-test/autotest/testcase/mkdef/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/mkdef/cases0 b/xCAT-test/autotest/testcase/mkdef/cases0 index 99e272667..83baef541 100644 --- a/xCAT-test/autotest/testcase/mkdef/cases0 +++ b/xCAT-test/autotest/testcase/mkdef/cases0 @@ -293,7 +293,7 @@ cmd:mkdef -t node -o auto_test_cec_node --template cec-template serial=test2 mtm check:rc==0 check:output=~1 object definitions have been created or modified cmd:lsdef auto_test_cec_node -check:output=~Object name\: auto\_test\_cec\_node\_2 +check:output=~Object name\: auto\_test\_cec\_node check:output=~groups\=test\_template\_priority check:output!=groups\=cec\,all check:output=~hwtype\=cec From f635ae9fccd9076d2dba3ba91e48eb27ff4561c2 Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Mon, 4 Jul 2016 23:41:40 -0400 Subject: [PATCH 5/7] complete chdef mkdef cases --- xCAT-test/autotest/testcase/chdef/cases0 | 17 +++++++++++++++++ xCAT-test/autotest/testcase/rmdef/cases0 | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/xCAT-test/autotest/testcase/chdef/cases0 b/xCAT-test/autotest/testcase/chdef/cases0 index f3ad24b73..26db07053 100644 --- a/xCAT-test/autotest/testcase/chdef/cases0 +++ b/xCAT-test/autotest/testcase/chdef/cases0 @@ -222,3 +222,20 @@ cmd:chdef -t wrongtype -o testnode groups=all,aix check:rc!=0 check:output=~not a valid end + + +start:chdef_template +os:linux +description:try to change a template, a new node is created according to chdef. +cmd:result=`lsdef | grep switch-template`; if [[ $result =~ "switch-template" ]]; then echo $result; noderm switch-template; fi +cmd:chdef -t node -o switch-template groups=test +check:output=~1 object definitions have been created or modified +check:output=~New object definitions \'switch-template\' have been created +check:rc==0 +cmd:lsdef switch-template +check:output=~Object name\: switch\-template +check:output=~groups\=test +check:rc==0 +cmd:noderm switch-template +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/rmdef/cases0 b/xCAT-test/autotest/testcase/rmdef/cases0 index 8a6b9f51c..50bbe14e9 100644 --- a/xCAT-test/autotest/testcase/rmdef/cases0 +++ b/xCAT-test/autotest/testcase/rmdef/cases0 @@ -128,3 +128,13 @@ cmd:rmdef -t wrongtype -o testnode check:rc!=0 check:output=~not a valid end + +start:rmdef_template +os:linux +description:try to delete a template, then error messages appear +cmd:result=`lsdef | grep switch-template`; if [[ $result =~ "switch-template" ]]; then echo $result; noderm switch-template; fi +cmd:rmdef switch-template +check:rc==1 +check:output=~Error\: Could not find an object named \'switch-template\' of type \'node\' +check:output=~No objects have been removed from the xCAT database. +end From 4648ef53db6c7ab22e3700c45aa57b34cf3b3c5e Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Wed, 19 Oct 2016 04:47:50 -0400 Subject: [PATCH 6/7] add new check rootimgdir warning message case --- xCAT-test/autotest/testcase/mkdef/cases0 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xCAT-test/autotest/testcase/mkdef/cases0 b/xCAT-test/autotest/testcase/mkdef/cases0 index 83baef541..9595e6e22 100644 --- a/xCAT-test/autotest/testcase/mkdef/cases0 +++ b/xCAT-test/autotest/testcase/mkdef/cases0 @@ -311,3 +311,16 @@ cmd:noderm auto_test_cec_node check:rc==0 end +start:mkdef_template_diskless_osimage_rootimgdir +os:linux +description:check rootimgdir warning message after make new osimage with mkdef --template +cmd:mkdef -t osimage -o test-osimage_with_template --template __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +output=~1 object definitions have been created or modified +cmd:xcatprobe osimagecheck +check:output=~Identical root image directory +check:output=~test-osimage +check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +cmd:rmdef -t osimage -o test-osimage_with_template +check:rc==0 +end From 8745b0cd7ee744a981664c43bb6d37c701c54141 Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Tue, 25 Oct 2016 15:43:20 +0800 Subject: [PATCH 7/7] update after Jun Xia's comments --- xCAT-test/autotest/testcase/lsdef/cases0 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/lsdef/cases0 b/xCAT-test/autotest/testcase/lsdef/cases0 index dc466dd30..55e846e11 100644 --- a/xCAT-test/autotest/testcase/lsdef/cases0 +++ b/xCAT-test/autotest/testcase/lsdef/cases0 @@ -243,8 +243,7 @@ end start:lsdef_template_with_invalid_name os:linux description:lsdef --template with invalid template name -cmd:lsdef --template | grep "test_with_invalid_name" -check:rc==1 +cmd:result=`lsdef | grep test_with_invalid_name`; if [[ $result =~ "test_with_invalid_name" ]]; then noderm test_with_invalid_name; fi cmd:lsdef --template "test_with_invalid_name" check:rc==1 check:output=~Error: Could not find test_with_invalid_name in xCAT templates.