From e3a07ac4f2d5936c18aed9bfcbaad51527c0177b Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Tue, 13 Sep 2016 04:49:53 -0400 Subject: [PATCH] complete 9.13 --- .../autotest/testcase/install_xCAT/case0 | 21 +++++---- xCAT-test/autotest/testcase/noderange/cases0 | 12 ++--- xCAT-test/xcattest | 46 +++++++++++++------ 3 files changed, 49 insertions(+), 30 deletions(-) diff --git a/xCAT-test/autotest/testcase/install_xCAT/case0 b/xCAT-test/autotest/testcase/install_xCAT/case0 index 5c1a76a54..0047a302e 100644 --- a/xCAT-test/autotest/testcase/install_xCAT/case0 +++ b/xCAT-test/autotest/testcase/install_xCAT/case0 @@ -4,13 +4,13 @@ os:Linux stop:yes cmd:if grep "Red Hat" /etc/*release >/dev/null; then yum install -y yum-utils bzip2; fi check:rc==0 -cmd:cp /core-*-snap.tar.bz2 /xcat-core.tar.bz2 +cmd:cp /core-*-snap.tar.bz2 /install_xCAT_xcat-core.tar.bz2 check:rc==0 -cmd:cp /xcat-dep*.tar.bz2 /xcat-dep.tar.bz2 +cmd:cp /xcat-dep*.tar.bz2 /install_xCAT_xcat-dep.tar.bz2 check:rc==0 cmd:ls /go-xcat check:rc==0 -cmd:cd /; ./go-xcat --xcat-core=/xcat-core.tar.bz2 --xcat-dep=/xcat-dep.tar.bz2 -y install; +cmd:cd /; ./go-xcat --xcat-core=/install_xCAT_xcat-core.tar.bz2 --xcat-dep=/install_xCAT_xcat-dep.tar.bz2 -y install; check:rc==0 cmd:source "/etc/profile.d/xcat.sh" check:rc==0 @@ -20,23 +20,24 @@ check:output=~Version cmd:service xcatd status check:rc==0 check:output=~running -cmd:rm -rf /xcat-core.tar.bz2 /xcat-dep.tar.bz2 +cmd:rm -rf /install_xCAT_xcat-core.tar.bz2 /install_xCAT_xcat-dep.tar.bz2 end + start:install_xCAT_on_ubuntu description:install xCAT with go-xcat tool in a fresh environment for ubuntu os:Linux stop:yes -cmd:arc_all=`uname -a`; code=`lsb_release -sc`;if [[ $arc_all =~ "ppc64le" ]]; then arch="ppc64el";else arch="x86_64";fi; cp "/opt/xcat/share/xcat/tools/autotest/testcase/go-xcat/$code-$arch.sources.list" "/etc/apt/sources.list" +cmd:arc_all=`uname -a`; code=`lsb_release -sc`;if [[ $arc_all =~ "ppc64le" ]]; then arch="ppc64el";else arch="x86_64";fi; cp "/opt/xcat/share/xcat/tools/autotest/testcase/go-xcat/$code-$arch.sources.list" "/etc/apt/sources.list" cmd:apt-get clean;apt-get update check:rc==0 -cmd:cp /core-*-snap.tar.bz2 /xcat-core.tar.bz2 +cmd:cp /core-*-snap.tar.bz2 /install_xCAT_xcat-core.tar.bz2 check:rc==0 -cmd:cp /xcat-dep*.tar.bz2 /xcat-dep.tar.bz2 +cmd:cp /xcat-dep*.tar.bz2 /install_xCAT_xcat-dep.tar.bz2 check:rc==0 cmd:ls /go-xcat check:rc==0 -cmd:cd /; ./go-xcat --xcat-core=/xcat-core.tar.bz2 --xcat-dep=/xcat-dep.tar.bz2 -y install; +cmd:cd /; ./go-xcat --xcat-core=/install_xCAT_xcat-core.tar.bz2 --xcat-dep=/install_xCAT_xcat-dep.tar.bz2 -y install; check:rc==0 cmd:source "/etc/profile.d/xcat.sh" check:rc==0 @@ -46,5 +47,7 @@ check:output=~Version cmd:service xcatd status check:rc==0 check:output=~running -cmd:rm -rf /xcat-core.tar.bz2 /xcat-dep.tar.bz2 +cmd:rm -rf /install_xCAT_xcat-core.tar.bz2 /install_xCAT_xcat-dep.tar.bz2 end + + diff --git a/xCAT-test/autotest/testcase/noderange/cases0 b/xCAT-test/autotest/testcase/noderange/cases0 index c0bccfdbf..59b401628 100644 --- a/xCAT-test/autotest/testcase/noderange/cases0 +++ b/xCAT-test/autotest/testcase/noderange/cases0 @@ -31,7 +31,7 @@ cmd:rmdef -t node -o nrtestnode01-nrtestnode10 check:rc==0 end -start:noderange_node[01-10] +start:noderange_node_01-10 description: noderange node[01-10] cmd:mkdef -t node -o nrtestnode[01-10] groups=all check:rc==0 @@ -44,7 +44,7 @@ cmd:rmdef -t node -o nrtestnode[01-10] check:rc==0 end -start:noderange_node[01:10] +start:noderange_node01_10 description: noderange node[01:10] cmd:mkdef -t node -o nrtestnode[01:10] groups=all check:rc==0 @@ -57,7 +57,7 @@ cmd:rmdef -t node -o nrtestnode[01:10] check:rc==0 end -start:noderange_f[1-2]n[1-3] +start:noderange_f1-f2_n1-n3 description: noderange f[1-2]n[1-3] cmd:mkdef -t node -o f[1-2]n[1-3] groups=all check:rc==0 @@ -101,7 +101,7 @@ end #check:rc==0 #end -start:noderange_node10+3 +start:noderange_node10_plus_3 description: noderange node10+3 cmd:mkdef -t node -o nrtestnode10+3 groups=all check:rc==0 @@ -142,7 +142,7 @@ cmd: XCAT_NODE_PREFIX=abc XCAT_NODE_SUFFIX=def XCATBYPASS=1 nodels 10-20 check:output=~abc10def,abc11def,abc12def,abc13def,abc14def,abc15def,abc16def,abc17def,abc18def,abc19def,abc20def end -start:noderange_/nrtestnode.* +start:noderange_slash_urtestnode_dot_star description: noderange /nrtestnode.* cmd:mkdef -t node -o nrtestnode1-nrtestnode3 groups=all check:rc==0 @@ -155,7 +155,7 @@ cmd:rmdef -t node -o nrtestnode1-nrtestnode3 check:rc==0 end -start:noderange_/tmp/nodelistfile +start:noderange_dir_tmp-nodelistfile description: noderange ^/tmp/nodelistfile #cmd:echo #testnode1 > /tmp/nodelist cmd:mkdef -t node -o nrnode1,nrnode2 groups=all diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index d50d1a404..c0060c415 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -27,15 +27,22 @@ my $needshow = 0; my $restore = 0; my $ret = 0; my $string1 = undef; -#below System label means: only load the [System] aspects in config file -#this usage is only for the first install_xCAT cases used for xCAT daily regression -#it is a workaround to avoid change the xcattest structure, so no need to public -my $initallabel = undef; -my $loadsysteminfo = "System"; my $showbundlefiles = 0; my $showcommandslist = 0; my $stop_to_keep_env = 0; +#----------------------------------- +=head1 + System label usage: + In order to make install xCAT to be the first case for automation daily regression, "System" label is used in this xcattest command. + xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf:System -t install_xCAT_on_rhels_sles + xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf:System -t install_xCAT_on_ubuntu + System label means only the [System] aspect will be loaded and no other inital action will be done. +=cut + +#----------------------------------- +my $initallabel = undef; +my $loadsysteminfo = "System"; #Create result directory mkdir $resultdir unless -d $resultdir; @@ -77,7 +84,7 @@ if (&checkoptions) my %bundlefilesinfo = (); if ($showbundlefiles) { - &undlefiles; + &listbundlefiles; exit 0; } @@ -707,18 +714,27 @@ sub loadcase close(FILE); } + if ($needshow) { - log_this("*Test cases:"); - foreach my $case (@cases) { - log_this("$case->{name}"); - } - log_this("*Case name not supported:", @wrongnamecase); + if (@cases) { + log_this("Test cases:"); + foreach my $case (@cases) { + log_this("$case->{name}"); + } + }else { + log_this("Error: Please check the case name or command name"); + } + log_this("Case name not supported:", @wrongnamecase) if (@wrongnamecase); return 0; } - - log_this("*To run:", @rightcase) if (@rightcase); - log_this("*Not to run:", @notrightcase) if (@notrightcase); - log_this("*Case name not supported:", @wrongnamecase) if (@wrongnamecase); + + if (@rightcase) { + log_this("To run:", @rightcase); + }else { + log_this("Error: No case to run, please check the case name or command name"); + } + log_this("Not to run:", @notrightcase) if (@notrightcase); + log_this("Case name not supported:", @wrongnamecase) if (@wrongnamecase); return 0; } sub getnodeattr