From 87073e8c261be404cfddd9f6fff5636647d970cc Mon Sep 17 00:00:00 2001 From: junxiawang Date: Mon, 8 May 2017 07:30:48 -0400 Subject: [PATCH 1/5] modify bmcdiscover and rsetboot testcase according to p9 test --- .../autotest/testcase/bmcdiscover/cases0 | 6 +- xCAT-test/autotest/testcase/rsetboot/cases0 | 65 +++++++++++++++++-- 2 files changed, 61 insertions(+), 10 deletions(-) diff --git a/xCAT-test/autotest/testcase/bmcdiscover/cases0 b/xCAT-test/autotest/testcase/bmcdiscover/cases0 index 25170a1b9..dd7b30104 100644 --- a/xCAT-test/autotest/testcase/bmcdiscover/cases0 +++ b/xCAT-test/autotest/testcase/bmcdiscover/cases0 @@ -49,19 +49,19 @@ checkout:output=~xCAT Version end start:bmcdiscover_check_paswd -cmd:bmcdiscover -i $$bmcrange -u USERID -p PASSW0RD --check +cmd:bmcdiscover -i $$bmcrange -u $$bmcusername -p $$bmcpasswd --check check:rc==0 check:output=~Correct ADMINISTRATOR end start:bmcdiscover_check_passwd_wrong -cmd:bmcdiscover -i $$bmcrange -u USERID -p PASSW0RDw --check +cmd:bmcdiscover -i $$bmcrange -u $$bmcusername -p $$bmcpasswd --check check:rc!=0 check:output=~Error: Wrong BMC password end start:bmcdiscover_get_ipsource -cmd:bmcdiscover -i $$bmcrange -u USERID -p PASSW0RD --ipsource +cmd:bmcdiscover -i $$bmcrange -u $$bmcusername -p $$bmcpasswd --ipsource check:rc==0 check:output=~Static Address end diff --git a/xCAT-test/autotest/testcase/rsetboot/cases0 b/xCAT-test/autotest/testcase/rsetboot/cases0 index a5a3f0a0a..3608196cb 100644 --- a/xCAT-test/autotest/testcase/rsetboot/cases0 +++ b/xCAT-test/autotest/testcase/rsetboot/cases0 @@ -1,45 +1,69 @@ start:rsetboot_hd_statcheck description:set the boot device from hd Attribute: $$CN-The operation object of rsetboot command. +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +check:rc==0 cmd:rsetboot $$CN hd check:rc==0 check:output=~Hard Drive cmd:rsetboot $$CN stat check:rc==0 check:output=~$$CN: Hard Drive +cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +check:rc==0 +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +check:rc==0 end start:rsetboot_net_statcheck description:set the boot device from net Attribute: $$CN-The operation object of rsetboot command. +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +check:rc==0 cmd:rsetboot $$CN net check:rc==0 check:output=~Network cmd:rsetboot $$CN stat check:rc==0 check:output=~$$CN: Network +cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +check:rc==0 +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +check:rc==0 end start:rsetboot_cd_statcheck description:set the boot device from CD/DVD Attribute: $$CN-The operation object of rsetboot command. +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +check:rc==0 cmd:rsetboot $$CN cd check:rc==0 check:output=~CD/DVD cmd:rsetboot $$CN stat check:rc==0 check:output=~$$CN: CD/DVD +cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +check:rc==0 +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +check:rc==0 end start:rsetboot_default_statcheck description:set the boot device default Attribute: $$CN-The operation object of rsetboot command. +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +check:rc==0 cmd:rsetboot $$CN default check:rc==0 check:output=~boot override inactive cmd:rsetboot $$CN stat check:rc==0 check:output=~$$CN: boot override inactive +cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +check:rc==0 +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +check:rc==0 end start:rsetboot_h @@ -62,22 +86,33 @@ cmd:rsetboot -v check:rc==0 check:output=~Version end - start:rsetboot_node_invalidnode desription:rsetboot using invalidenode cmd:rsetboot testnode boot check:rc!=0 -check:output=~Error: Invalid nodes end start:rsetboot_noderange_net description:rsetboot noderange net -Attribute: $$CN,$$BC-The operation object of rsetboot command. -cmd:rsetboot $$CN,$$BC net +Attribute: $$CN-The operation object of rsetboot command. +cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi +check:rc==0 +cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__ +check:rc==0 +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +check:rc==0 +cmd:rsetboot $$CN,testnode net check:output=~$$CN: Network -cmd:rsetboot $$CN,$$BC stat +check:output=~testnode: Error +cmd:rsetboot $$CN,testnode stat check:output=~$$CN: Network -check:output=~$$BC: Network +check:output=~testnode: Error +cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +check:rc==0 +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +check:rc==0 +cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;else rmdef testnode;fi +check:rc==0 end start:rsetboot_node_invalidaction @@ -91,8 +126,24 @@ end start:rsetboot_group_net description:rsetboot group node Attribute: $$CN-The operation object of rsetboot command. -cmd:rsetboot __GETNODEATTR($$CN,groups)__ net +cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi +check:rc==0 +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +check:rc==0 +cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__ +check:rc==0 +cmd:chdef -p -t node -o $$CN -p groups="test" +check:rc==0 +cmd:rsetboot test net check:output=~$$CN: Network cmd:rsetboot __GETNODEATTR($$CN,groups)__ stat check:output=~$$CN: Network +cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +check:rc==0 +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +check:rc==0 +cmd:chdef -p -t node -o $$CN -m groups="test" +check:rc==0 +cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;else rmdef testnode;fi +check:rc==0 end From 07e044d13f2bdf01e802f6b97b3f2e5a1a5ec935 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 9 May 2017 06:30:51 -0400 Subject: [PATCH 2/5] modify bmcdiscover and rsetboot testcase according to p9 test --- .../autotest/testcase/bmcdiscover/cases0 | 6 ++-- xCAT-test/autotest/testcase/rsetboot/cases0 | 30 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/xCAT-test/autotest/testcase/bmcdiscover/cases0 b/xCAT-test/autotest/testcase/bmcdiscover/cases0 index dd7b30104..2fe0deee6 100644 --- a/xCAT-test/autotest/testcase/bmcdiscover/cases0 +++ b/xCAT-test/autotest/testcase/bmcdiscover/cases0 @@ -55,9 +55,9 @@ check:output=~Correct ADMINISTRATOR end start:bmcdiscover_check_passwd_wrong -cmd:bmcdiscover -i $$bmcrange -u $$bmcusername -p $$bmcpasswd --check -check:rc!=0 -check:output=~Error: Wrong BMC password +cmd:bmcdiscover -i $$bmcrange -u $$bmcusername -p test$$bmcpasswd --check +check:rc==0 +check:output=~Invalid username or password end start:bmcdiscover_get_ipsource diff --git a/xCAT-test/autotest/testcase/rsetboot/cases0 b/xCAT-test/autotest/testcase/rsetboot/cases0 index 3608196cb..3a39ebf6a 100644 --- a/xCAT-test/autotest/testcase/rsetboot/cases0 +++ b/xCAT-test/autotest/testcase/rsetboot/cases0 @@ -1,7 +1,7 @@ start:rsetboot_hd_statcheck description:set the boot device from hd Attribute: $$CN-The operation object of rsetboot command. -cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; check:rc==0 cmd:rsetboot $$CN hd check:rc==0 @@ -11,14 +11,14 @@ check:rc==0 check:output=~$$CN: Hard Drive cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 -cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 end start:rsetboot_net_statcheck description:set the boot device from net Attribute: $$CN-The operation object of rsetboot command. -cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; check:rc==0 cmd:rsetboot $$CN net check:rc==0 @@ -28,14 +28,14 @@ check:rc==0 check:output=~$$CN: Network cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 -cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 end start:rsetboot_cd_statcheck description:set the boot device from CD/DVD Attribute: $$CN-The operation object of rsetboot command. -cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; check:rc==0 cmd:rsetboot $$CN cd check:rc==0 @@ -45,14 +45,14 @@ check:rc==0 check:output=~$$CN: CD/DVD cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 -cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 end start:rsetboot_default_statcheck description:set the boot device default Attribute: $$CN-The operation object of rsetboot command. -cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +cmd:if [[ -f /tmp/rsetboot.stat ]];then -f mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; check:rc==0 cmd:rsetboot $$CN default check:rc==0 @@ -62,7 +62,7 @@ check:rc==0 check:output=~$$CN: boot override inactive cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 -cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 end @@ -99,7 +99,7 @@ cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/te check:rc==0 cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__ check:rc==0 -cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; check:rc==0 cmd:rsetboot $$CN,testnode net check:output=~$$CN: Network @@ -109,7 +109,7 @@ check:output=~$$CN: Network check:output=~testnode: Error cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 -cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;else rmdef testnode;fi check:rc==0 @@ -128,21 +128,21 @@ description:rsetboot group node Attribute: $$CN-The operation object of rsetboot command. cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi check:rc==0 -cmd:if [[ -f /tmp/rsetboot.stat ]];then mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; check:rc==0 cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__ check:rc==0 -cmd:chdef -p -t node -o $$CN -p groups="test" +cmd:chdef -p -t node -o $$CN groups="test" check:rc==0 cmd:rsetboot test net check:output=~$$CN: Network -cmd:rsetboot __GETNODEATTR($$CN,groups)__ stat +cmd:rsetboot test stat check:output=~$$CN: Network cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 -cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi +cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 -cmd:chdef -p -t node -o $$CN -m groups="test" +cmd:chdef -m -t node -o $$CN groups="test" check:rc==0 cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;else rmdef testnode;fi check:rc==0 From b22c751d64d9b25b6ef5d8789603198616703789 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 9 May 2017 07:58:06 -0400 Subject: [PATCH 3/5] modify bmcdiscover and rsetboot testcase according to p9 test --- xCAT-test/autotest/testcase/bmcdiscover/cases0 | 2 +- xCAT-test/autotest/testcase/rsetboot/cases0 | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/xCAT-test/autotest/testcase/bmcdiscover/cases0 b/xCAT-test/autotest/testcase/bmcdiscover/cases0 index 2fe0deee6..2c05b3904 100644 --- a/xCAT-test/autotest/testcase/bmcdiscover/cases0 +++ b/xCAT-test/autotest/testcase/bmcdiscover/cases0 @@ -57,7 +57,7 @@ end start:bmcdiscover_check_passwd_wrong cmd:bmcdiscover -i $$bmcrange -u $$bmcusername -p test$$bmcpasswd --check check:rc==0 -check:output=~Invalid username or password +check:output=~Invalid username or password | Wrong BMC password end start:bmcdiscover_get_ipsource diff --git a/xCAT-test/autotest/testcase/rsetboot/cases0 b/xCAT-test/autotest/testcase/rsetboot/cases0 index 3a39ebf6a..5d200db6a 100644 --- a/xCAT-test/autotest/testcase/rsetboot/cases0 +++ b/xCAT-test/autotest/testcase/rsetboot/cases0 @@ -9,7 +9,7 @@ check:output=~Hard Drive cmd:rsetboot $$CN stat check:rc==0 check:output=~$$CN: Hard Drive -cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 @@ -26,7 +26,7 @@ check:output=~Network cmd:rsetboot $$CN stat check:rc==0 check:output=~$$CN: Network -cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 @@ -43,7 +43,7 @@ check:output=~CD/DVD cmd:rsetboot $$CN stat check:rc==0 check:output=~$$CN: CD/DVD -cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 @@ -60,7 +60,7 @@ check:output=~boot override inactive cmd:rsetboot $$CN stat check:rc==0 check:output=~$$CN: boot override inactive -cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 @@ -107,11 +107,11 @@ check:output=~testnode: Error cmd:rsetboot $$CN,testnode stat check:output=~$$CN: Network check:output=~testnode: Error -cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 -cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;else rmdef testnode;fi +cmd:rmdef testnode;if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi check:rc==0 end @@ -138,12 +138,12 @@ cmd:rsetboot test net check:output=~$$CN: Network cmd:rsetboot test stat check:output=~$$CN: Network -cmd:if [[ `cat /tmp/rsetboot.stat |grep CD` ]];then rsetboot $$CN cd;elif [[ `cat /tmp/rsetboot.stat |grep Network ` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi +cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi check:rc==0 cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi check:rc==0 cmd:chdef -m -t node -o $$CN groups="test" check:rc==0 -cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;else rmdef testnode;fi +cmd:rmdef testnode;if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi check:rc==0 end From 2b9aef9a439de1c3312e294046aa2f789829e52d Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 9 May 2017 08:04:46 -0400 Subject: [PATCH 4/5] modify bmcdiscover and rsetboot testcase according to p9 test --- xCAT-test/autotest/testcase/rsetboot/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/rsetboot/cases0 b/xCAT-test/autotest/testcase/rsetboot/cases0 index 5d200db6a..c6d82e289 100644 --- a/xCAT-test/autotest/testcase/rsetboot/cases0 +++ b/xCAT-test/autotest/testcase/rsetboot/cases0 @@ -52,7 +52,7 @@ end start:rsetboot_default_statcheck description:set the boot device default Attribute: $$CN-The operation object of rsetboot command. -cmd:if [[ -f /tmp/rsetboot.stat ]];then -f mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; check:rc==0 cmd:rsetboot $$CN default check:rc==0 From 780a70115367cafa8567219776e1f038a8fdda78 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 9 May 2017 08:36:31 -0400 Subject: [PATCH 5/5] modify bmcdiscover and rsetboot testcase according to p9 test --- xCAT-test/autotest/testcase/rsetboot/cases0 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/rsetboot/cases0 b/xCAT-test/autotest/testcase/rsetboot/cases0 index c6d82e289..63b280588 100644 --- a/xCAT-test/autotest/testcase/rsetboot/cases0 +++ b/xCAT-test/autotest/testcase/rsetboot/cases0 @@ -52,7 +52,7 @@ end start:rsetboot_default_statcheck description:set the boot device default Attribute: $$CN-The operation object of rsetboot command. -cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f mv /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; +cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat; check:rc==0 cmd:rsetboot $$CN default check:rc==0