From f82ff37c2bf63900c8cdbfbf4b45e8c794a9319f Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Fri, 31 Mar 2017 15:29:09 +0800 Subject: [PATCH 1/9] [go-xcat] Ignore any error of `yum clean metadata` --- xCAT-server/share/xcat/tools/go-xcat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index b445b04a8..370481f0f 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.15 +# Version 1.0.16 # # Copyright (C) 2016 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -955,6 +955,7 @@ function remove_repo_yum() # This is a quick and dirty method. rm -f $(grep -l "^\[${repo_id}\]$" "/etc/yum.repos.d/"*".repo" 2>/dev/null) yum clean metadata + : } # $1 repo id From a761e64c0caf8991cff5a96b734193252fbb5dbd Mon Sep 17 00:00:00 2001 From: yangsong Date: Wed, 12 Apr 2017 22:31:54 -0500 Subject: [PATCH 2/9] fix issue #2856: [DEV] nodes provisioned with redhat osimages created by xCAT 2.12.3 or earlier missed yum repo to MN in xCAT 2.12.4 or later (#2857) * fix issue [DEV] nodes provisioned with redhat osimages created by xCAT 2.12.3 or earlier missed yum repo to MN in xCAT 2.12.4 or later #2856 * fix issue [DEV] nodes provisioned with redhat osimages created by xCAT 2.12.3 or earlier missed yum repo to MN in xCAT 2.12.4 or later #2856 --- perl-xCAT/xCAT/Yum.pm | 8 ++++++-- xCAT-server/lib/perl/xCAT/Template.pm | 5 +++-- xCAT-server/lib/xcat/plugins/anaconda.pm | 9 +++++++++ xCAT-server/share/xcat/install/scripts/post.xcat | 6 +++--- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/perl-xCAT/xCAT/Yum.pm b/perl-xCAT/xCAT/Yum.pm index b8eeb8c02..71faef8c9 100644 --- a/perl-xCAT/xCAT/Yum.pm +++ b/perl-xCAT/xCAT/Yum.pm @@ -9,12 +9,16 @@ my $distname; my $arch; my $installpfx; +my $distrepopfx="/install/postscripts/repos"; + sub localize_yumrepo { my $self = shift; my $pkgdir = shift; $distname=shift; $arch=shift; - open($yumrepofile, ">", "$pkgdir/local-repository.tmpl"); + + mkpath("$distrepopfx/$pkgdir"); + open($yumrepofile, ">", "$distrepopfx/$pkgdir/local-repository.tmpl"); my %options = ( wanted => \&check_tofix, follow_fast => 1 @@ -27,7 +31,7 @@ sub localize_yumrepo { sub remove_yumrepo { my $self = shift; my $pkgdir = shift; - rmtree("$pkgdir/local-repository.tmpl"); + rmtree("$distrepopfx/$pkgdir/local-repository.tmpl"); } sub check_tofix { diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 06dc55b2b..d1415fa3a 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -303,11 +303,12 @@ sub subvars { $source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=http://'\$nextserver'/$pkgdir' >> /tmp/repos"; $source .= "repo --name=pkg$c --baseurl=http://#TABLE:noderes:\$NODE:nfsserver#/$pkgdir\n"; #for rhels5.9 } - if( -f "$pkgdir/local-repository.tmpl"){ + my $distrepofile="/install/postscripts/repos/$pkgdir/local-repository.tmpl"; + if( -f "$distrepofile"){ my $repofd; my $repo_in_post; local $/=undef; - open($repofd,"<","$pkgdir/local-repository.tmpl"); + open($repofd,"<","$distrepofile"); $repo_in_post = <$repofd>; close($repofd); $repo_in_post =~ s#baseurl=#baseurl=http://$master/#g; diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 237a4e8b7..05bec81e5 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1260,6 +1260,15 @@ sub mkinstall } } + unless(-f "/install/postscripts/repos/$pkgdir/local-repository.tmpl"){ + #fix issue #2856@github + #for the osimages created by <=xCAT 2.12.3 + #there is no local-repository.tmpl under pkgdir created on copycds + #generate local-repository.tmpl here if it does not exist + require xCAT::Yum; + xCAT::Yum->localize_yumrepo($pkgdir, $os, $arch); + } + my @missingparms; unless ($os) { if ($imagename) { push @missingparms, "osimage.osvers"; } diff --git a/xCAT-server/share/xcat/install/scripts/post.xcat b/xCAT-server/share/xcat/install/scripts/post.xcat index 48024de9c..ba66f082b 100755 --- a/xCAT-server/share/xcat/install/scripts/post.xcat +++ b/xCAT-server/share/xcat/install/scripts/post.xcat @@ -410,9 +410,9 @@ export ARCH=#TABLE:nodetype:THISNODE:arch# export CONSOLEPORT=#TABLEBLANKOKAY:nodehm:THISNODE:serialport# #for redhat: -##place-holder for the code to save the repo info on compute node,pointing to the "pkgdir" of the osimage -##so that the provisioned node -##WRITEREPO# +#place-holder for the code to save the repo info on compute node,pointing to the "pkgdir" of the osimage +#so that the provisioned node has the repo pointed to the distro path on MN +#WRITEREPO# if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then msgutil_r "$MASTER_IP" "info" "running mypostscript" "/var/log/xcat/xcat.log" From 991ae3e1531d6f389dcc26406fde36d131fb8382 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 13 Apr 2017 01:11:07 -0400 Subject: [PATCH 3/9] fix issue [DEV] nodes provisioned with redhat osimages created by xCAT 2.12.3 or earlier missed yum repo to MN in xCAT 2.12.4 or later #2856: process the multiple dirs in pkgdir --- perl-xCAT/xCAT/Yum.pm | 3 ++- xCAT-server/lib/xcat/plugins/anaconda.pm | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/perl-xCAT/xCAT/Yum.pm b/perl-xCAT/xCAT/Yum.pm index 71faef8c9..368992a78 100644 --- a/perl-xCAT/xCAT/Yum.pm +++ b/perl-xCAT/xCAT/Yum.pm @@ -54,8 +54,9 @@ sub generate_repo my $dirlocation = shift; my @dircomps = File::Spec->splitdir($dirlocation); pop(@dircomps); + my $reponame = join("-",@dircomps); my $yumurl = File::Spec->catdir(@dircomps); - my $reponame = $dircomps[$#dircomps]; + print $yumrepofile "[local-$distname-$arch-$reponame]\n"; print $yumrepofile "name=xCAT configured yum repository for $yumurl\n"; print $yumrepofile "baseurl=$yumurl\n"; diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 05bec81e5..0222362ba 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -16,6 +16,7 @@ use xCAT::TableUtils; use xCAT::NetworkUtils; use xCAT::MsgUtils; use xCAT::SvrUtils; +use xCAT::Yum; #use Data::Dumper; use Getopt::Long; @@ -1260,13 +1261,15 @@ sub mkinstall } } - unless(-f "/install/postscripts/repos/$pkgdir/local-repository.tmpl"){ - #fix issue #2856@github - #for the osimages created by <=xCAT 2.12.3 - #there is no local-repository.tmpl under pkgdir created on copycds - #generate local-repository.tmpl here if it does not exist - require xCAT::Yum; - xCAT::Yum->localize_yumrepo($pkgdir, $os, $arch); + my @pkgdirs=split(/,/,$pkgdir); + foreach my $mypkgdir (@pkgdirs){ + unless(-f "/install/postscripts/repos/$mypkgdir/local-repository.tmpl"){ + #fix issue #2856@github + #for the osimages created by <=xCAT 2.12.3 + #there is no local-repository.tmpl under pkgdir created on copycds + #generate local-repository.tmpl here if it does not exist + xCAT::Yum->localize_yumrepo($mypkgdir, $os, $arch); + } } my @missingparms; @@ -2471,8 +2474,6 @@ sub copycd } } - - require xCAT::Yum; xCAT::Yum->localize_yumrepo($path, $distname, $arch); if ($rc != 0) From 0396a5097fe337b93ab98eb3df068898df54a5de Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 13 Apr 2017 03:26:02 -0400 Subject: [PATCH 4/9] add case for bug #2572, test case bug is #2826 --- xCAT-test/autotest/testcase/makedns/cases0 | 46 ++++++++++++++++++---- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/makedns/cases0 b/xCAT-test/autotest/testcase/makedns/cases0 index af2aa5f49..9e7549f03 100644 --- a/xCAT-test/autotest/testcase/makedns/cases0 +++ b/xCAT-test/autotest/testcase/makedns/cases0 @@ -1219,11 +1219,41 @@ cmd:chtab -d netname=testnetwork networks check:rc==0 end - - - - - - - - +start:makedns_n_noderange +description:to verify makedns -n noderange works as design. add case for bug #2572. Test case bug number is #2826. +cmd:chtab netname=testnetwork networks.net=100.100.100.0 networks.mask=255.255.255.0 networks.mgtifname=eth0 networks.gateway=100.100.100.254 +check:rc==0 +cmd:chdef -t node -o dnstestnode[1-10] groups=dnsnode ip="|dnstestnode(\d+)|100.100.100.(\$1+0)|" +check:rc==0 +cmd:cp /etc/hosts /etc/hosts.testbak +check:rc==0 +cmd:for i in {1..10}; do echo "100.100.100.$i dnstestnode$i" >> /etc/hosts; done +check:rc==0 +cmd:makedns -n dnstestnode[1-10] +check:rc==0 +cmd:nslookup dnstestnode5 $$MN +check:output~=Server: $$MN +check:output!~(server can't find dnstestnode) +cmd:makedns -d dnstestnode[1-10] +check:rc==0 +cmd:nslookup dnstestnode5 $$MN +check:output~=Server: $$MN +check:output~=(server can't find dnstestnode) +cmd:makedns -n dnsnode +check:rc==0 +cmd:nslookup dnstestnode5 $$MN +check:output~=Server: $$MN +check:output!~(server can't find dnstestnode) +cmd:makedns -d dnsnode +check:rc==0 +cmd:nslookup dnstestnode5 $$MN +check:output~=Server: $$MN +check:output~=(server can't find dnstestnode) +cmd:rmdef -t node dnstestnode[1-10] +check:rc==0 +cmd:chtab -d netname=testnetwork networks +check:rc==0 +cmd:makedns -n +check:rc==0 +cmd:cp /etc/hosts.testbak /etc/hosts +end From 9e245025caa692b3cede577df72d9f8a6dc16859 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 13 Apr 2017 16:29:21 +0800 Subject: [PATCH 5/9] [go-xcat] Fix zypper repository querying. Search packages in repository only. --- xCAT-server/share/xcat/tools/go-xcat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 370481f0f..a9d7da03f 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.16 +# Version 1.0.17 # # Copyright (C) 2016 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -517,7 +517,7 @@ function check_repo_version_zypper() do name+=("${name}") ver+=("${ver}") - done < <(zypper --no-gpg-checks -n search -s --match-exact "$@" \ + done < <(zypper --no-gpg-checks -n search -u -s --match-exact "$@" \ 2>/dev/null | awk -F ' *\\| *' '/ package / { print $2, $4 }') local -i i while [[ -n "$1" ]] From 4b9f06b641fbf7a4fe55deae00da908caa0c2542 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 13 Apr 2017 05:29:23 -0400 Subject: [PATCH 6/9] update for comments --- xCAT-test/autotest/testcase/makedns/cases0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/makedns/cases0 b/xCAT-test/autotest/testcase/makedns/cases0 index 9e7549f03..e39a35857 100644 --- a/xCAT-test/autotest/testcase/makedns/cases0 +++ b/xCAT-test/autotest/testcase/makedns/cases0 @@ -1225,7 +1225,7 @@ cmd:chtab netname=testnetwork networks.net=100.100.100.0 networks.mask=255.255.2 check:rc==0 cmd:chdef -t node -o dnstestnode[1-10] groups=dnsnode ip="|dnstestnode(\d+)|100.100.100.(\$1+0)|" check:rc==0 -cmd:cp /etc/hosts /etc/hosts.testbak +cmd:cp -f /etc/hosts /etc/hosts.testbak check:rc==0 cmd:for i in {1..10}; do echo "100.100.100.$i dnstestnode$i" >> /etc/hosts; done check:rc==0 @@ -1255,5 +1255,5 @@ cmd:chtab -d netname=testnetwork networks check:rc==0 cmd:makedns -n check:rc==0 -cmd:cp /etc/hosts.testbak /etc/hosts +cmd:cp -f /etc/hosts.testbak /etc/hosts end From 05f40199bc508ecf33ae67b6a518325342e6689e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 14 Apr 2017 13:19:15 -0400 Subject: [PATCH 7/9] Update README.rst --- README.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index d7f1ae9f6..2cb961dfd 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Documentation xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/ -|docs_latest| |docs_2132| |docs_2131| |docs_2130| |docs_212| |docs_211| +|docs_latest| |docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| |docs_211| Open Source License ------------------- @@ -22,6 +22,11 @@ Developers Developers and prospective contributors are encouraged to read the `Developers Guide `_ In particular the `GitHub `_ related subsection. +.. |docs_2133| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.3 + :alt: 2.13.3 documentation status + :scale: 100% + :target: http://xcat-docs.readthedocs.io/en/2.13.3/ + .. |docs_2132| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.2 :alt: 2.13.2 documentation status :scale: 100% From 5e886321720f7a93f6efb1b70ba3f3b6e374e885 Mon Sep 17 00:00:00 2001 From: khm Date: Fri, 14 Apr 2017 15:11:32 -0700 Subject: [PATCH 8/9] xCAT-server: fix S7200AP ipmi detection --- xCAT-server/share/xcat/cons/ipmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/cons/ipmi b/xCAT-server/share/xcat/cons/ipmi index 6dc4a4ed0..fd4546c3c 100755 --- a/xCAT-server/share/xcat/cons/ipmi +++ b/xCAT-server/share/xcat/cons/ipmi @@ -124,7 +124,7 @@ my $iface = "lanplus"; if (grep /IPMI Version : 1.5/, @mcinfo) { $solcom = "isol"; $iface = "lan"; -} elsif (grep /Manufacturer ID : 343/, @mcinfo) { +} elsif (grep /Manufacturer ID : 343/, @mcinfo && ! grep /Product ID : 117/,@mcinfo) { $isintel = 1; } my $inteloption = ""; From a0f4ddaf9eb74f57179fe3ddac307a5fa64af345 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 17 Apr 2017 01:15:42 -0400 Subject: [PATCH 9/9] Add timestamp to every cmd for xcattest failedcases log --- xCAT-test/xcattest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index adb91d428..c77ae148e 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -909,7 +909,7 @@ sub runcase my $runstart = timelocal(localtime()); my $runstartstr = scalar(localtime()); log_this("\nRUN:$cmd [$runstartstr]"); - push(@record, "\nRUN:$cmd"); + push(@record, "\nRUN:$cmd [$runstartstr]"); @output = &runcmd($cmd); $rc = $::RUNCMD_RC;