diff --git a/xCAT-test/autotest/testcase/go-xcat/case4 b/xCAT-test/autotest/testcase/go-xcat/case4 new file mode 100644 index 000000000..b2dfeeb86 --- /dev/null +++ b/xCAT-test/autotest/testcase/go-xcat/case4 @@ -0,0 +1,44 @@ +start:go_xcat_update_case1 +description:test go_xcat with the option update +os:Linux +cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y"; else echo "Sorry,this is not supported os"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa |grep -i perl-xcat";fi +check:rc!=0 +cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi +check:rc==0 +cmd:xdsh $$CN "cd /; rm -rf /xcat-core* /xcat-dep* /go-xcat" +check:rc==0 +cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" +check:rc==0 +cmd:xdsh $$CN "cd /; scp -r $$MN:/core-*-snap.tar.bz2 /xcat-core.tar.bz2" +check:rc==0 +cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /xcat-dep.tar.bz2" +check:rc==0 +cmd:if grep Ubuntu /etc/*release;then code=`lsb_release -sc` && xdsh $$CN "scp -r $$MN:/opt/xcat/share/xcat/tools/autotest/testcase/go-xcat/$code-__GETNODEATTR($$CN,arch)__.sources.list /etc/apt/sources.list"; fi +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://sourceforge.net/projects/xcat/files/ubuntu/apt.key/download | apt-key add -"; fi +check:rc==0 +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi +check:rc==0 +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "cd /; ./go-xcat --xcat-core=$$UBUNTU_MIGRATION2_CORE --xcat-dep=$$UBUNTU_MIGRATION2_DEP -y install";else xdsh $$CN "cd /; ./go-xcat -x $$MIGRATION1_VERSION -y install";fi +check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" +check:rc==0 +cmd:xdsh $$CN "lsxcatd -v" +check:rc==0 +check:output=~Version $$MIGRATION1_VERSION +cmd:xdsh $$CN "cd /; ./go-xcat update -y" +check:rc==0 +check:output=~xCAT has been successfully updated +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" +check:rc==0 +cmd:xdsh $$CN "service xcatd status" +check:rc==0 +check:output=~running +cmd:xdsh $$CN "service xcatd stop" +cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi +check:rc==0 +cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa|grep -i perl-xcat";fi +check:rc!=0 +cmd:xdsh $$CN "cd /; rm -rf /xcat-core* /xcat-dep* /go-xcat" +end +