start:go_xcat_noinput
description:test go_xcat without any input parameters
label:others,go_xcat
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 xcat-buildkit xcat-genesis-scripts  xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -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:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get install -y gpg"; fi
cmd:xdsh $$CN "cd /; rm -rf /go-xcat"
check:rc==0
cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./"
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/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi
check:rc==0
cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi
check:rc==0
cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log"
cmd:xdsh $$CN "cd /; ./go-xcat --yes install"
check:rc==0
cmd:xdsh $$CN "cat /tmp/go-xcat.log"
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 xcat-buildkit xcat-genesis-scripts  xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -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 /go-xcat"
end

start:go_xcat_with_x
description:test go_xcat with the option -x version -y install
label:others,go_xcat
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 xcat-buildkit xcat-genesis-scripts  xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -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:if xdsh $$CN "grep Ubuntu /etc/*release >/dev/null"; then xdsh $$CN "apt-get install -y gnupg"; fi
cmd:xdsh $$CN "cd /; rm -rf /go-xcat"
check:rc==0
cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./"
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/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi
check:rc==0
cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi
check:rc==0
cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log"
cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`; xdsh $$CN "cd /; ./go-xcat -x $migration_version -y install"
check:rc==0
cmd:xdsh $$CN "cat /tmp/go-xcat.log"
cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" |tee /tmp/version
check:rc==0
cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;cd /;if grep Ubuntu /etc/*release;then cd / ; wget http://xcat.org/files/xcat/repos/apt/$migration_version/xcat-core/buildinfo;else cd / ; wget http://xcat.org/files/xcat/repos/yum/$migration_version/xcat-core/buildinfo; fi
cmd:if [ -e /buildinfo ]; then xcatversion=`grep VERSION /buildinfo |awk -F'=' '{print $2}'`;grep $xcatversion /tmp/version; fi
check:rc==0
cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;grep $migration_version /tmp/version
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 xcat-buildkit xcat-genesis-scripts  xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -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 /go-xcat"
cmd:rm -rf /tmp/version
cmd:rm -rf /buildinfo
end

start:go_xcat_with_xcat-version-1
description:test go_xcat with the option --xcat-version=devel install
label:others,go_xcat
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 xcat-buildkit xcat-genesis-scripts  xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -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:if xdsh $$CN "grep Ubuntu /etc/*release >/dev/null"; then xdsh $$CN "apt-get install -y gnupg"; fi
cmd:xdsh $$CN "cd /; rm -rf /go-xcat"
check:rc==0
cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./"
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/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi
check:rc==0
cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi
check:rc==0
cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log"
cmd:xdsh $$CN "cd /; ./go-xcat --xcat-version=devel -y install"
check:rc==0
cmd:xdsh $$CN "cat /tmp/go-xcat.log"
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 xcat-buildkit xcat-genesis-scripts  xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -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 /go-xcat"
end

start:go_xcat_with_xcat-version-2
description:test go_xcat with the option --xcat-version=$MIGRATION2_VERSION install
label:others,go_xcat
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 /go-xcat"
check:rc==0
cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./"
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/hosts /etc/hosts" && xdsh $$CN "scp -r $$MN:/etc/resolv.conf /etc/resolv.conf" && xdsh $$CN "wget -O - http://xcat.org/files/xcat/repos/apt/apt.key | apt-key add -"; fi
check:rc==0
cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update"; fi
check:rc==0
cmd:xdsh $$CN "rm -rf /tmp/go-xcat.log"
cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`; xdsh $$CN "cd /; ./go-xcat --xcat-version=$migration_version -y install"
check:rc==0
cmd:xdsh $$CN "cat /tmp/go-xcat.log"
cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v"
check:rc==0
cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;cd /;if grep Ubuntu /etc/*release;then cd / ; wget http://xcat.org/files/xcat/repos/apt/$migration_version/xcat-core/buildinfo;else cd / ; wget http://xcat.org/files/xcat/repos/yum/$migration_version/xcat-core/buildinfo; fi
cmd:xdsh $$CN "lsxcatd -v" |tee /tmp/version
cmd:if [ -e /buildinfo ]; then xcatversion=`grep VERSION /buildinfo |awk -F'=' '{print $2}'`;grep $xcatversion /tmp/version; fi
check:rc==0
cmd:migration_version=`echo $$MIGRATION2_VERSION |cut -d "." -f -2`;grep $migration_version /tmp/version
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 /go-xcat"
cmd:rm -rf /tmp/version
cmd:rm -rf /buildinfo
end
