2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-24 15:05:36 +00:00

remove useless statements

This commit is contained in:
hu-weihua
2016-05-04 01:38:36 -04:00
parent 51d975ee7b
commit 7dd452da10
2 changed files with 25 additions and 24 deletions

View File

@ -15,7 +15,7 @@ cmd:makeconservercf
check:rc==0
cmd:cat /etc/conserver.cf | grep $$SN
check:output=~$$SN
cmd:sleep 20
cmd:sleep 10
cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "ppc64" ]]; then getmacs -D $$SN; fi
check:rc==0
cmd:makedhcp -n
@ -44,34 +44,25 @@ check:rc==0
cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo .
check:rc==0
#cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`; cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/sles$ver/__GETNODEATTR($$SN,arch)__ && createrepo . ;elif cat /etc/*release |grep "Red Hat" >/dev/null;then ver=`cat /etc/*release |awk '{print $7}' |awk -F"." '{print $1}'|head -n 1`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/rh$ver/__GETNODEATTR($$SN,arch)__ && createrepo . ;fi
#check:rc==0
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .;
check:rc==0
cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__
check:rc==0
#cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/sles/service.sles$ver.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; elif cat /etc/*release |grep "Red Hat" >/dev/null;then ver=`cat /etc/*release |awk '{print $7}' |awk -F"." '{print $1}'|head -n 1`;chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/rh/service.rhels$ver.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;fi
#cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/sles/service.sles$ver.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; elif cat /etc/*release |grep "Red Hat" >/dev/null;then chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/rh/service.__GETNODEATTR($$SN,os).__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;fi
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;
check:rc==0
#cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkgdir="/install/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__"
#check:rc==0
cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/sles/service.sles$ver.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; elif cat /etc/*release |grep "7.0" |grep "Red Hat">/dev/null;then chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/rh/service.__GETNODEATTR($$SN,os)__.ppc64.otherpkgs.pkglist;elif cat /etc/*release |grep "Red Hat" |grep "6.5">/dev/null;then ver=`cat /etc/*release |awk '{print $7}' |awk -F"." '{print $1}'|head -n 1`;chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/rh/service.rhels$ver.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;fi
check:rc==0
#cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`;for i in mysql-client libmysqlclient_r15 libqt4-sql-mysql libmysqlclient15 perl-DBD-mysql mysql; do cat /opt/xcat/share/xcat/install/sles/service.sles$ver.pkglist|grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /opt/xcat/share/xcat/install/sles/service.sles$ver.pkglist; fi done; elif cat /etc/*release |grep "Red Hat" >/dev/null;then ver=`cat /etc/*release |awk '{print $7}' |awk -F"." '{print $1}'|head -n 1`;for i in mysql; do cat /opt/xcat/share/xcat/install/rh/service.rhels$ver.ppc64.pkglist|grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /opt/xcat/share/xcat/install/rh/service.rhels$ver.ppc64.pkglist; fi done;fi
#cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`;for i in mariadb-devel-5.5.35-3.el7 mariadb-libs-5.5.35-3.el7 mariadb-server-5.5.35-3.el7 mariadb-bench-5.5.35-3.el7 mariadb-5.5.35-3.el7 perl-DBD-MySQL mysql-connector-odbc unixODBC; do cat /opt/xcat/share/xcat/install/sles/service.sles$ver.pkglist|grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /opt/xcat/share/xcat/install/sles/service.sles$ver.pkglist; fi done; elif cat /etc/*release |grep "Red Hat" >/dev/null;then ver=__GETNODEATTR($$SN,os)__;for i in mysql; do cat /opt/xcat/share/xcat/install/rh/service.$ver.ppc64.pkglist|grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /opt/xcat/share/xcat/install/rh/service.$ver.ppc64.pkglist; fi done;fi
check:rc==0
#cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`;chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkglist=/opt/xcat/share/xcat/install/sles/service.sles$ver.pkglist; elif cat /etc/*release |grep "Red Hat" >/dev/null;then ver=`cat /etc/*release |awk '{print $7}' |awk -F"." '{print $1}'|head -n 1`;chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkglist=/opt/xcat/share/xcat/install/rh/service.rhels$ver.__GETNODEATTR($$SN,arch)__.pkglist;fi
check:rc==0
cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkgdir="/install/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__"
check:rc==0
cmd:nodeset $$SN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service
check:rc==0
cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "ppc64" ]]; then rnetboot $$SN;elif [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]];then rpower $$SN boot; fi
check:rc==0
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/customize_sleep_for_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/customize_sleep_for_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
cmd:ping $$SN -c 3
check:rc==0
@ -97,11 +88,8 @@ check:output=~/install on /install
cmd:xdsh $$SN "mount"
check:rc==0
check:output=~/tftpboot on /tftpboot
#cmd:xdsh $$SN "nslookup $$CN"
#check:rc==0
#check:output!~server can't find $$CN
cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi
cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]];then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi
check:rc==0
end

View File

@ -13,7 +13,20 @@ sub runcmd{
}
}
my $cmd = "XCATMYSQLADMIN_PW=12345 XCATMYSQLROOT_PW=12345 /opt/xcat/bin/mysqlsetup -i";
my $setupmysqlscript="#!/usr/bin/expect -f
set timeout -1
spawn mysqlsetup -i
expect \"in the MySQL database:\"
send \"12345\\r\"
expect \"in the MySQL database:\"
send \"12345\\r\"
interact
";
my $cmd = "echo '$setupmysqlscript' > /tmp/setupmysqlscript && chmod +x /tmp/setupmysqlscript";
runcmd("$cmd");
$cmd="bash -lic \"/tmp/setupmysqlscript > /tmp/setupmysqlscript.rst\" ";
runcmd("$cmd");
$cmd="echo \"GRANT ALL on xcatdb.* TO xcatadmin@\'%\' IDENTIFIED BY \'12345\'\;\" | mysql -u root -p12345";