mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-30 09:36:41 +00:00
Merge pull request #753 from junxiawang/xCATreglatest
modify autotest xCATreg
This commit is contained in:
commit
c76e7accab
@ -39,14 +39,15 @@ BEGIN
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
|
||||
my $date;
|
||||
#my $regrootdir="/home/autotest_code";
|
||||
#my $mailtitle="P Cluster";
|
||||
my $regrootdir="/xCATreg";
|
||||
my $mailtitle="X Cluster";
|
||||
my $regrootdir="/home/autotest_code";
|
||||
my $mailtitle="PPC64LE Cluster";
|
||||
#my $regrootdir="/xCATreg";
|
||||
#my $mailtitle="X Cluster";
|
||||
my $logfiledir = "$regrootdir/log";
|
||||
my $logfile="";
|
||||
my $configfiledir = "$regrootdir/conf";
|
||||
my $configfile = "$regrootdir/conf/xCATreg.conf";
|
||||
my $xcatcoredowndir = "$regrootdir/xcatsource/xcat-core-build-down";
|
||||
my $xcatcoredir = "$regrootdir/xcatsource/xcat-core";
|
||||
my $xcatdepdir = "$regrootdir/xcatsource/xcat-dep";
|
||||
my $osisodir = "$regrootdir/iso";
|
||||
@ -269,7 +270,13 @@ sub mn_install {
|
||||
|
||||
my $os = $confkeys{$mn."os"};
|
||||
my $arch = "ppc64";
|
||||
$arch="x86_64" if($mn !~ /aix/ && $mn =~ /x/);
|
||||
if($mn !~ /aix/ && $mn =~ /x/){
|
||||
$arch="x86_64";
|
||||
}elsif($mn !~ /aix/ && $mn =~ /LE/){
|
||||
$arch="ppc64le";
|
||||
} elsif($mn !~ /aix/ && $mn =~ /EL/){
|
||||
$arch="ppc64el";
|
||||
}
|
||||
my $osimage="";
|
||||
|
||||
if($mn !~ /aix/){
|
||||
@ -288,8 +295,11 @@ sub mn_install {
|
||||
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][mn_install] installing $osimage for node $confkeys{$mn}................");
|
||||
|
||||
&runcmd("makedhcp -n");
|
||||
&runcmd("makedns -n");
|
||||
|
||||
&runcmd("nodeset $confkeys{$mn} osimage=$osimage");
|
||||
if( $arch =~ /x86_64/){
|
||||
if( $arch =~ /x86_64/ || $arch =~ /ppc64le/ || $arch =~ /ppc64el/){
|
||||
&runcmd("rpower $confkeys{$mn} boot");
|
||||
}else{
|
||||
&runcmd("rnetboot $confkeys{$mn}");
|
||||
@ -314,8 +324,9 @@ sub mn_install {
|
||||
system("xdsh $confkeys{$mn} \"iptables -A FORWARD -i eth1 -j ACCEPT\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"iptables -A FORWARD -i eth1 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT\" >/dev/null 2>&1");
|
||||
}
|
||||
if($os =~ /rhels7/){
|
||||
if($os =~ /rhels7/ || $os =~ /rhels7.2/){
|
||||
system("xdsh $confkeys{$mn} \"yum -y install bzip2 > /var/log/xcat/install_xcat.log 2>&1\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"yum -y install createrepo > /var/log/xcat/install_xcat.log 2>&1\" >/dev/null 2>&1");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -365,6 +376,27 @@ sub down_dep{
|
||||
return ($depupdateflag);
|
||||
}
|
||||
|
||||
#########################################
|
||||
# down xcat-core build
|
||||
###########################################
|
||||
sub down_xcat_core_build {
|
||||
my $mn=shift;
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][down xcatcore] starting to down the latest xcat core");
|
||||
my $downxcatcoredowndir="$xcatcoredowndir/$mn";
|
||||
if (! -f "$xcatcoredowndir/$mn"){
|
||||
`mkdir -p $xcatcoredowndir/$mn`;
|
||||
}
|
||||
my $downxcatcoreip = $confkeys{$mn."downxcatcoreip"};
|
||||
my $downxcatcoredir = $confkeys{$mn."downxcatcoredir"};
|
||||
my $latestxcatcoredir = `ssh $downxcatcoreip ls -rt $downxcatcoredir / |tail -1 |awk '{printf \$0}'`;
|
||||
my $xcatcorename = $confkeys{$mn."xcatcorename"};
|
||||
`scp -r $downxcatcoreip\:$downxcatcoredir/$latestxcatcoredir/$xcatcorename $downxcatcoredowndir `;
|
||||
if($? != 0){
|
||||
send_msg(0,"[$mn->$confkeys{$mn}][down_xcat_core_build] failed");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
#######################################
|
||||
# copy code
|
||||
#######################################
|
||||
@ -372,6 +404,13 @@ sub copy_code {
|
||||
my $mn=shift;
|
||||
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][copy_code] starting to copy the latest xcat code and dep");
|
||||
my $dnsserver=`cat /etc/hosts |grep $confkeys{$mn}|awk '{print \$1}'|head -n 1`;
|
||||
chomp($dnsserver);
|
||||
my $res = system("xdsh $confkeys{$mn} \"sed -i 's:nameserver .*:nameserver $dnsserver:g' /etc/resolv.conf\" >/dev/null 2>&1");
|
||||
if($res != 0){
|
||||
send_msg(0, "[$mn->$confkeys{$mn}][install_xcat] modify resolv.conf in $mn failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
#copy xcat-dep tarball to MN:/
|
||||
my $depball="";
|
||||
@ -380,21 +419,37 @@ sub copy_code {
|
||||
}elsif($mn =~ /ubuntu/){
|
||||
$depball = `ls -l $xcatdepdir/$mn|awk '{print \$9}'|grep ubuntu|tail -n 1`;
|
||||
}else{
|
||||
$depball = `ls -l $xcatdepdir/$mn|awk '{print \$9}'|grep 'xcat-dep-[0-9]\\{12\\}.tar.bz'|tail -n 1`;
|
||||
$depball = `ls -l $xcatdepdir/$mn|awk '{print \$9}'|grep 'xcat-dep'|tail -n 1`;
|
||||
}
|
||||
chomp($depball);
|
||||
print "depball is $depball\n";
|
||||
my $coreball = `ls -l $xcatcoredowndir/$mn|awk '{print \$9}'|tail -n 1`;
|
||||
chomp($coreball);
|
||||
if ($depball eq ""){
|
||||
send_msg(0, "[$mn->$confkeys{$mn}][copy_code] can't find dep tarball for $mn under dir $xcatdepdir");
|
||||
return 1;
|
||||
}
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][copy_code] find dep tarball $depball for $mn");
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][copy_code] find dep tarball $depball for $mn");
|
||||
if ($coreball eq ""){
|
||||
send_msg(0, "[$mn->$confkeys{$mn}][copy_code] can't find core tarball for $mn under dir $coreball");
|
||||
return 1;
|
||||
}
|
||||
|
||||
my $res = system("scp $xcatdepdir/$mn/$depball root\@$confkeys{$mn}:/ >/dev/null");
|
||||
if ($?){
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][copy_code] find core tarball $coreball for $mn");
|
||||
|
||||
$res = system("scp $xcatdepdir/$mn/$depball root\@$confkeys{$mn}:/ >/dev/null");
|
||||
if ($res){
|
||||
send_msg(0, "[$mn->$confkeys{$mn}][copy_code] copy $depball to $mn failed");
|
||||
return 1;
|
||||
}
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][copy_code] copy $depball to $mn successfully");
|
||||
|
||||
$res = system("scp $xcatcoredowndir/$mn/$coreball root\@$confkeys{$mn}:/ >/dev/null");
|
||||
if ($res){
|
||||
send_msg(0, "[$mn->$confkeys{$mn}][copy_code] copy $coreball to $mn failed");
|
||||
return 1;
|
||||
}
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][copy_code] copy $coreball to $mn successfully");
|
||||
|
||||
$res = system("xdsh $confkeys{$mn} 'cd / && tar xvf /$depball' >/dev/null 2>&1");
|
||||
if ($?){
|
||||
@ -402,7 +457,13 @@ sub copy_code {
|
||||
return 1;
|
||||
}
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][copy_code] untar $depball in $mn successfully");
|
||||
|
||||
$res = system("xdsh $confkeys{$mn} 'cd / && tar xvf /$coreball' >/dev/null 2>&1");
|
||||
if ($?){
|
||||
send_msg(0, "[$mn->$confkeys{$mn}][copy_code] untar $coreball in $mn failed");
|
||||
return 1;
|
||||
}
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][copy_code] untar $coreball in $mn successfully");
|
||||
|
||||
#copy xcat-core source code to MN:/
|
||||
if($mn =~ /ubuntux/){
|
||||
#defect 107 Automation ENV replaces the link file to real file before running xcat build
|
||||
@ -430,7 +491,13 @@ sub copy_code {
|
||||
system("sed -i 's|os=\\S*|os=$os|g' $configfiledir/$regconf");
|
||||
|
||||
my $arch = "ppc64";
|
||||
$arch="x86_64" if($mn !~ /aix/ && $mn =~ /x/);
|
||||
if($mn !~ /aix/ && $mn =~ /x/){
|
||||
$arch="x86_64";
|
||||
}elsif($mn !~ /aix/ && $mn =~ /LE/){
|
||||
$arch="ppc64le";
|
||||
}elsif($mn !~ /aix/ && $mn =~ /EL/){
|
||||
$arch="ppc64el";
|
||||
}
|
||||
my $iso;
|
||||
|
||||
#copy specific files to MN for each platform
|
||||
@ -498,7 +565,7 @@ sub copy_code {
|
||||
my $osversion = $2;
|
||||
if ($mn =~ /ubuntux/){
|
||||
$iso=`ls -l $osisodir| awk '{print \$9}'|grep ubuntu|grep amd64 |grep $osversion |tail -n 1`;
|
||||
}elsif($mn =~ /ubuntupel/){
|
||||
}elsif($mn =~ /ubuntuEL/){
|
||||
$iso=`ls -l $osisodir| awk '{print \$9}'|grep ubuntu|grep ppc64el |grep $osversion |tail -n 1`;
|
||||
}
|
||||
chomp($iso);
|
||||
@ -520,71 +587,6 @@ sub copy_code {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#######################
|
||||
# build xcat
|
||||
#######################
|
||||
sub build_xcat {
|
||||
my $mn = shift;
|
||||
|
||||
#print "=======[$mn->$confkeys{$mn}] build_xcat========\n";
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][build_xcat] starting to build xcat in $confkeys{$mn}");
|
||||
|
||||
#modify /etc/resolv.conf
|
||||
my $dnsserver=`cat /etc/hosts |grep $confkeys{$mn}|awk '{print \$1}'|head -n 1`;
|
||||
chomp($dnsserver);
|
||||
my $res = system("xdsh $confkeys{$mn} \"sed -i 's:nameserver .*:nameserver $dnsserver:g' /etc/resolv.conf\" >/dev/null 2>&1");
|
||||
if ($res != 0){
|
||||
send_msg(0, "[$mn->$confkeys{$mn}][install_xcat] modify resolv.conf in $mn failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if($mn =~ /rh/){
|
||||
system("xdsh $confkeys{$mn} 'yum -y groupinstall \"Development tools\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'yum -y groupinstall \"Perl Support\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'yum -y install createrepo' >/dev/null 2>&1");
|
||||
}
|
||||
|
||||
if($mn =~ /sles/){
|
||||
system("xdsh $confkeys{$mn} 'zypper -n install perl-DBI' >/dev/null 2>&1");
|
||||
}
|
||||
|
||||
if($mn =~ /ubuntu/){
|
||||
system("xdsh $confkeys{$mn} \"echo \"nameserver 9.0.2.1\" >> /etc/resolv.conf\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get -y install software-properties-common' >/dev/null 2>&1");
|
||||
if($mn =~ /ubuntux/){
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://archive.ubuntu.com/ubuntu \$(lsb_release -sc) main\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://archive.ubuntu.com/ubuntu \$(lsb_release -sc)-updates main\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://archive.ubuntu.com/ubuntu \$(lsb_release -sc) universe\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://archive.ubuntu.com/ubuntu \$(lsb_release -sc)-updates universe\"' >/dev/null 2>&1");
|
||||
}elsif($mn =~ /ubuntupel/){
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://ports.ubuntu.com/ubuntu-ports \$(lsb_release -sc) main\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://ports.ubuntu.com/ubuntu-ports \$(lsb_release -sc)-updates main\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://ports.ubuntu.com/ubuntu-ports \$(lsb_release -sc) universe\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://ports.ubuntu.com/ubuntu-ports \$(lsb_release -sc)-updates universe\"' >/dev/null 2>&1");
|
||||
}
|
||||
|
||||
system("xdsh $confkeys{$mn} \"wget -O - \"http://sourceforge.net/projects/xcat/files/ubuntu/apt.key/download\" | apt-key add -\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get clean all' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get update' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get -y install build-essential dpkg-dev dh-make debhelper fakeroot gnupg lintian pbuilder quilt reprepro libsoap-lite-perl libdbi-perl' >/dev/null 2>&1");
|
||||
}
|
||||
|
||||
#build xcat core ball
|
||||
if($mn =~ /ubuntux/){
|
||||
$res = system("xdsh $confkeys{$mn} '/xcatbuild/xcat-core/build-ubunturepo -c UP=0 BUILDALL=1 > /var/log/xcat/build_xcat.log 2>&1' >/dev/null 2>&1");
|
||||
}else{
|
||||
$res = system("xdsh $confkeys{$mn} '/xcat-core/buildlocal.sh CURDIR=/xcat-core > /var/log/xcat/build_xcat.log 2>&1' >/dev/null 2>&1");
|
||||
}
|
||||
if ($res != 0){
|
||||
send_msg(0, "[$mn->$confkeys{$mn}][build_xcat] build xcat in $mn failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][build_xcat] build xcat in $mn successfully");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#######################################
|
||||
# config mn
|
||||
#######################################
|
||||
@ -594,42 +596,81 @@ sub install_xcat {
|
||||
|
||||
my $os = $confkeys{$mn."os"};
|
||||
my $arch = "ppc64";
|
||||
$arch="x86_64" if($mn !~ /aix/ && $mn =~ /x/);
|
||||
if($mn !~ /aix/ && $mn =~ /x/){
|
||||
$arch="x86_64";
|
||||
}elsif($mn !~ /aix/ && $mn =~ /LE/){
|
||||
$arch="ppc64le";
|
||||
}elsif($mn !~ /aix/ && $mn =~ /EL/){
|
||||
$arch="ppc64el";
|
||||
}
|
||||
if($mn =~ /ubuntu/){
|
||||
system("xdsh $confkeys{$mn} \"echo \"nameserver 9.0.2.1\" >> /etc/resolv.conf\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get -y install software-properties-common' >/dev/null 2>&1");
|
||||
if($mn =~ /ubuntux/){
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://archive.ubuntu.com/ubuntu \$(lsb_release -sc) main\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://archive.ubuntu.com/ubuntu \$(lsb_release -sc)-updates main\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://archive.ubuntu.com/ubuntu \$(lsb_release -sc) universe\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://archive.ubuntu.com/ubuntu \$(lsb_release -sc)-updates universe\"' >/dev/null 2>&1");
|
||||
}elsif($mn =~ /ubuntuEL/){
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://ports.ubuntu.com/ubuntu-ports \$(lsb_release -sc) main\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://ports.ubuntu.com/ubuntu-ports \$(lsb_release -sc)-updates main\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://ports.ubuntu.com/ubuntu-ports \$(lsb_release -sc) universe\"' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'add-apt-repository \"deb http://ports.ubuntu.com/ubuntu-ports \$(lsb_release -sc)-updates universe\"' >/dev/null 2>&1");
|
||||
}
|
||||
|
||||
system("xdsh $confkeys{$mn} \"wget -O - \"http://sourceforge.net/projects/xcat/files/ubuntu/apt.key/download\" | apt-key add -\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get clean all' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get update' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get -y install build-essential dpkg-dev dh-make debhelper fakeroot gnupg lintian pbuilder quilt reprepro libsoap-lite-perl libdbi-perl' >/dev/null 2>&1");
|
||||
}
|
||||
|
||||
if($mn =~ /rh/){
|
||||
$os =~ /(\D+)(\d+)\.?(\d?)/;
|
||||
system("xdsh $confkeys{$mn} \"cd /xcat-core && ./mklocalrepo.sh\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"cd /xcat-dep/rh$2/$arch && ./mklocalrepo.sh\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"rpm --import /RPM-GPG-KEY-redhat-release\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"yum -y install xCAT xCAT-test > /var/log/xcat/install_xcat.log 2>&1\" >/dev/null 2>&1");
|
||||
if($os =~ /rhels7/){
|
||||
system("xdsh $confkeys{$mn} \"yum -y install 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\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"yum -y install mariadb-devel mariadb-libs mariadb-server mariadb-bench mariadb perl-DBD-MySQL mysql-connector-odbc unixODBC\" >/dev/null 2>&1");
|
||||
}elsif($os =~ /rhels6/){
|
||||
system("xdsh $confkeys{$mn} \"yum -y install mysql-server mysql mysql-bench mysql-devel mysql-connector-odbc\" >/dev/null 2>&1");
|
||||
}
|
||||
system("xdsh $confkeys{$mn} \"source /etc/profile.d/xcat.sh\" >/dev/null 2>&1");
|
||||
if($mn =~ /rhx/){
|
||||
system("xdsh $confkeys{$mn} \"yum install -y perl-Sys-Virt\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"yum install -y perl-Sys-Virt\" >/dev/null 2>&1");
|
||||
}
|
||||
}elsif($mn =~ /sles/){
|
||||
$os =~ /(\D+)(\d+)\.?(\d?)/;
|
||||
system("xdsh $confkeys{$mn} \"zypper ar file:///xcat-dep/sles$2/$arch xCAT-dep\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"zypper ar file:///xcat-dep/sles$2/$arch xCAT-dep\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"zypper ar file:///xcat-core xCAT-core\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"zypper sl -U\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"zypper --gpg-auto-import-keys search --match-exact -s screen\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"zypper -n install xCAT xCAT-test > /var/log/xcat/install_xcat.log 2>&1\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"zypper -n install createrepo\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"zypper -n install mysql-client libmysqlclient_r15 libqt4-sql-mysql libmysqlclient15 perl-DBD-mysql mysql unixODBC\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"source /etc/profile.d/xcat.sh\" >/dev/null 2>&1");
|
||||
if($mn =~ /slesx/){
|
||||
if($mn =~ /slesLE/){
|
||||
system ("xdsh $confkeys{$mn} \"zypper -n install perl-Net-DNS-0.80-1.ppc64le\">/dev/null 2>&1");
|
||||
}
|
||||
if($mn =~ /slesx/){
|
||||
system("xdsh $confkeys{$mn} \"zypper -n install perl-Sys-Virt\" >/dev/null 2>&1");
|
||||
}
|
||||
}elsif($mn =~ /ubuntux/){
|
||||
system("xdsh $confkeys{$mn} \"/xcat-core/mklocalrepo.sh\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"/xcat-dep/mklocalrepo.sh\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"wget -O - \"http://sourceforge.net/projects/xcat/files/ubuntu/apt.key/download\" | apt-key add -\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get clean all' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get update' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get -y install xcat xCAT-test > /var/log/xcat/install_xcat.log 2>&1' >/dev/null 2>&1");
|
||||
}
|
||||
}elsif($mn =~ /ubuntuEL/){
|
||||
system("xdsh $confkeys{$mn} \"/xcat-core/mklocalrepo.sh\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} \"/xcat-dep/mklocalrepo.sh\" >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get clean all' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get update' >/dev/null 2>&1");
|
||||
system("xdsh $confkeys{$mn} 'apt-get -y install xcat xCAT-test > /var/log/xcat/install_xcat.log 2>&1' >/dev/null 2>&1");
|
||||
|
||||
system("xdsh $confkeys{$mn} 'mkdir -p /install/ubuntu14.04.3/ppc64el/install/netboot '");
|
||||
system("scp /install/ubuntu14.04.3/ppc64el/install/netboot/initrd.gz $confkeys{$mn}:/install/ubuntu14.04.3/ppc64el/install/netboot ");
|
||||
}
|
||||
|
||||
#check if MN is installed successful
|
||||
my $lsdefout = `ssh -t $confkeys{$mn} 'bash -l -i -c "lsdef -v"'`;
|
||||
@ -669,7 +710,7 @@ sub do_test {
|
||||
my $diskless_installation_hierarchy_testcase="";
|
||||
my $statelite_installation_hierarchy_testcase="";
|
||||
my $batbundle="";
|
||||
if($mn =~ /sles/ || $mn =~ /rh/){
|
||||
if((($mn =~ /sles/) || ($mn =~ /rh/)) && ($mn !~ /E/)){
|
||||
$diskfull_installation_flat_testcase="reg_linux_diskfull_installation_flat";
|
||||
$diskless_installation_flat_testcase="reg_linux_diskless_installation_flat";
|
||||
$statelite_installation_flat_testcase="reg_linux_statelite_installation_flat";
|
||||
@ -685,13 +726,14 @@ sub do_test {
|
||||
$diskfull_installation_flat_testcase="Ubuntu_full_installation_flat_x86_vm";
|
||||
$diskless_installation_flat_testcase="Ubuntu_diskless_installation_flat_x86_vm";
|
||||
$batbundle="x_ubuntu_cmd.bundle";
|
||||
}elsif($mn =~ /ubuntupel/){
|
||||
$diskfull_installation_flat_testcase="Ubuntu_full_installation_flat_p8le_vm";
|
||||
$diskless_installation_flat_testcase="Ubuntu_diskless_installation_flat_p8le_vm";
|
||||
$batbundle="p_ubunut.cmd.bundle";
|
||||
}
|
||||
|
||||
if($mn !~ /ubuntu/){
|
||||
}elsif($mn =~ /E/){
|
||||
$diskfull_installation_flat_testcase="Full_installation_flat_p8_le";
|
||||
$diskless_installation_flat_testcase="Diskless_installation_flat_p8_le";
|
||||
$batbundle="le_rhels_cmd.bundle" if($mn =~ /rhLE/);
|
||||
$batbundle="le_sles_cmd.bundle" if($mn =~ /slesLE/);
|
||||
$batbundle="le_ubuntu_cmd.bundle" if($mn =~ /ubuntuEL/);
|
||||
}
|
||||
if(($mn !~ /ubuntu/) && ($mn !~ /E/)){
|
||||
#diskfull installation in flat mode test
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] doing diskfull installation test in flat mode in $mn.....");
|
||||
system("xdsh $confkeys{$mn} \"xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf -t $diskfull_installation_flat_testcase\" >/dev/null 2>&1");
|
||||
@ -729,10 +771,16 @@ sub do_test {
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] preparing xcat ball for installing SN in $mn.....");
|
||||
my $os = $confkeys{$mn."os"};
|
||||
my $arch = "ppc64";
|
||||
$arch="x86_64" if($mn !~ /aix/ && $mn =~ /x/);
|
||||
if(($mn !~ /aix/) && ($mn =~ /x/)){
|
||||
$arch="x86_64";
|
||||
}elsif($mn !~ /aix/ && $mn =~ /LE/){
|
||||
$arch="ppc64le";
|
||||
}elsif($mn !~ /aix/ && $mn =~ /EL/){
|
||||
$arch="ppc64el";
|
||||
}
|
||||
my $xcatballpath = "/install/post/otherpkgs/$os/$arch/xcat";
|
||||
$res = system("xdsh $confkeys{$mn} \"mkdir -p $xcatballpath/xcat-core && cp -r /xcat-core/build/* $xcatballpath/xcat-core && cp -r /xcat-dep $xcatballpath\"");
|
||||
if ($res != 0){
|
||||
$res = system("xdsh $confkeys{$mn} \"mkdir -p $xcatballpath/xcat-core && cp -r /xcat-core/* $xcatballpath/xcat-core && cp -r /xcat-dep $xcatballpath\"");
|
||||
if ($res != 0){
|
||||
send_msg(0, "[$mn->$confkeys{$mn}][do_test] prepare xcat ball for installing SN in $mn failed");
|
||||
return 1;
|
||||
}
|
||||
@ -784,20 +832,20 @@ sub do_test {
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] do statelite installation test in hierarchy mode in $mn.....[done]");
|
||||
|
||||
}else{
|
||||
#diskfull installation in flat mode test
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] doing diskfull installation test in flat mode in $mn.....");
|
||||
system("ssh -t $confkeys{$mn} 'exec bash -l -i -c \"xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf -t $diskfull_installation_flat_testcase\"' >/dev/null 2>&1");
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] do diskfull installation test in flat mode in $mn.....[done]");
|
||||
|
||||
#commands bundle in flat mode test
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] doing all commands test in flat mode in $mn.....");
|
||||
system("ssh -t $confkeys{$mn} 'exec bash -l -i -c \"xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf -b $batbundle\"' >/dev/null 2>&1");
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] do all commands test in flat mode in $mn.....[done]");
|
||||
|
||||
#diskless installation in flat mode test
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] doing diskless installation test in flat mode in $mn.....");
|
||||
system("ssh -t $confkeys{$mn} 'exec bash -l -i -c \"xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf -t $diskless_installation_flat_testcase\"' >/dev/null 2>&1");
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] do diskless installation test in flat mode in $mn.....[done]");
|
||||
|
||||
#diskfull installation in flat mode test
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] doing diskfull installation test in flat mode in $mn.....");
|
||||
system("ssh -t $confkeys{$mn} 'exec bash -l -i -c \"xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf -t $diskfull_installation_flat_testcase\"' >/dev/null 2>&1");
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] do diskfull installation test in flat mode in $mn.....[done]");
|
||||
|
||||
#commands bundle in flat mode test
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] doing all commands test in flat mode in $mn.....");
|
||||
system("ssh -t $confkeys{$mn} 'exec bash -l -i -c \"xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf -b $batbundle\"' >/dev/null 2>&1");
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][do_test] do all commands test in flat mode in $mn.....[done]");
|
||||
}
|
||||
|
||||
send_msg(2, "[$mn->$confkeys{$mn}][install_xcat] run regression test in $mn finished");
|
||||
@ -846,12 +894,18 @@ sub creat_report{
|
||||
|
||||
while(my($k,$v) = each %pidrecord){
|
||||
my $scenario="[".$confkeys{$k."os"};
|
||||
if($k=~/p/){$scenario.="+PPC64] ";}else{$scenario.="+x86_64] ";}
|
||||
if($k=~/p/){
|
||||
$scenario.="+PPC64] ";
|
||||
}elsif($k=~ /E/){
|
||||
$scenario.="+PPC64LE] ";
|
||||
}elsif($k=~/x/){
|
||||
$scenario.="+x86_64] ";
|
||||
}
|
||||
$mailreport .= "$scenario\n";
|
||||
my $batbundle="";
|
||||
my $totalcase=0;
|
||||
|
||||
if($k=~ /sles/ || $k =~ /rh/){
|
||||
if($k=~ /slesp/ || $k =~ /rhx/ || $k=~ /slesx/ || $k =~ /rhp/){
|
||||
$batbundle="$xcatcoredir/xCAT-test/autotest/bundle/p_rhels_cmd.bundle" if($k =~ /rhp/);
|
||||
$batbundle="$xcatcoredir/xCAT-test/autotest/bundle/x_rhels_cmd.bundle" if($k =~ /rhx/);
|
||||
$batbundle="$xcatcoredir/xCAT-test/autotest/bundle/p_sles_cmd.bundle" if($k =~ /slesp/);
|
||||
@ -862,9 +916,11 @@ sub creat_report{
|
||||
$batbundle="/$xcatcoredir/xCAT-test/autotest/bundle/x_ubuntu_cmd.bundle";
|
||||
$totalcase=`cat $batbundle|wc -l`;
|
||||
$totalcase+=2;
|
||||
}elsif($k =~ /ubuntupel/){
|
||||
$batbundle="$xcatcoredir/xCAT-test/autotest/bundle/p_ubunut.cmd.bundle";
|
||||
$totalcase=`cat "$batbundle|wc -l`;
|
||||
}elsif($k =~ /E/){
|
||||
$batbundle="$xcatcoredir/xCAT-test/autotest/bundle/le_rhels_cmd.bundle" if($k =~ /rhLE/);
|
||||
$batbundle="$xcatcoredir/xCAT-test/autotest/bundle/le_sles_cmd.bundle" if($k =~ /slesLE/);
|
||||
$batbundle="$xcatcoredir/xCAT-test/autotest/bundle/le_ubuntu_cmd.bundle" if($k =~ /ubuntuEL/);
|
||||
$totalcase=`cat $batbundle|wc -l`;
|
||||
$totalcase+=2;
|
||||
}
|
||||
|
||||
@ -985,7 +1041,14 @@ $cnt =`cat $mailfile |grep "Total"|grep "Failed"|wc -l`;
|
||||
#print "subdir-> $subdir\n";
|
||||
|
||||
my $scenario="[".$confkeys{$subdir."os"};
|
||||
if($subdir=~/p/){$scenario.="+PPC64] ";}else{$scenario.="+x86_64] ";}
|
||||
if($subdir =~ /p/){
|
||||
$scenario.="+PPC64] ";
|
||||
}elsif($subdir =~ /x/){
|
||||
$scenario.="+x86_64] ";
|
||||
}elsif($subdir =~ /E/){
|
||||
$scenario.="+ppc64le] ";
|
||||
}
|
||||
|
||||
my $separator .= "\n###############################################################\n";
|
||||
$separator .= " $scenario\n";
|
||||
$separator .= "###############################################################\n\n";
|
||||
@ -1294,49 +1357,49 @@ foreach my $m (keys %mns) {
|
||||
close CONTROLREAD;
|
||||
my $res;
|
||||
|
||||
#######################################
|
||||
# step 3. download xcat core
|
||||
########################################
|
||||
send_msg(2, "[$m]step 3, Running down_xcat_core...............");
|
||||
$res = down_xcat_core_build($m);
|
||||
if ($res) {
|
||||
syswrite MNWRITE,"REPORTFROM:$m->$mn: download xcat core for $mn failed\n";
|
||||
exit 1;
|
||||
}
|
||||
send_msg(2, "[$m]step 3, Run down_xcat_core...............[OK]");
|
||||
|
||||
#######################################
|
||||
# step 3. Install MNs,
|
||||
# step 4. Install MNs,
|
||||
#######################################
|
||||
send_msg(2, "[$m]step 3, Running mn_install...............");
|
||||
send_msg(2, "[$m]step 4, Running mn_install...............");
|
||||
$res = mn_install($m);
|
||||
if ($res) {
|
||||
syswrite MNWRITE,"REPORTFROM:$m->$mn: install $mn failed\n";
|
||||
exit 1;
|
||||
}
|
||||
send_msg(2, "[$m]step 3, Run mn_install...............[OK]");
|
||||
send_msg(2, "[$m]step 4, Run mn_install...............[OK]");
|
||||
#######################################
|
||||
# step 4. Down xcatdep to MNs
|
||||
# step 5. Down xcatdep to MNs
|
||||
#######################################
|
||||
send_msg(2, "[$m]step 4, Down xcatdep...............");
|
||||
send_msg(2, "[$m]step 5, Down xcatdep...............");
|
||||
$depupdateflag = down_dep($m);
|
||||
if ($depupdateflag ==2){
|
||||
send_msg(2, "[$m]step 4, updated for xcat dep");
|
||||
send_msg(2, "[$m]step 5, updated for xcat dep");
|
||||
}else{
|
||||
send_msg(2, "[$m]step 4, no update for xcat dep");
|
||||
send_msg(2, "[$m]step 5, no update for xcat dep");
|
||||
}
|
||||
#######################################
|
||||
# step 5. Copy code to MNs
|
||||
# step 6. Copy code to MNs
|
||||
#######################################
|
||||
send_msg(2, "[$m]step 5, Running copy_code...............");
|
||||
send_msg(2, "[$m]step 6, Running copy_code...............");
|
||||
$res = copy_code($m);
|
||||
if ($res) {
|
||||
syswrite MNWRITE,"REPORTFROM:$m->$mn: copy xcat source code to $mn failed\n";
|
||||
exit 1;
|
||||
}
|
||||
send_msg(2, "[$m]step 5, Run copy_code...............[OK]");
|
||||
send_msg(2, "[$m]step 6, Run copy_code...............[OK]");
|
||||
|
||||
#######################################
|
||||
# step 6. Build xcat code in MNs
|
||||
#######################################
|
||||
send_msg(2, "[$m]step 6, Running build_xcat...............");
|
||||
$res = build_xcat($m);
|
||||
if ($res) {
|
||||
syswrite MNWRITE,"REPORTFROM:$m->$mn: build new xcat in $mn failed\n";
|
||||
exit 1;
|
||||
}
|
||||
send_msg(2, "[$m]step 6, Run build_xcat...............[OK]");
|
||||
|
||||
#######################################
|
||||
########################################
|
||||
# step 7. Read xCAT MN's configuration
|
||||
#######################################
|
||||
send_msg(2, "[$m]step 7, Running install_xcat...............");
|
||||
|
Loading…
x
Reference in New Issue
Block a user