From e570ed6e49ffcbb1119d593829733851c33f8e90 Mon Sep 17 00:00:00 2001 From: ligc Date: Mon, 21 Oct 2013 11:02:37 +0800 Subject: [PATCH 01/93] remoteshell fix for SLES 12 support, sshd is not enabled by default on SLES 12, enable sshd in remoteshell postscript --- perl-xCAT/xCAT/Version.pm | 4 ++-- xCAT/postscripts/remoteshell | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/Version.pm b/perl-xCAT/xCAT/Version.pm index 99fe9c4f2..1099942ad 100644 --- a/perl-xCAT/xCAT/Version.pm +++ b/perl-xCAT/xCAT/Version.pm @@ -42,11 +42,11 @@ sub Version my $version = shift; if ($version eq 'short') { - $version = '' #XCATVERSIONSUBHERE ; + $version = '' . '2.9' ; } else { - $version = 'Version ' #XCATVERSIONSUBHERE #XCATSVNBUILDSUBHERE ; + $version = 'Version ' . '2.9' . ' (git commit aabb, built Thu Oct 17 14:52:04 CST 2013)' ; } return $version; diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index 1580c519b..0157d3584 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -460,6 +460,9 @@ then fi else #service sshd restart + # sshd is not enabled on SLES 12 by default + # does not hurt anything to re-enable if it is enabled already + enableservice sshd restartservice sshd fi From 9b402bb65673396ef5e8fd96306f353bc379ffaa Mon Sep 17 00:00:00 2001 From: ligc Date: Mon, 21 Oct 2013 11:11:50 +0800 Subject: [PATCH 02/93] fix a problem in the last checkin --- perl-xCAT/xCAT/Version.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/Version.pm b/perl-xCAT/xCAT/Version.pm index 1099942ad..99fe9c4f2 100644 --- a/perl-xCAT/xCAT/Version.pm +++ b/perl-xCAT/xCAT/Version.pm @@ -42,11 +42,11 @@ sub Version my $version = shift; if ($version eq 'short') { - $version = '' . '2.9' ; + $version = '' #XCATVERSIONSUBHERE ; } else { - $version = 'Version ' . '2.9' . ' (git commit aabb, built Thu Oct 17 14:52:04 CST 2013)' ; + $version = 'Version ' #XCATVERSIONSUBHERE #XCATSVNBUILDSUBHERE ; } return $version; From f474dbd1b9f593d047f5c395f975f2eef3faa1db Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 22 Oct 2013 15:02:48 +0800 Subject: [PATCH 03/93] fix for bug 4260: otherpkgs add /etc/yum.repos.d/xCAT-* for centos --- xCAT/postscripts/otherpkgs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index 2845b5130..84dcaba7f 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -501,7 +501,7 @@ if ( pmatch "$OSVER" "sles11*" && [ $haszypper -eq 1 ] ); then result=`zypper --non-interactive --no-gpg-checks refresh 2>&1` -elif ( pmatch "$OSVER" "rhel*" && [ $hasyum -eq 1 ] ); then +elif ( ((pmatch "$OSVER" "rhel*") || (pmatch "$OSVER" "centos*")) && [ $hasyum -eq 1 ] ); then #remove old repo mkdir -p /etc/yum.repos.d if [ -r "/etc/yum.repos.d/local-repository.repo" ]; then From fd13ae7232b5519e8cde46dcfbbc8f5080f4c08b Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 22 Oct 2013 15:37:07 +0800 Subject: [PATCH 04/93] fix for 4260: otherpkgs to add the fix for SL --- xCAT/postscripts/otherpkgs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index 84dcaba7f..18c46dc5f 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -501,7 +501,7 @@ if ( pmatch "$OSVER" "sles11*" && [ $haszypper -eq 1 ] ); then result=`zypper --non-interactive --no-gpg-checks refresh 2>&1` -elif ( ((pmatch "$OSVER" "rhel*") || (pmatch "$OSVER" "centos*")) && [ $hasyum -eq 1 ] ); then +elif ( ((pmatch "$OSVER" "rhel*") || (pmatch "$OSVER" "centos*") || (pmatch "$OSVER" "SL*")) && [ $hasyum -eq 1 ] ); then #remove old repo mkdir -p /etc/yum.repos.d if [ -r "/etc/yum.repos.d/local-repository.repo" ]; then From 2959c875ed37b52381622177749239d6bde12e40 Mon Sep 17 00:00:00 2001 From: huweihua Date: Tue, 21 Oct 2014 04:32:18 -0400 Subject: [PATCH 05/93] add support for Ubuntu14.04.1 in p8 le --- xCAT/postscripts/configib | 129 +++++++++++++++++++++++++++++++++----- 1 file changed, 112 insertions(+), 17 deletions(-) diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index 904dd0da3..2845695ae 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -17,6 +17,7 @@ # NETWORKS_LINE2='netname=ib1||net=15.0.1.0||mask=255.255.255.0||mgtifname=||gateway=15.0.1.254||dhcpserver=||tftpserver=||nameservers=||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments=' # NETWORKS_LINE3='netname=ib3||net=15.0.3.0||mask=255.255.255.0||mgtifname=||gateway=||dhcpserver=||tftpserver=||nameservers=||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments=' + if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then str_dir_name=`dirname $0` . $str_dir_name/xcatlib.sh @@ -69,7 +70,7 @@ fi #find correct IB driver PLTFRM=`uname` -if [[ $OSVER == rhels5* || "$OSVER" == rhels6* ]] +if [[ $OSVER == rhels5* || "$OSVER" == rhels6* || "$OSVER" == ubuntu14* ]] then ib_driver="rdma" #/sbin/service $ib_driver status @@ -135,24 +136,59 @@ then elif [ -f /etc/SuSE-release ] then OS_name="suse" + elif [ -f /etc/os-release ] && cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null + then + OS_name="ubuntu" else echo "Unsupported to config IB on this OS!" logger -p local4.info -t xcat "Unsupported to config IB on this OS!" exit - fi - - if [ $OS_name == 'suse' ] - then - dir="/etc/sysconfig/network" - else - dir="/etc/sysconfig/network-scripts" fi + + if [ $OS_name != 'ubuntu' ]; then + if [ $OS_name == 'suse' ] + then + dir="/etc/sysconfig/network" + else + dir="/etc/sysconfig/network-scripts" + fi + + #`rm -f $dir/ifcfg-$nic` 2>&1 1>/dev/null + # nic aliases + `rm -f $dir/ifcfg-ib*` 2>&1 1>/dev/null + else + interfaces="/etc/network/interfaces" - # remove the nic configuration files which are included in $NIC_IBNICS - for nic in `echo "$NIC_IBNICS" | tr "," "\n"` - do - rm -f $dir/ifcfg-$nic 2>&1 1>/dev/null - done + for tmp in `sed -n "/auto ib/=" ${interfaces}` + do + startline=`sed -n "/auto ib/=" ${interfaces}| head -n 1` + endline=`sed -n "$startline,/^auto/p" ${interfaces} |wc -l` + + if sed -n "$startline,/^auto/p" ${interfaces} |sed '$!d' |grep "auto" >/dev/null;then + endline=`expr $startline + $endline - 2` + else + endline=`expr $startline + $endline - 1` + fi + + ((startline--)) + temp=`sed -n ${startline}p ${interfaces}` + while [[ $temp =~ ^# ]] + do + ((startline--)) + temp=`sed -n ${startline}p ${interfaces}` + done + ((startline++)) + + temp=`sed -n ${endline}p ${interfaces}` + while [[ $temp =~ ^# ]] + do + ((endline--)) + temp=`sed -n ${endline}p ${interfaces}` + done + + sed -i ${startline},${endline}d ${interfaces} + done + fi else loop_number=`lsdev | grep "IP over Infiniband Network Interface" | wc -l` num=0 @@ -428,6 +464,56 @@ IPADDR=$nicip" > $dir/ifcfg-$nic:$ipindex goodnics="$goodnics,$nic:$ipindex" fi fi # end not the first ip address + elif [ $OS_name == 'ubuntu' ] + then + # First ip address + if [ $ipindex -eq 1 ]; then + # ipv6 + if echo $nicip | grep : 2>&1 1>/dev/null + then + echo "auto $nic +iface $nic inet6 static +address $nicip +netmask $netmask" >> /etc/network/interfaces + + if [ -n "$gateway" ]; then + echo "gateway $gateway" >> /etc/network/interfaces + fi + # ipv4 + else + # Write the info to the ifcfg file + echo "auto $nic +iface $nic inet static +address $nicip +netmask $netmask" >> /etc/network/interfaces + + #if [ -n "$gateway" ]; then + # echo "gateway $gateway" >> /etc/network/interfaces + #fi + fi + else # Not the first ip address + # ipv6 + if echo $nicip | grep : 2>&1 1>/dev/null + then + echo "auto $nic +iface $nic inet6 static +address $nicip +netmask $netmask" >> /etc/network/interfaces + + if [ -n "$gateway" ]; then + echo "gateway $gateway" >> /etc/network/interfaces + fi + else # ipv4 + echo "auto $nic:$ipindex +iface $nic:$ipindex inet static +address $nicip +netmask $netmask" >> /etc/network/interfaces + + #if [ -n "$gateway" ]; then + # echo "gateway $gateway" >> /etc/network/interfaces + #fi + fi + fi else echo "Unsupported operating system" logger -p local4.err -t xcat "Unsupported operating system" @@ -502,18 +588,27 @@ done # end for nic # Bringup all the ib interfaces if [ $PLTFRM == "Linux" ] then - #/sbin/service $ib_driver restart restartservice $ib_driver - for nic in `echo "$goodnics" | tr "," "\n"` + for nic in `echo "$goodnics" | tr "," "\n"|sort -u` do sleep 5 - if [[ "$OSVER" == rhels6* ]] then ip link set dev $nic up else - ifup $nic + if [[ "$OSVER" == ubuntu14* ]] + then + interfaces="/etc/network/interfaces" + for tmp in `cat $interfaces |grep "auto ib" |sort -u|awk '{print $2}'` + do + ifdown $tmp > /dev/null 2>&1 + sleep 2 + ifup $tmp + done + else + ifup $nic + fi fi done fi From 3ce3e80a4c2b151a747a140ac941a0333ecfbd38 Mon Sep 17 00:00:00 2001 From: huweihua Date: Tue, 21 Oct 2014 04:34:35 -0400 Subject: [PATCH 06/93] add support for Ubuntu14.04.1 in p8 le --- .../ib/scripts/Mellanox/mlnxofed_ib_install | 117 +++++++++++++++++- 1 file changed, 113 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install index 96b3aa7bb..da5847c2f 100755 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install +++ b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install @@ -50,6 +50,18 @@ OS=`uname` #installroot='/install/netboot/sles11.1/x86_64/compute/rootimg' INSTALL_DIR='/install' +echo "------------------------------------------" +echo "OFED_DIR=$ofeddir" +echo "OSVER=$OSVER" +echo "arch=$ARCH" +echo "NODESETSTATE=$NODESETSTATE" +echo "mlnxofed_options=$mlnxofed_options" +echo "installroot=$installroot" +NODESETSTATE=install +echo "------------------------------------------" + + + #use arg for the OFED_DIR if defined, ARGNUM=$# if [ $ARGNUM -gt 1 ]; then @@ -73,13 +85,13 @@ if [ -z "$mlnxofed_options" ]; then mlnxofed_options="--without-32bit --force" fi -if [ $NODESETSTATE != "genimage" ]; then +if [[ $NODESETSTATE != "genimage" ]]; then #------------------------- # running as a postscript in a full-disk install or AIX diskless install installroot="" fi if [ $OS != "AIX" ]; then - if [ $NODESETSTATE == "install" ] || [ $NODESETSTATE == "boot" ]; then + if [[ $NODESETSTATE == "install" ]] || [[ $NODESETSTATE == "boot" ]]; then # Being run from a stateful install postscript # Copy rpms directly from the xCAT management node and install mkdir -p /tmp/ofed @@ -92,13 +104,58 @@ if [ $OS != "AIX" ]; then wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=$num --reject "index.html*" --no-parent http://$MASTER$download_dir/ 2> /tmp/wget.log wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=$num --reject "index.html*" --no-parent http://$MASTER$download_dir/.mlnx 2>> /tmp/wget.log wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=$num --reject "index.html*" --no-parent http://$MASTER$download_dir/.supported_kernels 2>> /tmp/wget.log + + + if [ -f /etc/os-release ] && + cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null + then + nodename=`hostname` + echo "$nodename 's operating system is Ubuntu." + echo "If you want to install Mellanox_OFED in $nodename, $nodename must have ability to access public network." + echo -n "checking $nodename 's ability to access public network..........." + if ping -c 3 91.189.88.140 > /dev/null;then + echo "[OK]" + else + echo "[Failed]" + echo "please make your $nodename have ability to access public network" + exit 1 + fi + + cp /etc/apt/sources.list /etc/apt/sources.list.bak + sed -i "/deb http:\\/\\/91.189.88.140\\/ubuntu-ports\\/ trusty main/d" /etc/apt/sources.list + sed -i "/deb http:\\/\\/91.189.88.140\\/ubuntu-ports\\/ trusty-updates main/d" /etc/apt/sources.list + sed -i "/deb http:\\/\\/91.189.88.140\\/ubuntu-ports\\/ trusty universe/d" /etc/apt/sources.list + sed -i "/deb http:\\/\\/91.189.88.140\\/ubuntu-ports\\/ trusty-updates universe/d" /etc/apt/sources.list + + echo "deb http://91.189.88.140/ubuntu-ports/ trusty main +deb http://91.189.88.140/ubuntu-ports/ trusty-updates main +deb http://91.189.88.140/ubuntu-ports/ trusty universe +deb http://91.189.88.140/ubuntu-ports/ trusty-updates universe" >> /etc/apt/sources.list + + apt-get clean all + sleep 1 + apt-get update + fi + #rpm -Uvh --force libibverbs-devel*.rpm #perl -x mlnxofedinstall --without-32bit --force - perl -x mlnxofedinstall $mlnxofed_options + + if [ -f /etc/os-release ] && + cat /etc/os-release|grep NAME|grep Ubuntu>/dev/null && + uname -m |grep ppc64 >/dev/null + then + echo "ARCH=powerpc perl -x mlnxofedinstall $mlnxofed_options" + ARCH=powerpc perl -x mlnxofedinstall $mlnxofed_options + sleep 1 + service openibd restart + else + echo "perl -x mlnxofedinstall $mlnxofed_options" + perl -x mlnxofedinstall $mlnxofed_options + fi rm -Rf /tmp/ofed fi - if [ $NODESETSTATE == "genimage" ]; then + if [[ $NODESETSTATE == "genimage" ]]; then # Being called from .postinstall script # Assume we are on the same machine if [[ $OS == sles* ]] || [[ $OS == suse* ]] || [[ -f /etc/SuSE-release ]]; then @@ -118,6 +175,58 @@ if [ $OS != "AIX" ]; then umount $installroot/dev/ umount $installroot/sys umount $installroot/proc + elif [ -f /etc/os-release ] && + cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null; then +echo "----------------------------" +echo "installroot=$installroot" +echo "OFED_DIR=$OFED_DIR" +echo "----------------------------" + mkdir $installroot/tmp/ofed_install + cp -r $OFED_DIR/ $installroot/tmp/ofed_install/ + + nodename=`hostname` + echo "$nodename 's operating system is Ubuntu." + echo "If you want to install Mellanox_OFED in $nodename, $nodename must have ability to access public network." + echo -n "checking $nodename 's ability to access public network..........." + if ping -c 3 91.189.88.140 > /dev/null;then + echo "[OK]" + else + echo "[Failed]" + echo "please make your $nodename have ability to access public network" + exit 1 + fi + + sourceslist="$installroot/etc/apt/sources.list" + cp $sourceslist $sourceslist.bak + + sed -i "/deb http:\\/\\/91.189.88.140\\/ubuntu-ports\\/ trusty main/d" $sourceslist + sed -i "/deb http:\\/\\/91.189.88.140\\/ubuntu-ports\\/ trusty-updates main/d" $sourceslist + sed -i "/deb http:\\/\\/91.189.88.140\\/ubuntu-ports\\/ trusty universe/d" $sourceslist + sed -i "/deb http:\\/\\/91.189.88.140\\/ubuntu-ports\\/ trusty-updates universe/d" $sourceslist + + echo "deb http://91.189.88.140/ubuntu-ports/ trusty main +deb http://91.189.88.140/ubuntu-ports/ trusty-updates main +deb http://91.189.88.140/ubuntu-ports/ trusty universe +deb http://91.189.88.140/ubuntu-ports/ trusty-updates universe" >> $sourceslist + + chroot $installroot apt-get clean all + sleep 1 + chroot $installroot apt-get update +echo "----------------------------" +ls -l $installroot/tmp/ofed_install/ofed/ +echo "----------------------------" + mount --bind /dev $installroot/dev/ + mount --bind /proc $installroot/proc/ + mount --bind /sys $installroot/sys/ + chroot $installroot apt-get install -y linux-headers-$(uname -r) + + echo "perl -x mlnxofedinstall $mlnxofed_options" + chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options + rm -rf $installroot/tmp/ofed_install + umount $installroot/dev/ + umount $installroot/proc/ + umount $installroot/sys/ + else mkdir $installroot/tmp/ofed_install cp -r $OFED_DIR/ $installroot/tmp/ofed_install/ From 8ea1539aa205fa4edc53554709afd8199fdf7164 Mon Sep 17 00:00:00 2001 From: huweihua Date: Tue, 21 Oct 2014 04:40:02 -0400 Subject: [PATCH 07/93] remove excess debug output --- .../ib/scripts/Mellanox/mlnxofed_ib_install | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install index da5847c2f..1bf577624 100755 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install +++ b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install @@ -50,15 +50,14 @@ OS=`uname` #installroot='/install/netboot/sles11.1/x86_64/compute/rootimg' INSTALL_DIR='/install' -echo "------------------------------------------" -echo "OFED_DIR=$ofeddir" -echo "OSVER=$OSVER" -echo "arch=$ARCH" -echo "NODESETSTATE=$NODESETSTATE" -echo "mlnxofed_options=$mlnxofed_options" -echo "installroot=$installroot" -NODESETSTATE=install -echo "------------------------------------------" +#echo "------------------------------------------" +#echo "OFED_DIR=$ofeddir" +#echo "OSVER=$OSVER" +#echo "arch=$ARCH" +#echo "NODESETSTATE=$NODESETSTATE" +#echo "mlnxofed_options=$mlnxofed_options" +#echo "installroot=$installroot" +#echo "------------------------------------------" @@ -85,7 +84,7 @@ if [ -z "$mlnxofed_options" ]; then mlnxofed_options="--without-32bit --force" fi -if [[ $NODESETSTATE != "genimage" ]]; then #------------------------- +if [[ $NODESETSTATE != "genimage" ]]; then # running as a postscript in a full-disk install or AIX diskless install installroot="" fi @@ -177,10 +176,7 @@ deb http://91.189.88.140/ubuntu-ports/ trusty-updates universe" >> /etc/apt/sour umount $installroot/proc elif [ -f /etc/os-release ] && cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null; then -echo "----------------------------" -echo "installroot=$installroot" -echo "OFED_DIR=$OFED_DIR" -echo "----------------------------" + mkdir $installroot/tmp/ofed_install cp -r $OFED_DIR/ $installroot/tmp/ofed_install/ @@ -212,9 +208,6 @@ deb http://91.189.88.140/ubuntu-ports/ trusty-updates universe" >> $sourceslist chroot $installroot apt-get clean all sleep 1 chroot $installroot apt-get update -echo "----------------------------" -ls -l $installroot/tmp/ofed_install/ofed/ -echo "----------------------------" mount --bind /dev $installroot/dev/ mount --bind /proc $installroot/proc/ mount --bind /sys $installroot/sys/ From 0654fa65e6252000b90fb5f8410f52e625a72e77 Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 22 Oct 2013 16:58:19 +0800 Subject: [PATCH 08/93] fix for bug 2796: should not include AIX perl path in @INC on Linux --- perl-xCAT/xCAT/ServiceNodeUtils.pm | 8 ++------ perl-xCAT/xCAT/TableUtils.pm | 7 ++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/perl-xCAT/xCAT/ServiceNodeUtils.pm b/perl-xCAT/xCAT/ServiceNodeUtils.pm index c76d8d910..049831309 100755 --- a/perl-xCAT/xCAT/ServiceNodeUtils.pm +++ b/perl-xCAT/xCAT/ServiceNodeUtils.pm @@ -10,12 +10,8 @@ BEGIN # if AIX - make sure we include perl 5.8.2 in INC path. # Needed to find perl dependencies shipped in deps tarball. if ($^O =~ /^aix/i) { - use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi"; - use lib "/usr/opt/perl5/lib/5.8.2"; - use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi"; - use lib "/usr/opt/perl5/lib/site_perl/5.8.2"; -} - + unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2)); + } use lib "$::XCATROOT/lib/perl"; use strict; #----------------------------------------------------------------------------- diff --git a/perl-xCAT/xCAT/TableUtils.pm b/perl-xCAT/xCAT/TableUtils.pm index 69599d1fd..e55d194fa 100755 --- a/perl-xCAT/xCAT/TableUtils.pm +++ b/perl-xCAT/xCAT/TableUtils.pm @@ -10,11 +10,8 @@ BEGIN # if AIX - make sure we include perl 5.8.2 in INC path. # Needed to find perl dependencies shipped in deps tarball. if ($^O =~ /^aix/i) { - use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi"; - use lib "/usr/opt/perl5/lib/5.8.2"; - use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi"; - use lib "/usr/opt/perl5/lib/site_perl/5.8.2"; -} + unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2)); + } use lib "$::XCATROOT/lib/perl"; use strict; From 3573ced9eb885d19b0a59a6a850bd27de63da4db Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 20 Oct 2014 01:53:43 -0400 Subject: [PATCH 09/93] defect 4301: buildkit -v does not have correct output --- xCAT-buildkit/bin/buildkit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index 162b71ca4..d058c0e81 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -364,7 +364,8 @@ if ($::VERSION) my $versioncmd = "rpm -q --qf \"%{NAME}: %{VERSION}-%{RELEASE} \n\" xCAT-buildkit"; my $message = "Error quering xCAT-buildkit rpm. Version info is not available. \n"; if ( $debianflag ){ - $versioncmd = "dpkg-query --show -f='\${PackageSpec}: \${Version}\n' xcat-buildkit"; + + $versioncmd = "dpkg-query --show -f='\${binary:Package}: \${Version}\n' xcat-buildkit"; $message = "Error quering xcat-buildkit package. Version info is not available. \n"; } if ( system($versioncmd) ) { From d5320ca9771aa0e8222e2d864d5de4e8db0530b2 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 20 Oct 2014 05:18:19 -0400 Subject: [PATCH 10/93] defect 4302 lskit/lskitcomp --xml has no output --- xCAT-client/pods/man1/lskit.1.pod | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-client/pods/man1/lskit.1.pod b/xCAT-client/pods/man1/lskit.1.pod index 521252cdc..636beac4a 100644 --- a/xCAT-client/pods/man1/lskit.1.pod +++ b/xCAT-client/pods/man1/lskit.1.pod @@ -58,6 +58,7 @@ is a comma-delimited list of kit names. The B command will only display t =item B<-x|--xml|--XML> +Need XCATXMLTRACE=1 env when using -x|--xml|--XML, for example: XCATXMLTRACE=1 lskit -x testkit-1.0.0 Return the output with XML tags. The data is returned as: @@ -156,6 +157,12 @@ To list the framework value of a Kit tarfile. kitframework=2 compatible_kitframeworks=0,1,2 +=item 5. + +To list kit "testkit-1.0-1" with XML tags, enter: + + XCATXMLTRACE=1 lskit -x testkit-1.0-1 + =back From 49bf7c1200bfbeeab424c1c48fc28f34359be2b0 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 20 Oct 2014 05:24:09 -0400 Subject: [PATCH 11/93] defect 4302 lskit/lskitcomp --xml has no output --- xCAT-client/pods/man1/lskitcomp.1.pod | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-client/pods/man1/lskitcomp.1.pod b/xCAT-client/pods/man1/lskitcomp.1.pod index eac6a6b11..b9d0eb2dd 100644 --- a/xCAT-client/pods/man1/lskitcomp.1.pod +++ b/xCAT-client/pods/man1/lskitcomp.1.pod @@ -47,6 +47,7 @@ is a comma-delimited list of kit component names. The B command will =item B<-x|--xml|--XML> +Need XCATXMLTRACE=1 env when using -x|--xml|--XML. Return the output with XML tags. The data is returned as: @@ -140,6 +141,12 @@ To list kit components compatible with "rhels-6.2-x86_64" osdistro and "computen lskitcomp -O rhels-6.2-x86_64 -S computenode +=item 6. + +To list the kit component "testkit-compute-1.0-1-ubuntu-14.04-ppc64el" with XML tags, enter: + + XCATXMLTRACE=1 lskitcomp -x testkit-compute-1.0-1-ubuntu-14.04-ppc64el + =back From 1d781ea39fb9cbd5754439a7bfb3c2dec657ee6c Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 20 Oct 2014 14:42:54 -0400 Subject: [PATCH 12/93] Bug #3832 rewrite logic for dhcpd config, avoid dual code path --- xCAT-server/lib/xcat/plugins/dhcp.pm | 139 +++++++++++++-------------- 1 file changed, 67 insertions(+), 72 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 10bedbae8..3fd6c5a82 100755 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -1487,92 +1487,88 @@ sub process_request if ( $^O ne 'aix') { + my $os = xCAT::Utils->osver(); #add the active nics to /etc/sysconfig/dhcpd or /etc/default/dhcp3-server(ubuntu) my $dhcpver; my %missingfiles = ( "dhcpd"=>1, "dhcpd6"=>1, "dhcp3-server"=>1 ); - foreach $dhcpver ("dhcpd","dhcpd6","dhcp3-server", "isc-dhcp-server") { - if (-e "/etc/sysconfig/$dhcpver") { - # for dhcpd, dhcpd6 - if ($dhcpver eq "dhcpd") { - delete($missingfiles{dhcpd}); - delete($missingfiles{"dhcp3-server"}); - } else { - delete($missingfiles{$dhcpver}); - } - open DHCPD_FD, "/etc/sysconfig/$dhcpver"; - my $syscfg_dhcpd = ""; - my $found = 0; + foreach $dhcpver ("dhcpd", "dhcpd6", "dhcp3-server", "isc-dhcp-server") { + + # if ipv6 is not present, no need to look at dhcpd6 files + if (!$usingipv6 and $dhcpver eq "dhcpd6") { + delete($missingfiles{"dhcpd6"}); + next; + } + + # check the possible system config paths for the various Linux O/S + my $syspath; + foreach $syspath ("/etc/sysconfig", "/etc/default") { + + my $generatedpath = "$syspath/$dhcpver"; my $dhcpd_key = "DHCPDARGS"; - my $os = xCAT::Utils->osver(); + if ($os =~ /sles/i) { $dhcpd_key = "DHCPD_INTERFACE"; - } - - my $ifarg = "$dhcpd_key=\""; - foreach (keys %activenics) { - if (/!remote!/) { next; } - $ifarg .= " $_"; - } - $ifarg =~ s/\=\" /\=\"/; - $ifarg .= "\"\n"; - - while () { - if ($_ =~ m/^$dhcpd_key/) { - $found = 1; - $syscfg_dhcpd .= $ifarg; - } else { - $syscfg_dhcpd .= $_; + if ($usingipv6 and $dhcpver eq "dhcpd6") { + # For SLES, the dhcpd6 "dhcpver" is going to modify the dhcpd conf file with key=DHCPD6_INTERFACE + $dhcpd_key = "DHCPD6_INTERFACE"; + $generatedpath = "$syspath/dhcpd"; } } - if ( $found eq 0 ) { - $syscfg_dhcpd .= $ifarg; - } - close DHCPD_FD; - - open DBG_FD, '>', "/etc/sysconfig/$dhcpver"; - print DBG_FD $syscfg_dhcpd; - close DBG_FD; - } elsif (-e "/etc/default/$dhcpver") { #ubuntu - delete($missingfiles{"dhcpd"}); - #dhcpd and dhcpd6 use the same configure file - delete($missingfiles{"dhcpd6"}); - delete($missingfiles{"dhcp3-server"}); - open DHCPD_FD, "/etc/default/$dhcpver"; - my $syscfg_dhcpd = ""; - my $found = 0; - my $dhcpd_key = "INTERFACES"; - my $os = xCAT::Utils->osver(); - - my $ifarg = "$dhcpd_key=\""; - foreach (keys %activenics) { - if (/!remote!/) { next; } - $ifarg .= " $_"; - } - $ifarg =~ s/^ //; - $ifarg .= "\"\n"; - - while () { - if ($_ =~ m/^$dhcpd_key/) { - $found = 1; - $syscfg_dhcpd .= $ifarg; - } else { - $syscfg_dhcpd .= $_; + if ($generatedpath and -e "$generatedpath") { + # remove the file from the hash because it will be processed + if ($dhcpver eq "dhcpd") { + # If dhcpd is found, then not necessary to find dhcp3-server + delete($missingfiles{"dhcp3-server"}); } - } - if ( $found eq 0 ) { - $syscfg_dhcpd .= $ifarg; - } - close DHCPD_FD; + # UBUNTU/DEBIAN specific + if ($dhcpver eq "isc-dhcp-server") { + # UBUNTU/DEBIAN configuration ipv6 & ipv4 uses the isc-dhcp-server + # remove all other from the missingfiles hash + delete($missingfiles{"dhcpd"}); + delete($missingfiles{"dhcpd6"}); + delete($missingfiles{"dhcp3-server"}); - open DBG_FD, '>', "/etc/default/$dhcpver"; - print DBG_FD $syscfg_dhcpd; - close DBG_FD; + $dhcpd_key = "INTERFACES"; + } + delete($missingfiles{$dhcpver}); + + open DHCPD_FD, "$generatedpath"; + my $syscfg_dhcpd = ""; + my $found = 0; + + my $ifarg = "$dhcpd_key=\""; + foreach (keys %activenics) { + if (/!remote!/) { next; } + $ifarg .= " $_"; + } + $ifarg =~ s/\=\" /\=\"/; + $ifarg .= "\"\n"; + + while () { + if ($_ =~ m/^$dhcpd_key/) { + $found = 1; + $syscfg_dhcpd .= $ifarg; + } else { + $syscfg_dhcpd .= $_; + } + } + + if ( $found eq 0 ) { + $syscfg_dhcpd .= $ifarg; + } + close DHCPD_FD; + + # write out the new file with the interfaces defined + open DBG_FD, '>', "$generatedpath"; + print DBG_FD $syscfg_dhcpd; + close DBG_FD; + } } } + if ($usingipv6) { - my $os = xCAT::Utils->osver(); # sles had dhcpd and dhcpd6 config in the dhcp file if ($os =~ /sles/i) { if ($missingfiles{dhcpd}) { @@ -1587,7 +1583,6 @@ sub process_request if ($missingfiles{dhcpd}) { $callback->({error=>["The file /etc/sysconfig/dhcpd doesn't exist, check the dhcp server"]}); } - } unless ($dhcpconf[0]) From 9552485df66d88f57733ab4f59ddaf69b7aaebf6 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Tue, 21 Oct 2014 05:18:14 -0400 Subject: [PATCH 13/93] genimage cannot use Symbolic link in ubuntu,use mount --band instead --- xCAT-server/lib/xcat/plugins/kit.pm | 31 +++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 8516b8a51..94c59d717 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -17,6 +17,7 @@ use lib "$::XCATROOT/lib/perl"; use xCAT::Table; use xCAT::Utils; use xCAT::MsgUtils; +use xCAT::BuildKitUtils; use Getopt::Long; #use Data::Dumper; use File::Basename; @@ -31,6 +32,12 @@ $::KITFRAMEWORK ="2"; # this code is compatible with other kits that are at framework 0 or 1. $::COMPATIBLE_KITFRAMEWORKS = "0,1,2"; +my $debianflag = 0; +my $tempstring = xCAT::BuildKitUtils->osver(); +if ( $tempstring =~ /debian/ || $tempstring =~ /ubuntu/ ){ + $debianflag = 1; + print "debian"; +} #------------------------------------------------------- @@ -576,11 +583,23 @@ sub assign_to_osimage unless ( -d "$otherpkgdir" ) { mkpath("$otherpkgdir"); } - - # Create symlink if doesn't exist - unless ( -d "$otherpkgdir/$kitcomptable->{kitreponame}" ) { + if ( $debianflag ) + { + unless ( -d "$otherpkgdir/$kitcomptable->{kitreponame}" ) + { + system("mkdir -p $otherpkgdir/$kitcomptable->{kitreponame}"); + print "mkdir -p $otherpkgdir/$kitcomptable->{kitreponame}"; + system("mount --bind $kitrepodir $otherpkgdir/$kitcomptable->{kitreponame}"); + print "mount --bind $kitrepodir $otherpkgdir/$kitcomptable->{kitreponame}"; + } + } + else + { + # Create symlink if doesn't exist + unless ( -d "$otherpkgdir/$kitcomptable->{kitreponame}" ) { system("ln -sf $kitrepodir $otherpkgdir/$kitcomptable->{kitreponame} "); - } + } + } } else { $callback->({error => ["Cannot open linuximage table or otherpkgdir do not exist"],errorcode=>[1]}); return 1; @@ -2729,6 +2748,10 @@ sub rmkitcomp } } if ( !$match ) { + if ( $debianflag ) + { + system("umount -f $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame}"); + } system("rm -rf $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame}"); } } From 2c070624ff5409c618130dbdcabad1b2d64cc6ff Mon Sep 17 00:00:00 2001 From: immarvin Date: Tue, 21 Oct 2014 03:18:04 -0700 Subject: [PATCH 14/93] process the genimage with kit stuff --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 2298b324b..12101fbd8 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -1752,7 +1752,7 @@ sub mount_chroot { system("mount -o bind $pkgdir $rootimage_dir/mnt/pkgdir"); if ($otherpkgdir){ if(-d $otherpkgdir){ - system("mount -o bind $otherpkgdir $rootimage_dir/mnt/otherpkgdir"); + system("mount --rbind $otherpkgdir $rootimage_dir/mnt/otherpkgdir"); }else{ print "The specified otherpkgdir $otherpkgdir does not exist!\n" } @@ -1765,7 +1765,8 @@ sub umount_chroot { #system("umount $rootimage_dir/proc"); #system("umount $rootimage_dir/sys"); system("umount $rootimage_dir/mnt/pkgdir"); - system("umount $rootimage_dir/mnt/otherpkgdir"); + #system("umount $rootimage_dir/mnt/otherpkgdir"); + system("grep /mnt/otherpkgdir /proc/mounts | cut -f2 -d' ' | sort -r|xargs umount"); rmdir("$rootimage_dir/mnt/pkgdir"); rmdir("$rootimage_dir/mnt/otherpkgdir"); } From 402c91cfcc988c882abea35654b3e7432c3c7234 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 21 Oct 2014 15:23:44 -0400 Subject: [PATCH 15/93] fix syntax error --- xCAT-server/lib/xcat/plugins/xCATWorld.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/xCATWorld.pm b/xCAT-server/lib/xcat/plugins/xCATWorld.pm index ff7bf1e6c..09268ace7 100644 --- a/xCAT-server/lib/xcat/plugins/xCATWorld.pm +++ b/xCAT-server/lib/xcat/plugins/xCATWorld.pm @@ -102,8 +102,9 @@ sub process_request my $args = $request->{arg}; my $envs = $request->{env}; my %rsp; - my @nodes=@$nodes; - @ARGV = @{$args}; # get arguments + if (defined $args) { + @ARGV = @{$args}; # get arguments + } $::CALLBACK=$callback; # do your processing here # return info @@ -142,7 +143,7 @@ if ( # save your callback function my $out=xCAT::Utils->runxcmd( { command => ['xdsh'], - node => \@nodes, + node => \@$nodes, arg => [ "-v","ls /tmp" ] }, $subreq, 0,1); @@ -151,7 +152,7 @@ if ( my $rsp={}; $rsp->{data}->[0] = "Hello World from $host! I can process the following nodes:"; xCAT::MsgUtils->message("I", $rsp, $callback, 0); - foreach my $node (@nodes) + foreach my $node (@$nodes) { $rsp->{data}->[0] .= "$node\n"; } From d718ba8396cf07c2c73c66623dd8dfbc3a1adffb Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 22 Oct 2014 02:03:07 -0400 Subject: [PATCH 16/93] defect 4283: add note head of the subtourines (in hosts.pm) which called in ddns.pm. Generally xcat does not suggest that call subroutine of xcat_plugin from antoher xcat_plugin module, but since the change would be big, I add this note head the subroutines as a notification for the member who would change the involved subroutines. --- xCAT-server/lib/xcat/plugins/hosts.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/hosts.pm b/xCAT-server/lib/xcat/plugins/hosts.pm index 898e620ed..7868e41f5 100755 --- a/xCAT-server/lib/xcat/plugins/hosts.pm +++ b/xCAT-server/lib/xcat/plugins/hosts.pm @@ -233,6 +233,12 @@ sub delotherinterfaces } } + +##!!!!!!!!!!!!!!!!!!! +# NOTE FOR CHANGING # +# This subroutine is called in ddns.pm, please take care the calling in ddns.pm +# for your changes, especially the change upon the subroutine interface +##!!!!!!!!!!!!!!!!!!! sub add_hosts_content { my %args = @_; my $nodelist = $args{nodelist}; @@ -585,6 +591,12 @@ sub writeout =cut #------------------------------------------------------------------------------- + +##!!!!!!!!!!!!!!!!!!! +# NOTE FOR CHANGING # +# This subroutine is called in ddns.pm, please take care the calling in ddns.pm +# for your changes, especially the change upon the subroutine interface +##!!!!!!!!!!!!!!!!!!! sub donics { my %args = @_; From a049575c4fbb9aaacbb40d5a35362140bef1e4f0 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 22 Oct 2014 03:21:39 -0700 Subject: [PATCH 17/93] fix bug 4305:error info :Unknown arch during ubuntu 14.04.01 osimage nodeset on p8le env --- xCAT-server/lib/xcat/plugins/debian.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 74d7849a5..62cc32abd 100755 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -600,7 +600,9 @@ sub mkinstall $darch = "i386"; } else { - xCAT::MsgUtils->message("S","debian.pm: Unknown arch ($arch)"); + if ($arch ne "ppc64le" and $arch ne "ppc64el") { + xCAT::MsgUtils->message("S","debian.pm: Unknown arch ($arch)"); + } $darch = $arch; } From c270d5e563d89682262e3b1b68b38a8f2e36a989 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 22 Oct 2014 08:26:00 -0700 Subject: [PATCH 18/93] support copycds and nodeset for SLES 12 ppc64le --- xCAT-server/lib/xcat/plugins/sles.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 3fb45e46f..ce22e536c 100755 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1010,6 +1010,11 @@ sub mkinstall and -r "$pkgdir/1/boot/i386/loader/linux" and -r "$pkgdir/1/boot/i386/loader/initrd" ) + or ( + $arch eq "ppc64le" + and -r "$pkgdir/1/boot/ppc64le/linux" + and -r "$pkgdir/1/boot/ppc64le/initrd" + ) or ($arch =~ /ppc/ and -r "$pkgdir/1/suseboot/inst64") ) { @@ -1050,6 +1055,12 @@ sub mkinstall copy("$pkgdir/1/boot/i386/loader/initrd", "$tftppath"); @dd_drivers = &insert_dd($callback, $os, $arch, "$tftppath/initrd", "$tftppath/linux", $driverupdatesrc, $netdrivers, $osupdir, $ignorekernelchk); } + } elsif ($arch eq "ppc64le") { + unless ($noupdateinitrd) { + copy("$pkgdir/1/boot/$arch/linux", "$tftppath"); + copy("$pkgdir/1/boot/$arch/initrd", "$tftppath"); + @dd_drivers = &insert_dd($callback, $os, $arch, "$tftppath/initrd", "$tftppath/linux", $driverupdatesrc, $netdrivers, $osupdir, $ignorekernelchk); + } } elsif ($arch =~ /ppc/) { @@ -1231,7 +1242,7 @@ sub mkinstall my $kernelpath; my $initrdpath; - if ($arch =~ /x86/) + if ($arch =~ /x86/ or $arch eq "ppc64le") { $kernelpath = "$rtftppath/linux"; $initrdpath = "$rtftppath/initrd"; @@ -1732,6 +1743,9 @@ sub copycd { $darch = "x86"; } + elsif ($darch and ($darch eq "ppc64le" or $darch eq "ppc64el")) { + $darch = "ppc64le"; + } elsif ($darch and $darch =~ /ppc/) { $darch = "ppc64"; From ccfa70d8c855cf66c2c2310be355a29fec36ef96 Mon Sep 17 00:00:00 2001 From: huweihua Date: Wed, 22 Oct 2014 05:23:43 -0400 Subject: [PATCH 19/93] support lvm in legacy mode on x system --- xCAT/postscripts/configefi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/configefi b/xCAT/postscripts/configefi index 1fc433126..b5cc4e54c 100644 --- a/xCAT/postscripts/configefi +++ b/xCAT/postscripts/configefi @@ -31,7 +31,8 @@ if [ "$arch" = "x86_64" ]; then grep -v rootfs /proc/mounts > /etc/mtab boot_device='' if [ -f "/etc/systemconfig/systemconfig.conf" ];then - boot_root=`cat /etc/systemconfig/systemconfig.conf | grep ROOTDEV | awk '{print $3}'` + #boot_root=`cat /etc/systemconfig/systemconfig.conf | grep ROOTDEV | awk '{print $3}'` + boot_root=`mount | grep -E ' on\s+/ type ' | awk '{print $1}'` boot_device=`cat /etc/systemconfig/systemconfig.conf | grep BOOTDEV | awk '{print $3}'` else boot_root=`mount | grep -E ' on\s+/ type ' | awk '{print $1}'` From b5f708ed39031675d83eaf447e15998d4ee08698 Mon Sep 17 00:00:00 2001 From: huweihua Date: Wed, 22 Oct 2014 05:36:16 -0400 Subject: [PATCH 20/93] fix defect 4289: sysclone failed to update target node with rpm update --- xCAT/postscripts/syscloneimgupdate | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT/postscripts/syscloneimgupdate b/xCAT/postscripts/syscloneimgupdate index add1e21be..a77835e7a 100755 --- a/xCAT/postscripts/syscloneimgupdate +++ b/xCAT/postscripts/syscloneimgupdate @@ -32,7 +32,6 @@ for filename in \ /opt/xcat \ /root/.ssh \ /var/cache \ - /var/lib \ /xcatpost do if [ ! -e $filename ];then From 75f15ce9b7179c554d713ca301258c6f194f3155 Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 22 Oct 2014 07:42:42 -0400 Subject: [PATCH 21/93] SLES12/rsyslog 8 support defect 4311 --- xCAT/postscripts/syslog | 50 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index 13e917fbb..e90ac7bdb 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -114,6 +114,38 @@ config_Rsyslog_C3() fi } +# THis sets up rsyslog 8.x, quite different from the previous rsyslog versions. + +config_rsyslog_V8() +{ + isReceiving=0 + remoteconf="/etc/rsyslog.d/remote.conf" + + + if [ -f /etc/xCATMN ] || [ $isSN -eq 1 ] + then + isReceiving=1 + fi + + if [ ! -f $remoteconf.XCATORIG ]; then + cp -f $remoteconf $remoteconf.XCATORIG + fi + # check if already an entry, we need to replace it + grep "xCAT settings" $remoteconf 2>&1 1> /dev/null + if [ $? -eq 0 ]; then + sed "/# xCAT settings/,$ d" $remoteconf >/tmp/sed.tmp + cat /tmp/sed.tmp >$remoteconf + fi + + + echo "# xCAT settings" >> $remoteconf + echo "*.* @$master" >> $remoteconf + + restartservice syslog + +} + + #echo "NTYPE=$NTYPE,OSVER=$OSVER,OSTYPE=$OSTYPE" if [ "$NTYPE" = service ]; then @@ -124,6 +156,20 @@ fi # systemdEnabled=1 #fi +# check if this is rsyslog version 8, setup is different no matter what OS. +# We only update the /etc/rsyslog.d/remote.conf file to point to the xcatmaster. +# Do not even touch rsyslog.conf +# There is no /etc/sysconfig/rsyslog file, so we use rsyslogd -v to get the version +SYSLOGPROD=`rsyslogd -v | grep rsyslogd |awk {'print $1'}` +SYSLOGVER=`rsyslogd -v | grep rsyslogd |awk {'print $2'}` +if ( pmatch $SYSLOGPROD "*rsyslogd*" ) && ( pmatch $SYSLOGVER "8*" ); then + config_rsyslog_V8 +#keep a record + logger -t xCAT -p local4.info "Install: rsyslog version 8 setup" + exit 0 +fi + +echo " not configuring $SYSLOGVER" if [ "$(uname -s)" = "Linux" ]; then if ( pmatch $OSVER "fedora*" ) || ( pmatch $OSVER "rhels5*" ) || ( pmatch $OSVER "rhel6*" ) || ( pmatch $OSVER "rhels6*" ) || [ -f /etc/fedora-release ] || [ -f /etc/redhat-release ] || ( pmatch $OSVER "ubuntu*" ) || ( is_lsb_ubuntu ) || ( pmatch $OSVER "debian*" ); then if [ -e /etc/rsyslog.conf ]; then @@ -158,13 +204,13 @@ fi -#handle sysconfig file to make remote loggling possible +#handle sysconfig file to make remote logging possible if [ $isLinux -eq 1 ] && [ -e $sysconfig ]; then if [ ! -f "$sysconfig.XCATORIG" ]; then cp -f $sysconfig $sysconfig.XCATORIG fi - #check if it is ryslog version 3, it has totally different settings in /etc/syslog.cong + #check if it is ryslog version 3, it has totally different settings in /etc/syslog.conf if [ $isRsyslog -eq 1 ]; then grep "SYSLOGD_OPTIONS" $sysconfig | grep -e "[\-c 3|\-c3|\-c4|\-c 4]" 2>&1 1> /dev/null if [ $? -eq 0 ]; then From de215daef344a42cb38b51ebb3776723f9d38d99 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 22 Oct 2014 14:55:08 -0700 Subject: [PATCH 22/93] fix bug: 4310 xdsh to Cisco SG300-52 switch does not work --- xCAT-server/lib/perl/xCAT/RShellAPI.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/RShellAPI.pm b/xCAT-server/lib/perl/xCAT/RShellAPI.pm index e6fbdad1a..c3390d287 100644 --- a/xCAT-server/lib/perl/xCAT/RShellAPI.pm +++ b/xCAT-server/lib/perl/xCAT/RShellAPI.pm @@ -146,7 +146,7 @@ sub run_remote_shell_api { my $pw_tried=0; my $login_done=0; my ($prematch, $match)= $t->waitfor(Match => '/login[: ]*$/i', - Match => '/username[: ]*$/i', + Match => '/User Name[: ]*$/i', Match => '/password[: ]*$/i', Match => "/$prompt/", Errmode => "return"); @@ -155,7 +155,7 @@ sub run_remote_shell_api { } if ($match =~ /$prompt/) { $login_done=1; - } elsif (($match =~ /username[: ]*$/i) || ($match =~ /login[: ]*$/i )) { + } elsif (($match =~ /User Name[: ]*$/i) || ($match =~ /login[: ]*$/i )) { # user name if ($user) { if (! $t->put(String => "$user\n", From 0096a8dde047bd6bec88b4b4be977a1a69ef4feb Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 22 Oct 2014 15:39:24 -0700 Subject: [PATCH 23/93] fix bug: 4310 xdsh to Cisco SG300-52 switch does not work, don't affect the original supporting --- xCAT-server/lib/perl/xCAT/RShellAPI.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/RShellAPI.pm b/xCAT-server/lib/perl/xCAT/RShellAPI.pm index c3390d287..f0bda278c 100644 --- a/xCAT-server/lib/perl/xCAT/RShellAPI.pm +++ b/xCAT-server/lib/perl/xCAT/RShellAPI.pm @@ -146,6 +146,7 @@ sub run_remote_shell_api { my $pw_tried=0; my $login_done=0; my ($prematch, $match)= $t->waitfor(Match => '/login[: ]*$/i', + Match => '/username[: ]*$/i', Match => '/User Name[: ]*$/i', Match => '/password[: ]*$/i', Match => "/$prompt/", @@ -155,7 +156,7 @@ sub run_remote_shell_api { } if ($match =~ /$prompt/) { $login_done=1; - } elsif (($match =~ /User Name[: ]*$/i) || ($match =~ /login[: ]*$/i )) { + } elsif (($match =~ /User Name[: ]*$/i) || ($match =~ /username[: ]*$/i) || ($match =~ /login[: ]*$/i )) { # user name if ($user) { if (! $t->put(String => "$user\n", From f904ce2cc1ee257e91db4cb71b64a07cd750c663 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 22 Oct 2014 16:12:27 -0400 Subject: [PATCH 24/93] add media tags for rhels6.6 support, x86_64 and power --- perl-xCAT/xCAT/data/discinfo.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 5615d3e59..7fcb4ad77 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -67,6 +67,8 @@ require Exporter; "1359576196.686790" => "rhels6.4", #ppc64 "1384196515.415715" => "rhels6.5", #x86_64 "1384198011.520581" => "rhels6.5", #ppc64 + "1411733344.627228" => "rhels6.6", #x86_64 + "1411733344.616389" => "rhels6.6", #ppc64 "1285193176.593806" => "rhelhpc6", #x86_64 "1305067719.718814" => "rhelhpc6.1",#x86_64 "1321545261.599847" => "rhelhpc6.2",#x86_64 From 7e8c02bf072c52907e01999befb24b2d04ad8d98 Mon Sep 17 00:00:00 2001 From: mellor Date: Wed, 22 Oct 2014 17:20:07 -0400 Subject: [PATCH 25/93] defect 4304 - fixed some more interprocess communication problems --- xCAT-server/sbin/xcatd | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index d8b4a7abd..a0b2a58e7 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -25,6 +25,8 @@ my %supported_encodes = ( ); my $sslctl; my $udpctl; +my $pid_UDP; +my $pid_MON; # if AIX - make sure we include perl 5.8.2 in INC path. # Needed to find perl dependencies shipped in deps tarball. if ($^O =~ /^aix/i) { @@ -198,8 +200,13 @@ $xcatdir = (($tmp and $tmp->{value}) ? $tmp->{value} : "/etc/xcat"); $sitetab->close; my $progname; my $pipeexpected; +my $ssl2udppipe=0; $SIG{PIPE} = sub { if ($pipeexpected) { return; } + if ($ssl2udppipe) { + xCAT::MsgUtils->message("S","SIGPIPE xcatd SSL listener to udp service pipe is broken. Ignore this error if you are shutting down or restarting xcatd."); + return; + } confess "SIGPIPE $$progname encountered a broken pipe (probably Ctrl-C by client)"; }; $progname = \$0; @@ -851,6 +858,10 @@ my %immediatechildren; sub generic_reaper { local($!); while (($CHILDPID=waitpid(-1,WNOHANG)) > 0) { + if (($CHILDPID == $pid_UDP) && ($udpctl)) { + # got here because UDP child is gone + close($udpctl); $udpctl=0; + } yield; } $SIG{CHLD} = \&generic_reaper; @@ -865,9 +876,15 @@ sub ssl_reaper { $sslclients--; $numdone--; } + if (($CHILDPID == $pid_UDP) && ($udpctl)) { + # got here because UDP child is gone + close($udpctl); $udpctl=0; + } } if ($udpctl) { + $ssl2udppipe=1; store_fd({clientcountchange=>$numdone,sslclientcount=>$sslclients},$udpctl); #notify udp service of how many clients are active + $ssl2udppipe=0; } $SIG{CHLD} = \&ssl_reaper; } @@ -879,6 +896,10 @@ sub dispatch_reaper { delete $dispatched_children{$CHILDPID}; $dispatch_children--; } + if (($CHILDPID == $pid_UDP) && ($udpctl)) { + # got here because UDP child is gone + close($udpctl); $udpctl=0; + } } $SIG{CHLD} = \&dispatch_reaper; } @@ -890,14 +911,16 @@ sub plugin_reaper { delete $plugin_children{$CHILDPID}; $plugin_numchildren--; } + if (($CHILDPID == $pid_UDP) && ($udpctl)) { + # got here because UDP child is gone + close($udpctl); $udpctl=0; + } } $SIG{CHLD} = \&plugin_reaper; } $SIG{CHLD} = \&generic_reaper; -my $pid_UDP; -my $pid_MON; $SIG{TERM} = $SIG{INT} = sub { #printf("Asked to quit...\n"); $quit++; @@ -1211,7 +1234,9 @@ if ($inet6support) { } $sslclients++; #THROTTLE if ($udpctl) { + $ssl2udppipe=1; store_fd({clientcountchange=>1,sslclientcount=>$sslclients},$udpctl); #notify udp service of how many clients are active + $ssl2udppipe=0; } $cnnection->close(); } @@ -2113,7 +2138,7 @@ sub get_request { my $request = shift; if ($encode eq "xml") { my $line = ""; - while ($request !~ m/<\/xcatrequest>/) { + while ((!$request) || ($request !~ m/<\/xcatrequest>/)) { my $flags=fcntl($sock,F_GETFL,0); $flags |= O_NONBLOCK; #we want sysread to bail on us, select seems to be evil to us still.. fcntl($sock,F_SETFL,$flags); From 73d08b58fa334746c7162227c52f4c1c64791d0c Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 22 Oct 2014 18:36:59 -0400 Subject: [PATCH 26/93] added nmapoptions in the site table to resolve network slow response issues in nmap. defect 4300 --- perl-xCAT/xCAT/NetworkUtils.pm | 8 +- perl-xCAT/xCAT/PPCenergy.pm | 10 +- perl-xCAT/xCAT/SLP.pm | 3 + perl-xCAT/xCAT/Schema.pm | 7 ++ xCAT-client/bin/pping | 6 +- xCAT-server/lib/xcat/plugins/nodestat.pm | 151 ++++++++++++----------- 6 files changed, 107 insertions(+), 78 deletions(-) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index 7d42970ba..6bfd957fd 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -2182,7 +2182,13 @@ sub pingNodeStatus { foreach (@mon_nodes) { $deadnodes{$_}=1; } - open (NMAP, "nmap -PE --system-dns --send-ip -sP ". $nodes . " 2> /dev/null|") or die("Cannot open nmap pipe: $!"); + + # get additional options from site table + my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions"); + my $more_options = $nmap_options[0]; + + #call namp + open (NMAP, "nmap -PE --system-dns --send-ip -sP $more_options ". $nodes . " 2> /dev/null|") or die("Cannot open nmap pipe: $!"); my $node; while () { if (/Host (.*) \(.*\) appears to be up/) { diff --git a/perl-xCAT/xCAT/PPCenergy.pm b/perl-xCAT/xCAT/PPCenergy.pm index eb5d6abe9..eb8c53723 100644 --- a/perl-xCAT/xCAT/PPCenergy.pm +++ b/perl-xCAT/xCAT/PPCenergy.pm @@ -14,7 +14,7 @@ use xCAT::Usage; use xCAT::NodeRange; use xCAT::DBobjUtils; use xCAT::FSPUtils; -use xCAT::TableUtils qw(get_site_Master); +use xCAT::TableUtils; %::QUERY_ATTRS = ( 'savingstatus' => 1, 'dsavingstatus' => 1, @@ -223,7 +223,6 @@ sub renergy { my ($node, $attrs) = %$nodehash; my $cec_name = @$attrs[2]; my $hw_type = @$attrs[4]; - if (!$cec_name) { return ([[$node, "ERROR: Cannot find the cec name, check the attributes: vpd.serial, vpd.mtm.", 1]]); @@ -295,7 +294,12 @@ sub renergy { foreach (@hcps_ip) { $deadnodes{$_}=1; } - open (NMAP, "nmap -PE --system-dns --send-ip -sP ". join(' ',@hcps_ip) . " 2> /dev/null|") or die("Cannot open nmap pipe: $!"); + + # get additional options from site table + my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions"); + my $more_options = $nmap_options[0]; + + open (NMAP, "nmap -PE --system-dns --send-ip -sP $more_options ". join(' ',@hcps_ip) . " 2> /dev/null|") or die("Cannot open nmap pipe: $!"); my $node; while () { #print "$_\n"; diff --git a/perl-xCAT/xCAT/SLP.pm b/perl-xCAT/xCAT/SLP.pm index 3e8c5f438..d84d0a8ac 100755 --- a/perl-xCAT/xCAT/SLP.pm +++ b/perl-xCAT/xCAT/SLP.pm @@ -116,6 +116,9 @@ sub dodiscover { send_message($args{reqcallback}, 0, "The rarge is too large and may be time consuming. Broadcast is recommended."); } } + + #no need to check site.nmapoptions because it specifilly + # uses T5 for certain performance requirement. `/usr/bin/nmap $range -sn -PE -n --send-ip -T5 `; my $nmapres = `/usr/bin/nmap $range -PE -p 427 -n --send-ip -T5 `; foreach my $line (split(/\n\n/,$nmapres)) { diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index e644c375a..8ed823d11 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1122,6 +1122,13 @@ site => { " httpport: The port number that the booting/installing nodes should contact the\n". " http server on the MN/SN on. It is your responsibility to configure\n". " the http server to listen on that port - xCAT will not do that.\n\n". + " nmapoptions: Additional options for the nmap command. nmap is used in pping, \n". + " nodestat, xdsh -v and updatenode commands. Sometimes additional \n". + " performance tuning may be needed for nmap due to network traffic.\n". + " For example, if the network response time is too slow, nmap may not\n". + " give stable output. You can increase the timeout value by specifying \n". + " '--min-rtt-timeout 1s'. xCAT will append the options defined here to \n". + " the nmap command.\n\n". " ntpservers: A comma delimited list of NTP servers for the cluster - often the\n". " xCAT management node.\n\n". " svloglocal: if set to 1, syslog on the service node will not get forwarded to the\n". diff --git a/xCAT-client/bin/pping b/xCAT-client/bin/pping index e08755fe5..40af26b2e 100755 --- a/xCAT-client/bin/pping +++ b/xCAT-client/bin/pping @@ -169,7 +169,11 @@ sub nmap_pping { foreach (@$nodes) { $deadnodes{$_}=1; } - open (FPING, "nmap -PE --system-dns --send-ip -sP ".join(' ',@$nodes). " 2> /dev/null|") or die("Cannot open nmap pipe: $!"); + # get additional options from site table + my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions"); + my $more_options = $nmap_options[0]; + + open (FPING, "nmap -PE --system-dns --send-ip -sP $more_options ".join(' ',@$nodes). " 2> /dev/null|") or die("Cannot open nmap pipe: $!"); my $node; while () { if (/Host (.*) \(.*\) appears to be up/) { diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index 2201d7d2e..e8f04b181 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -187,8 +187,8 @@ sub preprocess_request #my $sitetab = xCAT::Table->new('site'); #if ($sitetab) { #(my $ref) = $sitetab->getAttribs({key => 'useNmapfromMN'}, 'value'); - my @entries = xCAT::TableUtils->get_site_attribute("useNmapfromMN"); - my $t_entry = $entries[0]; + my @entries = xCAT::TableUtils->get_site_attribute("useNmapfromMN"); + my $t_entry = $entries[0]; if (defined($t_entry)) { if ($t_entry =~ /1|yes|YES|Y|y/) { $usenmapfrommn=1; } } @@ -634,79 +634,84 @@ sub process_request_nmap { my %rsp; my $installquerypossible=0; my @nodesetnodes=(); + + # get additional options from site table + my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions"); + my $more_options = $nmap_options[0]; + foreach my $ip6 (0,1) { #first pass, ipv4, second pass ipv6 - if ($ip6 and scalar(@ip6s)) { - open($fping,"nmap -6 -PS$ports,3001 -n --send-ip -p $ports,3001 ".join(' ',@ip6s). " 2> /dev/null|") or die("Can't start nmap: $!"); - } elsif (not $ip6 and scalar(@ips)) { - open($fping,"nmap -PE -n --send-ip -p $ports,3001 ".join(' ',@ips). " 2> /dev/null|") or die("Can't start nmap: $!"); - } else { next; } - while (<$fping>) { - if (/Interesting ports on ([^ ]*)[: ]/ or /Nmap scan report for ([^ ]*)/) { - my $tmpnode=$1; - if ($currnode) { #if still thinking about last node, flush him out - my $status = join ',',sort keys %states ; - my $appsd=""; - foreach my $portnum(keys %portservices) { - my $app_t=$portservices{$portnum}; - if ($states{$app_t}) {$appsd .= $app_t . "=up,";} - else {$appsd .= $app_t . "=down,";} - } - $appsd =~ s/,$//; - my $target=$currnode; - if ($hostsents{$target} and $hostsents{$target}->[0]->{ip}) { $target = $hostsents{$target}->[0]->{ip}; } - - if ($status or ($installquerypossible and $status = installer_query($target))) { #pingable, but no *clue* as to what the state may be - $ret->{$currnode}->{'status'}="ping"; - $ret->{$currnode}->{'appstatus'}=$status; - $ret->{$currnode}->{'appsd'}=$appsd; - $currnode=""; - %states=(); - } else { - push @nodesetnodes,$currnode; #Aggregate call to nodeset - } - } - $currnode=$tmpnode; - $currnode =~ s/:$//; - $currnode =~ s/\n$//; - - - my $nip; - if ($nip = xCAT::NetworkUtils->getipaddr($currnode)) { #reverse lookup may not resemble the nodename, key by ip - if ($nodebyip{$nip}) { - $currnode = $nodebyip{$nip}; - } - } - $installquerypossible=0; #reset possibility indicator - %rsp=(); - unless ($deadnodes{$1}) { - my $shortname; - foreach (keys %deadnodes) { - if (/\./) { - $shortname = $_; - $shortname =~ s/\..*//; - } - if ($currnode =~ /^$_\./ or ($shortname and $shortname eq $currnode)) { - $currnode = $_; - last; - } - } - } - delete $deadnodes{$currnode}; - } elsif ($currnode) { - #if (/^MAC/) { #oops not all nmap records end with MAC - if (/^PORT/) { next; } - ($port,$state) = split; - if ($port and $port =~ /^(\d*)\// and $state eq 'open') { - if ($1 eq "3001" and defined($chainhash{$currnode}->[0]->{currstate}) and $chainhash{$currnode}->[0]->{currstate} =~ /^install/) { - $installquerypossible=1; #It is possible to actually query node - } elsif ($1 ne "3001") { - $states{$portservices{$1}}=1; - } - } - } + if ($ip6 and scalar(@ip6s)) { + open($fping,"nmap -6 -PS$ports,3001 -n --send-ip -p $ports,3001 $more_options ".join(' ',@ip6s). " 2> /dev/null|") or die("Can't start nmap: $!"); + } elsif (not $ip6 and scalar(@ips)) { + open($fping,"nmap -PE -n --send-ip -p $ports,3001 $more_options ".join(' ',@ips). " 2> /dev/null|") or die("Can't start nmap: $!"); + } else { next; } + while (<$fping>) { + if (/Interesting ports on ([^ ]*)[: ]/ or /Nmap scan report for ([^ ]*)/) { + my $tmpnode=$1; + if ($currnode) { #if still thinking about last node, flush him out + my $status = join ',',sort keys %states ; + my $appsd=""; + foreach my $portnum(keys %portservices) { + my $app_t=$portservices{$portnum}; + if ($states{$app_t}) {$appsd .= $app_t . "=up,";} + else {$appsd .= $app_t . "=down,";} + } + $appsd =~ s/,$//; + my $target=$currnode; + if ($hostsents{$target} and $hostsents{$target}->[0]->{ip}) { $target = $hostsents{$target}->[0]->{ip}; } + + if ($status or ($installquerypossible and $status = installer_query($target))) { #pingable, but no *clue* as to what the state may be + $ret->{$currnode}->{'status'}="ping"; + $ret->{$currnode}->{'appstatus'}=$status; + $ret->{$currnode}->{'appsd'}=$appsd; + $currnode=""; + %states=(); + } else { + push @nodesetnodes,$currnode; #Aggregate call to nodeset + } + } + $currnode=$tmpnode; + $currnode =~ s/:$//; + $currnode =~ s/\n$//; + + + my $nip; + if ($nip = xCAT::NetworkUtils->getipaddr($currnode)) { #reverse lookup may not resemble the nodename, key by ip + if ($nodebyip{$nip}) { + $currnode = $nodebyip{$nip}; + } + } + $installquerypossible=0; #reset possibility indicator + %rsp=(); + unless ($deadnodes{$currnode}) { + my $shortname; + foreach (keys %deadnodes) { + if (/\./) { + $shortname = $_; + $shortname =~ s/\..*//; + } + if ($currnode =~ /^$_\./ or ($shortname and $shortname eq $currnode)) { + $currnode = $_; + last; + } + } + } + delete $deadnodes{$currnode}; + } elsif ($currnode) { + #if (/^MAC/) { #oops not all nmap records end with MAC + if (/^PORT/) { next; } + ($port,$state) = split; + if ($port and $port =~ /^(\d*)\// and $state eq 'open') { + if ($1 eq "3001" and defined($chainhash{$currnode}->[0]->{currstate}) and $chainhash{$currnode}->[0]->{currstate} =~ /^install/) { + $installquerypossible=1; #It is possible to actually query node + } elsif ($1 ne "3001") { + $states{$portservices{$1}}=1; + } + } + } + } } - } - + if ($currnode) { my $status = join ',',sort keys %states ; my $appsd=""; From 50a441209bda146d05f906c024bd32ed72601c2a Mon Sep 17 00:00:00 2001 From: daniceexi Date: Thu, 23 Oct 2014 08:17:16 -0400 Subject: [PATCH 27/93] Code drop for supporting KVM/VMware based virtualization in rest api interface --- xCAT-server/xCAT-wsapi/genrestapidoc.pm | 19 ++- xCAT-server/xCAT-wsapi/xcatws.cgi | 149 ++++++++++++++++++++++-- 2 files changed, 151 insertions(+), 17 deletions(-) diff --git a/xCAT-server/xCAT-wsapi/genrestapidoc.pm b/xCAT-server/xCAT-wsapi/genrestapidoc.pm index 54e845362..9dec9ba81 100755 --- a/xCAT-server/xCAT-wsapi/genrestapidoc.pm +++ b/xCAT-server/xCAT-wsapi/genrestapidoc.pm @@ -17,6 +17,7 @@ my @apigroups = ( 'power', 'energy', 'energyattr', 'serviceprocessor', 'nextboot', 'bootstate', 'vitals', 'vitalsattr', 'inventory', 'inventoryattr', 'eventlog', 'beacon', 'updating','filesyncing','software_maintenance','postscript', 'nodeshell', 'nodecopy', + 'vm','vmclone','vmmigrate', ] }, { @@ -209,18 +210,24 @@ sub outwiki { my @example_array = (); if (defined($def->{example})) { push @example_array, $def->{example}; - } else { - foreach (1..10) { - if (defined($def->{'example'.$_})) { - push @example_array, $def->{'example'.$_}; - } + } + foreach (1..10) { + if (defined($def->{'example'.$_})) { + push @example_array, $def->{'example'.$_}; } } if (@example_array) { + my $exampleno = ""; + if ($#example_array > 0) { + $exampleno = 1; + } foreach my $line (@example_array) { my @parts = split ('\|', $line); - print "**Example:**\n"; + print "**Example$exampleno:**\n"; + if ($#example_array > 0) { + $exampleno++; + } if ($parts[1]) { print "$parts[1]\n"; diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 879bf81b6..c3318bf7e 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -403,23 +403,68 @@ my %URIdef = ( outhdler => \&noout, }, }, - virtualization => { - desc => "[URI:/nodes/{noderange}/virtualization] - The virtualization resource for the node {noderange}", - matcher => '^/nodes/[^/]*/virtualization$', - GET => { + vm => { + desc => "[URI:/nodes/{noderange}/vm] - The virtualization node {noderange}.", + desc1 => "The node should be a virtual machine of type kvm, esxi ...", + matcher => '^/nodes/[^/]*/vm$', + GET_backup => { desc => "Get the vm status for the node {noderange}.", cmd => "lsvm", - fhandler => \&common, + fhandler => \&actionhdl, + outhdler => \&actionout, }, PUT => { - desc => "Change the vm status for the node {noderange}. DataBody: {new:1|clone:1|migrate:1 ...}. new=1 means to run mkvm; clone=1 means to run rclone; migrate=1 means to run rmigrate.", - cmd => "", - fhandler => \&common, + desc => "Change the configuration for the virtual machine {noderange}.", + usage => "|$usagemsg{objchparam} DataBody: \n Set memory size - {\"memorysize\":\"sizeofmemory(MB)\"}\n Add new disk - {\"adddisk\":\"sizeofdisk1(GB),sizeofdisk2(GB)\"}\n Purge disk - {\"purgedisk\":\"scsi_id1,scsi_id2\"}|$usagemsg{non_getreturn}|", + example => "|Set memory to 3000MB.|PUT|/nodes/node1/vm {\"memorysize\":\"3000\"}||", + example1 => "|Add a new 20G disk.|PUT|/nodes/node1/vm {\"adddisk\":\"20G\"}||", + example2 => "|Purge the disk \'hdb\'.|PUT|/nodes/node1/vm {\"purgedisk\":\"hdb\"}||", + cmd => "chvm", + fhandler => \&actionhdl, + outhdler => \&noout, + }, + POST => { + desc => "Create the vm node {noderange}.", + usage => "|$usagemsg{objchparam} DataBody: \n Set CPU count - {\"cpucount\":\"numberofcpu\"}\n Set memory size - {\"memorysize\":\"sizeofmemory(MB)\"}\n Set disk size - {\"disksize\":\"sizeofdisk\"}\n Do it by force - {\"force\":\"yes\"}|$usagemsg{non_getreturn}|", + example => "|Create the vm node1 with a 30G disk, 2048M memory and 2 cpus.|POST|/nodes/node1/vm {\"disksize\":\"30G\",\"memorysize\":\"2048\",\"cpucount\":\"2\"}||", + cmd => "mkvm", + fhandler => \&actionhdl, + outhdler => \&noout, }, DELETE => { desc => "Remove the vm node {noderange}.", + usage => "|$usagemsg{objchparam} DataBody: \n Purge disk - {\"purge\":\"yes\"}\n Do it by force - {\"force\":\"yes\"}|$usagemsg{non_getreturn}|", + example => "|Remove the vm node1 by force and purge the disk.|DELETE|/nodes/node1/vm {\"force\":\"yes\",\"purge\":\"yes\"}||", cmd => "rmvm", - fhandler => \&common, + fhandler => \&actionhdl, + outhdler => \&noout, + }, + }, + vmclone => { + desc => "[URI:/nodes/{noderange}/vmclone] - The clone resource for the virtual node {noderange}.", + desc1 => "The node should be a virtual machine of kvm, esxi ...", + matcher => '^/nodes/[^/]*/vmclone$', + POST => { + desc => "Create a clone master from node {noderange}. Or clone the node {noderange} from a clone master.", + usage => "|$usagemsg{objchparam} DataBody: \n Clone a master named \"mastername\" - {\"tomaster\":\"mastername\"}\n Clone a node from master \"mastername\" - {\"frommaster\":\"mastername\"}\n Use Detach mode - {\"detach\":\"yes\"}\n Do it by force - {\"force\":\"yes\"}|The messages of creating Clone target.|", + example1 => "|Create a clone master named \"vmmaster\" from the node1.|POST|/nodes/node1/vmclone {\"tomaster\":\"vmmaster\",\"detach\":\"yes\"}|{\n \"node1\":{\n \"vmclone\":\"Cloning of node1.hda.qcow2 complete (clone uses 9633.19921875 for a disk size of 30720MB)\"\n }\n}|", + example2 => "|Clone the node1 from the clone master named \"vmmaster\".|POST|/nodes/node1/vmclone {\"frommaster\":\"vmmaster\"}||", + cmd => "clonevm", + fhandler => \&actionhdl, + outhdler => \&actionout, + }, + }, + vmmigrate => { + desc => "[URI:/nodes/{noderange}/vmmigrate] - The virtualization resource for migration.", + desc1 => "The node should be a virtual machine of kvm, esxi ...", + matcher => '^/nodes/[^/]*/vmmigrate$', + POST => { + desc => "Migrate a node to targe node.", + usage => "|$usagemsg{objchparam} DataBody: {\"target\":\"targethost\"}.", + example => "|Migrate node1 to target host host2.|POST|/nodes/node1/vmmigrate {\"target\":\"host2\"}||", + cmd => "rmigrate", + fhandler => \&actionhdl, + outhdler => \&actionout, }, }, updating => { @@ -1812,7 +1857,82 @@ sub actionhdl { if (isGET()) { push @args, '-z'; } - } + } elsif ($params->{'resourcename'} eq "vm") { + # handle the virtual machine + if (isGET()) { + # do nothing for kvm and esxi + }elsif (isPut()) { # change the configuration of vm + if (defined ($paramhash->{'adddisk'})) { #add new disk + push @args, ('-a', $paramhash->{'adddisk'}); + } + #if (defined ($paramhash->{'rmdisk'})) { #remove disk + # push @args, ('-d', $paramhash->{'rmdisk'}); + #} + if (defined ($paramhash->{'purgedisk'})) { #purge disk + push @args, ('-p', $paramhash->{'purgedisk'}); + } + if (defined ($paramhash->{'resizedisk'})) { #change the disk size + $paramhash->{'resizedisk'} =~ s/\:/=/; # replace : to be = in the param + push @args, ('--resize', $paramhash->{'resizedisk'}); + } + if (defined ($paramhash->{'memorysize'})) { #change the memory size + push @args, ('--mem', $paramhash->{'memorysize'}); + } + if (defined ($paramhash->{'cpucount'})) { #change the cpu size + push @args, ('--cpus', $paramhash->{'cpucount'}); + } + } elsif (isPost()) { # create virtual machine + if (defined ($paramhash->{'master'})) { # specify the master node for clone + push @args, ('-m', $paramhash->{'master'}); + } + if (defined ($paramhash->{'disksize'})) { # specify disk size + push @args, ('-s', $paramhash->{'disksize'}); + } + if (defined ($paramhash->{'memorysize'})) { #specify the memory size + push @args, ('--mem', $paramhash->{'memorysize'}); + } + if (defined ($paramhash->{'cpucount'})) { #specify the cpu size + push @args, ('--cpus', $paramhash->{'cpucount'}); + } + if (defined ($paramhash->{'force'}) && $paramhash->{'force'} eq "yes") { # force the recreate + push @args, "-f"; + } + } elsif (isDelete()) { + if (defined ($paramhash->{'force'}) && $paramhash->{'force'} eq "yes") { # force the recreate + push @args, "-f"; + } + if (defined ($paramhash->{'purge'}) && $paramhash->{'purge'} eq "yes") { # purge disk when remove the vm + push @args, "-p"; + } + } + } elsif ($params->{'resourcename'} eq "vmclone") { + # handle the clone of virtual machine + if (isPost()) { + if (defined ($paramhash->{'tomaster'})) { + push @args, ("-t", $paramhash->{'tomaster'}); + } elsif (defined ($paramhash->{'frommaster'})) { + push @args, ("-b", $paramhash->{'frommaster'}); + } else { + error ("Lack of operation data.",$STATUS_BAD_REQUEST,3); + } + + if (defined ($paramhash->{'detach'}) && $paramhash->{'detach'} eq "yes") { + push @args, "-d"; + } + if (defined ($paramhash->{'force'}) && $paramhash->{'force'} eq "yes") { # force the recreate + push @args, "-f"; + } + } + } elsif (($params->{'resourcename'} eq "vmmigrate")) { + # handle the migration of virtual machine + if (isPost()) { + if (defined ($paramhash->{'target'})) { + push @args, $paramhash->{'target'}; + } else { + error ("Lack of operation data.",$STATUS_BAD_REQUEST,3); + } + } + } push @{$request->{arg}}, @args; my $req = genRequest(); @@ -2638,11 +2758,18 @@ sub fetchParameters { } } } + } elsif (isPost()) { + $pdata = $q->param('POSTDATA'); + } elsif (isDelete()) { + if ($ENV{'CONTENT_TYPE'} =~ /json/) { + $q->read_from_client(\$pdata, $ENV{'CONTENT_LENGTH'}); + } } - elsif (isPost()) { $pdata = $q->param('POSTDATA'); } + if ($dbgdata) { $pdata = $dbgdata; } + my $genparms = {}; my $phash; if ($pdata) { From ae11f1f4fe548b152154806d9c7af7511bd1ff54 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Thu, 23 Oct 2014 05:19:46 -0400 Subject: [PATCH 28/93] fix defect 4309 lskitdeployparam -k returns kit plugin bug --- xCAT-server/lib/xcat/plugins/kit.pm | 39 ++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 94c59d717..e4a94a721 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -4356,20 +4356,35 @@ sub lskitdeployparam { foreach my $kit (@$kits) { my $deployparam_file = $kit->{kitdir}."/other_files/".$kit->{kitdeployparams}; + my $tmpkitdeployparames = $kit->{kitdeployparams}; + if (defined($deployparam_file)) { - open(my $fh, "<", $deployparam_file) || die sprintf("Failed to open file %s because: %s", $deployparam_file, $!); + + # Check if there is kitdeployparam file or not + if (defined($tmpkitdeployparames)) + { + open(my $fh, "<", $deployparam_file) || die sprintf("Failed to open file %s because: %s", $deployparam_file, $!); - while (<$fh>) { - chomp $_; - if ($_ =~ /^#ENV:.+=.+#$/) { - my $tmp = $_; - $tmp =~ s/^#ENV://; - $tmp =~ s/#$//; - (my $name, my $value) = split(/=/, $tmp); - $deployparam_hash->{$name} = $value; - } - } - close($fh); + while (<$fh>) { + chomp $_; + if ($_ =~ /^#ENV:.+=.+#$/) { + my $tmp = $_; + $tmp =~ s/^#ENV://; + $tmp =~ s/#$//; + (my $name, my $value) = split(/=/, $tmp); + $deployparam_hash->{$name} = $value; + } + } + close($fh); + } + else { + my $rsp = {}; + push @{ $rsp->{data}}, "There is no kitdeployparams file in $deployparam_file.\n"; + xCAT::MsgUtils->message("W", $rsp, $::CALLBACK); + + return 1; + } + } } From be7dea96d5a5664a230060360e096dd191afd0ac Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 23 Oct 2014 09:20:13 -0400 Subject: [PATCH 29/93] add setup of MN/SN SLES12/rsyslog 8 support defect 4311 --- xCAT/postscripts/syslog | 74 +++++++++++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 18 deletions(-) diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index e90ac7bdb..974322ace 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -114,34 +114,73 @@ config_Rsyslog_C3() fi } -# THis sets up rsyslog 8.x, quite different from the previous rsyslog versions. +# This sets up rsyslog 8.x, different from the previous rsyslog versions. +# Instead of updating /etc/rsyslog.conf for forwarding to a remote host, +# You update /etc/rsyslog.d/remote.conf. The /etc/sysconfig/rsyslog file does not exist. +# This is only for Linux, since AIX does not use rsyslog. It ships its own syslog in an lpp, +# at least at the time of this code being written config_rsyslog_V8() { - isReceiving=0 + + goLocal=0; + conf_file="/etc/rsyslog.conf" remoteconf="/etc/rsyslog.d/remote.conf" + # If this is a Management Node or Service Node, then it will be receiving syslog entries from the + # compute nodes. Management Node is receiving from Service Nodes and possibly compute nodes. + # They will all be put in /var/log/messages + # For the service node, if site table svloglocal is set then we will keep the logs on the servicenode + # and not forward to the Management Node. - if [ -f /etc/xCATMN ] || [ $isSN -eq 1 ] - then - isReceiving=1 + #now handling where the logs go, if goLocal=1 then log local, if not forward to MN + if [ -f /etc/xCATMN ]; then + goLocal=1 + else + # check to see if service node should forward of keep logs + if [ $isSN -eq 1 ]; then + if [ -n "$SVLOGLOCAL" ] && [ $SVLOGLOCAL -eq 1 ]; then + goLocal=1 + fi + fi fi - if [ ! -f $remoteconf.XCATORIG ]; then - cp -f $remoteconf $remoteconf.XCATORIG - fi - # check if already an entry, we need to replace it - grep "xCAT settings" $remoteconf 2>&1 1> /dev/null - if [ $? -eq 0 ]; then + if [ $goLocal -eq 1 ]; then + #logging is local, do not forward + #making sure all the messages goes to /var/log/messages + touch /var/log/messages + # backup rsyslog.conf + if [ ! -f $conf_file.XCATORIG ]; then + cp -f $conf_file $conf_file.XCATORIG + fi + + grep "xCAT settings" $conf_file 2>&1 1> /dev/null + if [ $? -eq 0 ]; then + sed "/# xCAT settings/,$ d" $conf_file >/tmp/sed.tmp + cat /tmp/sed.tmp >$conf_file + fi + + echo "# xCAT settings" >> $conf_file + echo "*.debug /var/log/messages" >> $conf_file + else + # not logging local, forward logging + # backup the existing remote.conf file from the install + if [ ! -f $remoteconf.XCATORIG ]; then + cp -f $remoteconf $remoteconf.XCATORIG + fi + # check if already an entry by xCAT. If so, we need to replace it + grep "xCAT settings" $remoteconf 2>&1 1> /dev/null + if [ $? -eq 0 ]; then sed "/# xCAT settings/,$ d" $remoteconf >/tmp/sed.tmp cat /tmp/sed.tmp >$remoteconf - fi + fi - - echo "# xCAT settings" >> $remoteconf - echo "*.* @$master" >> $remoteconf - - restartservice syslog + # add xCAT entries + echo "# xCAT settings" >> $remoteconf + echo "*.* @$master" >> $remoteconf + fi + # restart syslog ( could be service or systemctl call depending on the OS) + restartservice syslog } @@ -169,7 +208,6 @@ if ( pmatch $SYSLOGPROD "*rsyslogd*" ) && ( pmatch $SYSLOGVER "8*" ); then exit 0 fi -echo " not configuring $SYSLOGVER" if [ "$(uname -s)" = "Linux" ]; then if ( pmatch $OSVER "fedora*" ) || ( pmatch $OSVER "rhels5*" ) || ( pmatch $OSVER "rhel6*" ) || ( pmatch $OSVER "rhels6*" ) || [ -f /etc/fedora-release ] || [ -f /etc/redhat-release ] || ( pmatch $OSVER "ubuntu*" ) || ( is_lsb_ubuntu ) || ( pmatch $OSVER "debian*" ); then if [ -e /etc/rsyslog.conf ]; then From ad0118ddf9ff64cf71e4b7357514a1ba6f4566e7 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:06:34 -0700 Subject: [PATCH 30/93] fix defect 4314 update for ubuntu specific case support --- xCAT-test/xcattest | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 7506bf2b8..30086f685 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -539,7 +539,10 @@ sub loadcase $cases[$i]->{os}="Linux"; }elsif($string1 =~ /^sles\s*/ && -f "/etc/SuSE-release"){ $cases[$i]->{os}="Linux"; - }else{ + }elsif($string1 =~ /^ubuntu\s*/ && -f "/etc/lsb-release"){ + $cases[$i]->{os}="Linux"; + } + else{ $cases[$i]->{os}=$string1; } From 91c67cea578a04619f664ae86e24565603acefb9 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:10:39 -0700 Subject: [PATCH 31/93] add KITDATA for kit case test --- xCAT-test/autotest/linux.conf.template | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/linux.conf.template b/xCAT-test/autotest/linux.conf.template index 6741543a5..dccc7ad36 100644 --- a/xCAT-test/autotest/linux.conf.template +++ b/xCAT-test/autotest/linux.conf.template @@ -66,6 +66,7 @@ ISO=/iso/RHEL5.4-Server-20090819.0-ppc-DVD.iso NETDRIVER=ibmveth #network infterface card driver used by diskless installation NETBOOTDIR=/opt/xcat/share/xcat/netboot/rh #path of netboot directory, used by diskless installation MaxLparID=32 +KITDATA=kitdata [Custom] #commands run before test From f35a5b6071f9c95269af02c65f0cd462348a30de Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:13:25 -0700 Subject: [PATCH 32/93] add lskitcomp cases --- xCAT-test/autotest/testcase/lskitcomp/case0 | 109 ++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 xCAT-test/autotest/testcase/lskitcomp/case0 diff --git a/xCAT-test/autotest/testcase/lskitcomp/case0 b/xCAT-test/autotest/testcase/lskitcomp/case0 new file mode 100644 index 000000000..ae02e7753 --- /dev/null +++ b/xCAT-test/autotest/testcase/lskitcomp/case0 @@ -0,0 +1,109 @@ +start:lskitcomp_v +os:Linux +cmd:lskitcomp -v +check:rc==0 +check:output=~lskitcomp +check:output=~kitframework +check:output=~compatible_frameworks +cmd:lskitcomp --version +check:rc==0 +check:output=~lskitcomp +check:output=~kitframework +check:output=~compatible_frameworks +end + +start:lskitcomp_h +os:Linux +cmd:lskitcomp -h +check:rc==0 +check:output =~ Usage +cmd:lskitcomp --help +check:rc==0 +check:output=~ Usage +end + +start:lskitcomp_C +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C basename $compname +check:rc==0 +check:output=~basename +cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C kitcompname $compname +check:output=~kitcompname +check:rc==0 +cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C kitreponame $compname +check:rc==0 +check:output=~kitreponame +cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C serverroles $compname +check:rc==0 +check:output=~serverroles +cmd:rmkit mykits-1.0-1 +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits +end + +start:lskitcomp_C +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C basename $compname +check:rc==0 +check:output=~basename +cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C kitcompname $compname +check:output=~kitcompname +check:rc==0 +cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C kitreponame $compname +check:rc==0 +check:output=~kitreponame +cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -C serverroles $compname +check:rc==0 +check:output=~serverroles +cmd:rmkit mykits-1.0-1 +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits +end + + +start:lskitcomp_S +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp -S compute $compname +check:rc==0 +check:output=~compute +cmd:compname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitcomp --serverrole compute $compname +check:rc==0 +check:output=~compute +cmd:rmkit mykits-1.0-1 +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskitcomp/mykits +end + From 85075225cae44d85951c732e75ba453fce2e49e9 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:14:53 -0700 Subject: [PATCH 33/93] add rmkitcomp cases --- xCAT-test/autotest/testcase/rmkitcomp/case0 | 98 +++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 xCAT-test/autotest/testcase/rmkitcomp/case0 diff --git a/xCAT-test/autotest/testcase/rmkitcomp/case0 b/xCAT-test/autotest/testcase/rmkitcomp/case0 new file mode 100644 index 000000000..857a823b5 --- /dev/null +++ b/xCAT-test/autotest/testcase/rmkitcomp/case0 @@ -0,0 +1,98 @@ +start:rmkitcomp_v +os:Linux +cmd:rmkitcomp -v +check:rc==0 +check:output=~rmkitcomp +check:output=~kitframework +check:output=~compatible_frameworks +cmd:rmkitcomp --version +check:rc==0 +check:output=~rmkitcomp +check:output=~kitframework +check:output=~compatible_frameworks +end + +start:rmkitcomp_h +os:Linux +cmd:rmkitcomp -h +check:rc==0 +check:output =~ Usage +cmd:rmkitcomp --help +check:rc==0 +check:output=~ Usage +end + +start:rmkitcomp_noscripts +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA +cmd:mkdir -p /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA +cmd:cp -rf /opt/xcat/share/xcat/tools/autotest/$$KITDATA /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA/*.tar.bz2 +check:rc==0 +check:output=~successfully added +cmd:mkdef testimage -u profile=compute provmethod=install osarch=ppc64el +check:rc==0 +cmd:addkitcomp -i testimage -a ubuntukit-compute-2 +check:rc==0 +check:output=~Assigning kit component ubuntukit-compute-2 +cmd:lsdef -t osimage -o testimage +check:rc==0 +check:output=~postbootscripts +cmd:rmkitcomp -i testimage -f ubuntukit-compute-2-1.0-1-ubuntu-14.04-ppc64el --noscripts +check:rc==0 +check:output=~Removing kitcomponent ubuntukit-compute-2-1.0-1-ubuntu-14.04-ppc64el from osimage testimage +cmd:lsdef -t osimage -o testimage +check:rc==0 +check:output=~postbootscripts +cmd:rmkitcomp -i testimage -f ubuntukit-compute-1-1.0-1-ubuntu-14.04-ppc64el +check:rc==0 +cmd:rmkit ubuntukit-1.0-1-ppc64el +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA/ubuntukit-1.0-1-ppc64el.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA +cmd:rmdef -t osimage -o testimage +check:rc==0 +end + +start:rmkitcomp_f +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA +cmd:mkdir -p /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA +cmd:cp -rf /opt/xcat/share/xcat/tools/autotest/$$KITDATA /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA/*.tar.bz2 +check:rc==0 +check:output=~successfully added +cmd:mkdef testimage -u profile=compute provmethod=install osarch=ppc64el +check:rc==0 +cmd:addkitcomp -i testimage -a ubuntukit-compute-2 +check:rc==0 +check:output=~Assigning kit component ubuntukit-compute-2 +cmd:lsdef -t osimage -o testimage |grep -i kitcomponents +check:rc==0 +check:output=~ubuntukit-compute-1 +check:output=~ubuntukit-compute-2 +cmd:rmkitcomp -i testimage ubuntukit-compute-1-1.0-1-ubuntu-14.04-ppc64el +check:rc==1 +check:output=~Error: Failed to remove kitcomponent +cmd:rmkitcomp -i testimage -f ubuntukit-compute-1-1.0-1-ubuntu-14.04-ppc64el +check:rc==0 +check:output=~Removing kitcomponent ubuntukit-compute-1-1.0-1-ubuntu-14.04-ppc64el from osimage testimage +cmd:rmkitcomp -i testimage -f ubuntukit-compute-2-1.0-1-ubuntu-14.04-ppc64el +check:rc==0 +check:output=~Removing kitcomponent ubuntukit-compute-2-1.0-1-ubuntu-14.04-ppc64el from osimage testimage +cmd:rmkit ubuntukit-1.0-1-ppc64el +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA/ubuntukit-1.0-1-ppc64el.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkitcomp/$$KITDATA +cmd:rmdef -t osimage -o testimage +check:rc==0 +end + From 0db64ebb8e5029a1e4af8a1a596577da01dd1bf3 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:15:59 -0700 Subject: [PATCH 34/93] add rmkit case --- xCAT-test/autotest/testcase/rmkit/case0 | 145 ++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 xCAT-test/autotest/testcase/rmkit/case0 diff --git a/xCAT-test/autotest/testcase/rmkit/case0 b/xCAT-test/autotest/testcase/rmkit/case0 new file mode 100644 index 000000000..c62d5dd91 --- /dev/null +++ b/xCAT-test/autotest/testcase/rmkit/case0 @@ -0,0 +1,145 @@ +start:rmkit_v +os:Linux +cmd:rmkit -v +check:rc==0 +check:output=~rmkit +check:output=~kitframework +check:output=~compatible_frameworks +cmd:rmkit --version +check:rc==0 +check:output=~rmkit +check:output=~kitframework +check:output=~compatible_frameworks +end + +start:rmkit_h +os:Linux +cmd:rmkit -h +check:rc==0 +check:output =~ Usage +cmd:rmkit --help +check:rc==0 +check:output=~ Usage +end + +start:rmkit_t_no +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:rmkit -t mykits-1.0-1 +check:rc==0 +check:output=~No kitcomponents are in use +cmd:rmkit --test mykits-1.0-1 +check:rc==0 +check:output=~No kitcomponents are in use +cmd:rmkit mykits-1.0-1 +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits +end + +start:rmkit_t_yes +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:mkdef testimage -u profile=compute provmethod=install osarch=ppc64el +check:rc==0 +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname +check:rc==0 +check:output=~Assigning kit component +cmd:rmkit -t mykits-1.0-1 +check:rc==0 +check:output=~Following kitcomponents are in use +cmd:rmkit --test mykits-1.0-1 +check:rc==0 +check:output=~Following kitcomponents are in use +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmkitcomp -i testimage $kitcompname +check:rc==0 +check:output=~Removing kitcomponent +check:output=~were removed from osimage testimage successfully +cmd:rmkit mykits-1.0-1 +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits +cmd:rmdef -t osimage -o testimage +check:rc==0 +end + +start:rmkit_f +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:mkdef testimage -u profile=compute provmethod=install osarch=ppc64el +check:rc==0 +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname +check:rc==0 +check:output=~Assigning kit component +cmd:rmkit -f mykits-1.0-1 +check:rc==0 +check:output=~Removing kit mykits-1.0-1 +check:output=~Kit mykits-1.0-1 was successfully removed +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits +cmd:rmdef -t osimage -o testimage +check:rc==0 +end + + +start:rmkit_V +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:mkdef testimage -u profile=compute provmethod=install osarch=ppc64el +check:rc==0 +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname +check:rc==0 +check:output=~Assigning kit component +cmd:rmkit -f mykits-1.0-1 -V +check:rc==0 +check:output=~Removing kit mykits-1.0-1 +check:output=~Removing kit components +check:output=~Removing kit plugins +check:output=~Removing kit scripts +check:output=~Removing kitdir from +check:output=~Removing kit from xCAT DB +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits +cmd:rmdef -t osimage -o testimage +check:rc==0 +end From ad2b7370cc73ed00f5ac2f203ae97b5d12be419c Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:17:35 -0700 Subject: [PATCH 35/93] add lskit test cases --- xCAT-test/autotest/testcase/lskit/case0 | 115 ++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 xCAT-test/autotest/testcase/lskit/case0 diff --git a/xCAT-test/autotest/testcase/lskit/case0 b/xCAT-test/autotest/testcase/lskit/case0 new file mode 100644 index 000000000..2a3a2c87d --- /dev/null +++ b/xCAT-test/autotest/testcase/lskit/case0 @@ -0,0 +1,115 @@ +start:lskit_v +os:Linux +cmd:lskit -v +check:rc==0 +check:output=~lskit +check:output=~kitframework +check:output=~compatible_frameworks +cmd:lskit --version +check:rc==0 +check:output=~lskit +check:output=~kitframework +check:output=~compatible_frameworks +end + +start:lskit_h +os:Linux +cmd:lskit -h +check:rc==0 +check:output =~ Usage +cmd:lskit --help +check:rc==0 +check:output=~ Usage +end + +start:lskit_F +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildtar +check:rc==0 +cmd:lskit -F /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Extracting the kit.conf file from /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +check:output=~kitframework +check:output=~compatible_kitframeworks +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +end + +start:lskit_K +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:lskit -K basename mykits-1.0-1 +check:rc==0 +check:output=~basename +cmd:rmkit mykits-1.0-1 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully removed +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +end + +start:lskit_R +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:lskit -R kitrepodir mykits-1.0-1 +check:rc==0 +check:output=~kitrepodir +cmd:lskit -R kitreponame mykits-1.0-1 +check:rc==0 +check:output=~kitreponame +cmd:rmkit mykits-1.0-1 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully removed +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +end + +start:lskit_C +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:lskit -C kitcompname mykits-1.0-1 +check:rc==0 +check:output=~kitcompname +cmd:rmkit mykits-1.0-1 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully removed +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +end + From 81335534818296abfa871d834fff596440329475 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:18:43 -0700 Subject: [PATCH 36/93] add lskitdeployparam test cases --- .../autotest/testcase/lskitdeployparam/case0 | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 xCAT-test/autotest/testcase/lskitdeployparam/case0 diff --git a/xCAT-test/autotest/testcase/lskitdeployparam/case0 b/xCAT-test/autotest/testcase/lskitdeployparam/case0 new file mode 100644 index 000000000..33ff5547e --- /dev/null +++ b/xCAT-test/autotest/testcase/lskitdeployparam/case0 @@ -0,0 +1,88 @@ +start:lskitdeployparam_v +os:Linux +cmd:lskitdeployparam -v +check:rc==0 +check:output=~lskitdeployparam +check:output=~kitframework +check:output=~compatible_frameworks +cmd:lskitdeployparam --version +check:rc==0 +check:output=~lskitdeployparam +check:output=~kitframework +check:output=~compatible_frameworks +end + +start:lskitdeployparam_h +os:Linux +cmd:lskitdeployparam -h +check:rc==0 +check:output =~ Usage +cmd:lskitdeployparam --help +check:rc==0 +check:output=~ Usage +end + +start:lskitdeployparam_no_param +os:Linux +cmd:lskitdeployparam +check:rc==1 +check:output=~Error +check:output=~ Usage +end + + +start:lskitdeployparam_k_1 +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:lskit -K basename mykits-1.0-1 +check:rc==0 +check:output=~basename +cmd:lskitdeployparam -k mykits-1.0-1 +check:rc==0 +cmd:rmkit mykits-1.0-1 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully removed +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +end + +start:lskitdeployparam_c_1 +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:lskit -K basename mykits-1.0-1 +check:rc==0 +check:output=~basename +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;lskitdeployparam -c $kitcompname +check:rc==0 +cmd:rmkit mykits-1.0-1 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully removed +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/lskit/mykits +end + + + + + + From 37672312ba161f7cc029e0012ba83b231c3fcad3 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:20:06 -0700 Subject: [PATCH 37/93] add chkkitcomp test cases --- xCAT-test/autotest/testcase/chkkitcomp/cases0 | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 xCAT-test/autotest/testcase/chkkitcomp/cases0 diff --git a/xCAT-test/autotest/testcase/chkkitcomp/cases0 b/xCAT-test/autotest/testcase/chkkitcomp/cases0 new file mode 100644 index 000000000..3b31e80e9 --- /dev/null +++ b/xCAT-test/autotest/testcase/chkkitcomp/cases0 @@ -0,0 +1,50 @@ +start:chkkitcomp_v +cmd:chkkitcomp -v +check:rc==0 +check:output~=Version +check:output~=kitframework +check:output~=compatible_frameworks +end + +start:chkkitcomp_h +cmd:addkit -h +check:rc==0 +check:output~=Usage +check:outpur!~error +end + +start:chkkitcomp_V +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:mkdef testimage -u profile=compute provmethod=install osarch=ppc64el +check:rc==0 +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname +check:rc==0 +check:output=~Assigning kit component +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;chkkitcomp -i testimage $kitcompname +check:rc==0 +check:output=~compatible with osimage testimage +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;chkkitcomp -i testimage $kitcompname -V +check:rc==0 +check:output=~compatible with osimage testimage +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmkitcomp -i testimage $kitcompname +check:rc==0 +cmd:rmkit mykits-1.0-1 +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits +cmd:rmdef -t osimage -o testimage +check:rc==0 +end + + From f383d4d0fcff72da6a9ab6d4c1dae06e6ca4c452 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:21:46 -0700 Subject: [PATCH 38/93] add addkitcomp test cases --- xCAT-test/autotest/testcase/addkitcomp/case0 | 163 +++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 xCAT-test/autotest/testcase/addkitcomp/case0 diff --git a/xCAT-test/autotest/testcase/addkitcomp/case0 b/xCAT-test/autotest/testcase/addkitcomp/case0 new file mode 100644 index 000000000..f0ef59d58 --- /dev/null +++ b/xCAT-test/autotest/testcase/addkitcomp/case0 @@ -0,0 +1,163 @@ +start:addkitcomp_v +os:Linux +cmd:addkitcomp -v +check:rc==0 +check:output=~addkitcomp +check:output=~kitframework +check:output=~compatible_frameworks +cmd:addkitcomp --version +check:rc==0 +check:output=~addkitcomp +check:output=~kitframework +check:output=~compatible_frameworks +end + +start:addkitcomp_h +os:Linux +cmd:addkitcomp -h +check:rc==0 +check:output =~ Usage +cmd:addkitcomp --help +check:rc==0 +check:output=~ Usage +end + +start:addkitcomp_i +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits directory +cmd:rmkit mykits-1.0-1 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:mkdef testimage -u profile=compute provmethod=install osarch=ppc64el +check:rc==0 +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname +check:rc==0 +check:output=~Assigning kit component +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmkitcomp -i testimage $kitcompname +check:rc==0 +check:output=~Removing kitcomponent +check:output=~were removed from osimage testimage successfully +cmd:rmkit mykits-1.0-1 +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits +cmd:rmdef -t osimage -o testimage +check:rc==0 +end + +start:addkitcomp_f +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp;buildkit create mykits +check:rc==0 +check:output=~Kit template for mykits created in /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits directory +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 +check:rc==0 +check:output=~Kit mykits-1.0-1 was successfully added +cmd:mkdef testimage -u profile=compute provmethod=install osarch=ppc64el +check:rc==0 +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -f -i testimage $kitcompname +check:rc==0 +check:output=~Assigning kit component +cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmkitcomp -i testimage $kitcompname +check:rc==0 +check:output=~Removing kitcomponent +check:output=~were removed from osimage testimage successfully +cmd:rmkit mykits-1.0-1 +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits +cmd:rmdef -t osimage -o testimage +check:rc==0 +end + +start:addkitcomp_a +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA +cmd:mkdir -p /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA +cmd:cp -rf /opt/xcat/share/xcat/tools/autotest/$$KITDATA /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA/*.tar.bz2 +check:rc==0 +check:output=~successfully added +cmd:mkdef testimage -u profile=compute provmethod=install osarch=ppc64el +check:rc==0 +cmd:addkitcomp -i testimage -a ubuntukit-compute-2 +check:rc==0 +check:output=~Assigning kit component ubuntukit-compute-2 +cmd:lsdef -t osimage -o testimage |grep -i kitcomponents +check:rc==0 +check:output=~ubuntukit-compute-1 +check:output=~ubuntukit-compute-2 +cmd:lsdef -t osimage -o testimage +check:rc==0 +check:output=~KIT_DEPLOY_PARAMS +check:output=~KIT_COMPONENTS +cmd:rmkitcomp -i testimage ubuntukit-compute-1-1.0-1-ubuntu-14.04-ppc64el +check:rc==1 +check:output=~Error: Failed to remove kitcomponent +cmd:rmkitcomp -i testimage -f ubuntukit-compute-1-1.0-1-ubuntu-14.04-ppc64el +check:rc==0 +check:output=~Removing kitcomponent ubuntukit-compute-1-1.0-1-ubuntu-14.04-ppc64el from osimage testimage +cmd:rmkitcomp -i testimage -f ubuntukit-compute-2-1.0-1-ubuntu-14.04-ppc64el +check:rc==0 +check:output=~Removing kitcomponent ubuntukit-compute-2-1.0-1-ubuntu-14.04-ppc64el from osimage testimage +cmd:rmkit ubuntukit-1.0-1-ppc64el +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA/ubuntukit-1.0-1-ppc64el.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA +cmd:rmdef -t osimage -o testimage +check:rc==0 +end + +start:addkitcomp_noscripts +os:Linux +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA +cmd:mkdir -p /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA +cmd:cp -rf /opt/xcat/share/xcat/tools/autotest/$$KITDATA /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA;buildkit buildtar +check:rc==0 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA/*.tar.bz2 +check:rc==0 +check:output=~successfully added +cmd:mkdef testimage -u profile=compute provmethod=install osarch=ppc64el +check:rc==0 +cmd:addkitcomp -i testimage -a ubuntukit-compute-2 --noscripts +check:rc==0 +check:output=~Assigning kit component ubuntukit-compute-2 +cmd:lsdef -t osimage -o testimage +check:rc==0 +check:output!=~postbootscripts +cmd:rmkitcomp -i testimage -f ubuntukit-compute-1-1.0-1-ubuntu-14.04-ppc64el +check:rc==0 +check:output=~Removing kitcomponent ubuntukit-compute-1-1.0-1-ubuntu-14.04-ppc64el from osimage testimage +cmd:rmkitcomp -i testimage -f ubuntukit-compute-2-1.0-1-ubuntu-14.04-ppc64el +check:rc==0 +check:output=~Removing kitcomponent ubuntukit-compute-2-1.0-1-ubuntu-14.04-ppc64el from osimage testimage +cmd:rmkit ubuntukit-1.0-1-ppc64el +check:rc==0 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA/ubuntukit-1.0-1-ppc64el.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/$$KITDATA +cmd:rmdef -t osimage -o testimage +check:rc==0 +end + + + From 851094e6a197cc123bb9c8cf431c5919b693b2b0 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:23:32 -0700 Subject: [PATCH 39/93] add buildkit test cases --- xCAT-test/autotest/testcase/buildkit/cases0 | 251 ++++++++++++++++++-- 1 file changed, 232 insertions(+), 19 deletions(-) diff --git a/xCAT-test/autotest/testcase/buildkit/cases0 b/xCAT-test/autotest/testcase/buildkit/cases0 index cb2bd02e3..1dff639b4 100644 --- a/xCAT-test/autotest/testcase/buildkit/cases0 +++ b/xCAT-test/autotest/testcase/buildkit/cases0 @@ -63,7 +63,7 @@ cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/mykits end start:buildkit_buildrepo_all -os:Linux +os:rhels cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit check:rc==0 @@ -75,7 +75,41 @@ check:output=~prodkit-1.0-1 cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir/prodkit-1.0-1-* check:output=~repodata check:output=~pkg1-1-1.noarch.rpm -check:output=~prodkit_compute-1.0-1.noarch.rpm +check:output=~prodkit-compute_1.0-1.noarch.rpm +cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +end + +start:buildkit_buildrepo_all +os:sles +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all +check:rc==0 +check:output!~error +cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir +check:output=~prodkit-1.0-1 +cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir/prodkit-1.0-1-* +check:output=~repodata +check:output=~pkg1-1-1.noarch.rpm +check:output=~prodkit-compute_1.0-1.noarch.rpm +cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +end + +start:buildkit_buildrepo_all +os:ubuntu +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all +check:rc==0 +check:output!~error +cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir +check:output=~prodkit-1.0-1 +cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir/prodkit-1.0-1-* +check:output=~Packages +check:output=~pkg1_1-2_all.deb +check:output=~prodkit-compute_1.0-1_all.deb cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit end @@ -92,7 +126,7 @@ check:output=~prodkit-1.0-1 cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir/prodkit-1.0-1-* check:output=~repodata check:output=~pkg1-1-1.noarch.rpm -check:output=~prodkit_compute-1.0-1.noarch.rpm +check:output=~prodkit-compute-1.0-1.noarch.rpm cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit end @@ -109,7 +143,24 @@ check:output=~prodkit-1.0-1 cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir/prodkit-1.0-1-* check:output=~repodata check:output=~pkg1-1-1.noarch.rpm -check:output=~prodkit_compute-1.0-1.noarch.rpm +check:output=~prodkit-compute-1.0-1.noarch.rpm +cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +end + +start:buildkit_buildrepo_ubuntu +os:ubuntu +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;reponame=`cat buildkit.conf|grep kitrepoid|sed 's/ //g' |grep ^kitrepoid=|head -1|awk -F= '{print $2}'`;buildkit buildrepo $reponame +check:rc==0 +check:output!~error +cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir +check:output=~prodkit-1.0-1 +cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir/prodkit-1.0-1-* +check:output=~Packages +check:output=~pkg1_1-2_all.deb +check:output=~prodkit-compute_1.0-1_all.deb cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit end @@ -138,7 +189,7 @@ cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit bu check:rc==0 cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;reponame=`cat buildkit.conf|grep kitrepoid|sed 's/ //g' |grep ^kitrepoid=|head -1|awk -F= '{print $2}'`;buildkit cleanrepo $reponame check:rc==0 -check:output=~Kit repository rhels[0-9].[0-9] has been removed +check:output=~been removed check:output!~error cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir|grep rhels check:output!~rhels @@ -161,6 +212,21 @@ check:output!~sles cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit end +start:buildkit_cleanrepo_ubuntu +os:ubuntu +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;reponame=`cat buildkit.conf|grep kitrepoid|sed 's/ //g' |grep ^kitrepoid=|head -1|awk -F= '{print $2}'`;buildkit cleanrepo $reponame +check:rc==0 +check:output=~been removed +check:output!~error +cmd:ls /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build/kit_repodir|grep ubuntu +check:output!~ubuntu +cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +end start:buildkit_listrepo os:rhels @@ -191,6 +257,19 @@ check:output!~error cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit end +start:buildkit_listrepo +os:ubuntu +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit listrepo +check:rc==0 +check:output=~ DONE +check:output!~error +cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +end start:buildkit_buildtar os:Linux @@ -212,12 +291,16 @@ end start:buildkit_cleantar -os:Linux +os:rhels cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit check:rc==0 cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildtar +check:rc==0 +check:output=~prodkit-1.0-1.tar.bz2 successfully built +check:output!~error cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit cleantar check:rc==0 check:output=~Kit tar files have been successfully removed from /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit @@ -228,27 +311,50 @@ check:output!~prodkit-1.0-1.tar.bz2 cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit end -start:buildkit_chkconfig -os:Linux +start:buildkit_cleantar +os:sles cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit check:rc==0 -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit chkconfig +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all check:rc==0 -check:output=~No errors were found in Kit Build File /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf -cmd:mv /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/other_files/sample/exclude.lst /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/other_files/sample/exclude.lst.new -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit chkconfig -check:rc!=0 -check:output=~Exclude List file /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/other_files/sample/exclude.lst defined in Kit Componenet "prodkit_compute" does not exist or is not readable -cmd:mv /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/other_files/sample/exclude.lst.new /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/other_files/sample/exclude.lst -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit chkconfig +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildtar check:rc==0 -check:output=~~No errors were found in Kit Build File /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf +check:output=~prodkit-1.0-1.tar.bz2 successfully built +check:output!~error +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit cleantar +check:rc==0 +check:output=~Kit tar files have been successfully removed from /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +check:output=~Removed /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/rpmbuild +check:output!~error +cmd: ls |grep prodkit-1.0-1.tar.bz2 +check:output!~prodkit-1.0-1.tar.bz2 +cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +end + +start:buildkit_cleantar +os:ubuntu +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildtar +check:rc==0 +check:output=~prodkit-1.0-1.tar.bz2 successfully built +check:output!~error +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit cleantar +check:rc==0 +check:output=~Kit tar files have been successfully removed from /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +check:output=~Removed /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/build +check:output!~error +cmd: ls |grep prodkit-1.0-1.tar.bz2 +check:output!~prodkit-1.0-1.tar.bz2 cmd:cd -;rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit end start:buildkit_partialkit -os:Linux +os:rhels cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit check:rc==0 @@ -270,9 +376,54 @@ check:output!~pkg1-1-1.noarch.rpm cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit end +start:buildkit_partialkit +os:sles +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit +check:rc==0 +cmd:cat /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf|sed 's/isexternalpkg=no/isexternalpkg=yes/g' > /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.new +cmd:cat /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.new |sed '/rpm_prebuiltdir/d' > /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.tmp +check:rc==0 +cmd:mv /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.tmp /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildtar +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;tar -tf prodkit-1.0-1.NEED_PRODUCT_PKGS.tar.bz2 +check:rc==0 +check:output=~prodkit-1.0-1/build_input/buildkit.conf +check:output=~prodkit-1.0-1/kit.conf +check:output=~prodkit-1.0-1/repos/ +check:output=~prodkit_compute-1.0-1.noarch.rpm +check:output!~pkg1-1-1.noarch.rpm +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +end + +start:buildkit_partialkit_ubuntu +os:ubuntu +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit +check:rc==0 +cmd:cat /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf|sed 's/isexternalpkg=no/isexternalpkg=yes/g' > /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.new +cmd:cat /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.new |sed '/rpm_prebuiltdir/d' > /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.tmp +check:rc==0 +cmd:mv /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.tmp /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildtar +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;tar -tf prodkit-1.0-1.NEED_PRODUCT_PKGS.tar.bz2 +check:rc==0 +check:output=~prodkit-1.0-1/build_input/buildkit.conf +check:output=~prodkit-1.0-1/kit.conf +check:output=~prodkit-1.0-1/repos/ +check:output=~prodkit-compute_1.0-1_all.deb +check:output!~pkg1_1-2_all.deb +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +end start:buildkit_partialkit_completekit -os:Linux +os:rhels cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit check:rc==0 @@ -302,3 +453,65 @@ check:output=~pkg1-1-1.noarch.rpm cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit end +start:buildkit_partialkit_completekit +os:sles +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit +check:rc==0 +cmd:cat /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf|sed 's/isexternalpkg=no/isexternalpkg=yes/g' > /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.new +cmd:cat /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.new |sed '/rpm_prebuiltdir/d' > /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.tmp +check:rc==0 +cmd:mv /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.tmp /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildtar +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;tar -tf prodkit-1.0-1.NEED_PRODUCT_PKGS.tar.bz2 +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit addpkgs prodkit-1.0-1.NEED_PRODUCT_PKGS.tar.bz2 -p source_packages/sample/pkg1 +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;tar -tf prodkit-1.0-1.tar.bz2 +check:rc==0 +check:output=~prodkit_compute-1.0-1.noarch.rpm +check:output=~pkg1-1-1.noarch.rpm +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;rm -f prodkit-1.0-1.tar.bz2 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit addpkgs prodkit-1.0-1.NEED_PRODUCT_PKGS.tar.bz2 -p source_packages/sample/pkg1 -k 2.0 -r s002a +check:rc==0 +check:output=~/opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/prodkit-2.0-s002a.tar.bz2 successfully built +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;tar -tf prodkit-2.0-s002a.tar.bz2 +check:output=~prodkit_compute-2.0-s002a.noarch.rpm +check:output=~pkg1-1-1.noarch.rpm +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +end + +start:buildkit_partialkit_completekit +os:ubuntu +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit;buildkit create prodkit +check:rc==0 +cmd:cat /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf|sed 's/isexternalpkg=no/isexternalpkg=yes/g' > /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.new +cmd:cat /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.new |sed '/rpm_prebuiltdir/d' > /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.tmp +check:rc==0 +cmd:mv /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf.tmp /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/buildkit.conf +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildrepo all +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit buildtar +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;tar -tf prodkit-1.0-1.NEED_PRODUCT_PKGS.tar.bz2 +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit addpkgs prodkit-1.0-1.NEED_PRODUCT_PKGS.tar.bz2 -p source_packages/sample/pkg1 +check:rc==0 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;tar -tf prodkit-1.0-1.tar.bz2 +check:rc==0 +check:output=~prodkit-compute_1.0-1_all.deb +check:output=~pkg1_1-2_all.deb +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;rm -f prodkit-1.0-1.tar.bz2 +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;buildkit addpkgs prodkit-1.0-1.NEED_PRODUCT_PKGS.tar.bz2 -p source_packages/sample/pkg1 -k 2.0 -r s002a +check:rc==0 +check:output=~/opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit/prodkit-2.0-s002a.tar.bz2 successfully built +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit;tar -tf prodkit-2.0-s002a.tar.bz2 +check:output=~prodkit-compute_2.0-s002a_all.deb +check:output=~pkg1_1-2_all.deb +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/buildkit/prodkit +end + From f1a75b17d3ae66abbebf38515ddbf40beed88a7c Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:25:37 -0700 Subject: [PATCH 40/93] add addkit test cases --- xCAT-test/autotest/testcase/addkit/cases0 | 44 +++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/xCAT-test/autotest/testcase/addkit/cases0 b/xCAT-test/autotest/testcase/addkit/cases0 index 22cfb4998..0ee49701a 100644 --- a/xCAT-test/autotest/testcase/addkit/cases0 +++ b/xCAT-test/autotest/testcase/addkit/cases0 @@ -56,66 +56,66 @@ end start:addkit_multikit os:Linux cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit -cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit;buildkit create prodkit check:rc==0 cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit;buildkit buildrepo all check:rc==0 cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit;buildkit buildtar check:rc==0 -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit;buildkit create testkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit;buildkit create prod2kit check:rc==0 -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit;buildkit buildrepo all +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit;buildkit buildrepo all check:rc==0 -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit;buildkit buildtar +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit;buildkit buildtar check:rc==0 -cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit/prodkit-1.0-1.tar.bz2,/opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit/testkit-1.0-1.tar.bz2 +cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit/prodkit-1.0-1.tar.bz2,/opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit/prod2kit-1.0-1.tar.bz2 check:rc==0 check:output=~Adding Kit prodkit-1.0-1 -check:output=~Adding Kit testkit-1.0-1 -check:output=~Kit prodkit-1.0-1,testkit-1.0-1 was successfully added +check:output=~Adding Kit prod2kit-1.0-1 +check:output=~Kit prodkit-1.0-1,prod2kit-1.0-1 was successfully added cmd:tabdump kit|grep prodkit-1.0-1 check:rc==0 -cmd:tabdump kit|grep testkit-1.0-1 +cmd:tabdump kit|grep prod2kit-1.0-1 check:rc==0 cmd:rmkit prodkit-1.0-1 -cmd:rmkit testkit-1.0-1 +cmd:rmkit prod2kit-1.0-1 cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit/prodkit-1.0-1.tar.bz2 -cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit/testkit-1.0-1.tar.bz2 +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit/prod2kit-1.0-1.tar.bz2 cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit -cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit end start:addkit_p os:Linux cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit -cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit;buildkit create prodkit check:rc==0 cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit;buildkit buildrepo all check:rc==0 cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit;buildkit buildtar check:rc==0 -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit;buildkit create testkit +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit;buildkit create prod2kit check:rc==0 -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit;buildkit buildrepo all +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit;buildkit buildrepo all check:rc==0 -cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit;buildkit buildtar +cmd:cd /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit;buildkit buildtar check:rc==0 cmd:mkdir -p /install/test -cmd:addkit -p /install/test /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit/prodkit-1.0-1.tar.bz2,/opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit/testkit-1.0-1.tar.bz2 +cmd:addkit -p /install/test /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit/prodkit-1.0-1.tar.bz2,/opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit/prod2kit-1.0-1.tar.bz2 check:rc==0 check:output=~Adding Kit prodkit-1.0-1 -check:output=~Adding Kit testkit-1.0-1 -check:output=~Kit prodkit-1.0-1,testkit-1.0-1 was successfully added +check:output=~Adding Kit prod2kit-1.0-1 +check:output=~Kit prodkit-1.0-1,prod2kit-1.0-1 was successfully added cmd:tabdump kit|grep prodkit-1.0-1 check:rc==0 -cmd:tabdump kit|grep testkit-1.0-1 +cmd:tabdump kit|grep prod2kit-1.0-1 cmd:rmkit prodkit-1.0-1 -cmd:rmkit testkit-1.0-1 +cmd:rmkit prod2kit-1.0-1 cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit/prodkit-1.0-1.tar.bz2 -cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit/testkit-1.0-1.tar.bz2 -cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/testkit +cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit/prod2kit-1.0-1.tar.bz2 +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prod2kit cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/testcase/addkit/prodkit end From b4cd2e016bdff4902590908131290e9b2c40fde1 Mon Sep 17 00:00:00 2001 From: litingt Date: Thu, 23 Oct 2014 19:33:05 -0700 Subject: [PATCH 41/93] add kit bucket test data --- xCAT-test/autotest/kitdata/buildkit.conf | 59 ++++++++++++++++++ xCAT-test/autotest/kitdata/docs/index.html | 10 +++ .../autotest/kitdata/other_files/ubu.env | 1 + .../autotest/kitdata/scripts/test_postboot | 3 + .../autotest/kitdata/scripts/test_postinstall | 3 + .../source_packages/kittest/pkg1_1-2_all.deb | Bin 0 -> 1788 bytes .../source_packages/kittest/pkg2_1-2_all.deb | Bin 0 -> 1788 bytes .../source_packages/kittest/pkg3_1-2_all.deb | Bin 0 -> 1788 bytes 8 files changed, 76 insertions(+) create mode 100644 xCAT-test/autotest/kitdata/buildkit.conf create mode 100644 xCAT-test/autotest/kitdata/docs/index.html create mode 100644 xCAT-test/autotest/kitdata/other_files/ubu.env create mode 100755 xCAT-test/autotest/kitdata/scripts/test_postboot create mode 100755 xCAT-test/autotest/kitdata/scripts/test_postinstall create mode 100644 xCAT-test/autotest/kitdata/source_packages/kittest/pkg1_1-2_all.deb create mode 100644 xCAT-test/autotest/kitdata/source_packages/kittest/pkg2_1-2_all.deb create mode 100644 xCAT-test/autotest/kitdata/source_packages/kittest/pkg3_1-2_all.deb diff --git a/xCAT-test/autotest/kitdata/buildkit.conf b/xCAT-test/autotest/kitdata/buildkit.conf new file mode 100644 index 000000000..a525cea10 --- /dev/null +++ b/xCAT-test/autotest/kitdata/buildkit.conf @@ -0,0 +1,59 @@ +# Kit Build File +# sample file used for Kit automation test, modify it according to your test OS +# +kit: + basename=ubuntukit + description=Test kit for ubuntukit + version=1.0 + release=1 + ostype=Linux + osarch=ppc64el + vendor=IBM Corp. + kitdeployparams=ubu.env + kitlicense=EPL + +kitrepo: + kitrepoid=ubuntu14.04 + osbasename=ubuntu + osmajorversion=14 + osminorversion=04 + osarch=ppc64el + +kitcomponent: + basename=ubuntukit-compute-1 + description=description for component ubuntukit-compute-1 + serverroles=compute + kitrepoid=ubuntu14.04 + kitpkgdeps=pkg1 + +kitcomponent: + basename=ubuntukit-compute-2 + description=description for component ubuntukit-compute-2 + serverroles=compute + kitrepoid=ubuntu14.04 + kitcompdeps=ubuntukit-compute-1 + kitpkgdeps=pkg2,pkg3 + ospkgdeps=xinetd + postinstall=test_postinstall + postupgrade=test_postinstall + postbootscripts=test_postboot + + +kitpackage: + filename=pkg1_*_all.deb + kitrepoid=ubuntu14.04 + isexternalpkg=no + rpm_prebuiltdir=/kittest + +kitpackage: + filename=pkg2_*_all.deb + kitrepoid=ubuntu14.04 + isexternalpkg=no + rpm_prebuiltdir=/kittest + +kitpackage: + filename=pkg3_*_all.deb + kitrepoid=ubuntu14.04 + isexternalpkg=no + rpm_prebuiltdir=/kittest + diff --git a/xCAT-test/autotest/kitdata/docs/index.html b/xCAT-test/autotest/kitdata/docs/index.html new file mode 100644 index 000000000..b00ea63c6 --- /dev/null +++ b/xCAT-test/autotest/kitdata/docs/index.html @@ -0,0 +1,10 @@ + + +Product Documentation + + + +Redirecting to: +http://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Documentation + + diff --git a/xCAT-test/autotest/kitdata/other_files/ubu.env b/xCAT-test/autotest/kitdata/other_files/ubu.env new file mode 100644 index 000000000..5ff8bc7ba --- /dev/null +++ b/xCAT-test/autotest/kitdata/other_files/ubu.env @@ -0,0 +1 @@ +#ENV:TEST_LICENSE_ACCEPT=yes# diff --git a/xCAT-test/autotest/kitdata/scripts/test_postboot b/xCAT-test/autotest/kitdata/scripts/test_postboot new file mode 100755 index 000000000..788be4248 --- /dev/null +++ b/xCAT-test/autotest/kitdata/scripts/test_postboot @@ -0,0 +1,3 @@ +#!/bin/sh +echo "running test_postboot script" + diff --git a/xCAT-test/autotest/kitdata/scripts/test_postinstall b/xCAT-test/autotest/kitdata/scripts/test_postinstall new file mode 100755 index 000000000..8bb4e3163 --- /dev/null +++ b/xCAT-test/autotest/kitdata/scripts/test_postinstall @@ -0,0 +1,3 @@ +#!/bin/sh +echo "running test_postinstall script" + diff --git a/xCAT-test/autotest/kitdata/source_packages/kittest/pkg1_1-2_all.deb b/xCAT-test/autotest/kitdata/source_packages/kittest/pkg1_1-2_all.deb new file mode 100644 index 0000000000000000000000000000000000000000..4a445c94a1b13491779824d2427f787d13f3dddc GIT binary patch literal 1788 zcmai#X*3&%8iqrvOsEDmjawv9LOUd(mRdt8wZwLfy$Dib9fWI3w6#@LYYQd1Sc0P3 zs_3;elv_$%L`!Nfp-n7PMa6FPF7tPu^PTsc?|kR|_nh;=4RDcufkq&Iye|P4rshis z!$royU@&z}b#?Rw4P6Z#7z};1|3B5yXl+eR80={NhYv^ti3a(FhY=&gLy$yVBr+iW zulrh>7yj%+GerPD5CpEUO@b%Tr-WBazMmsbiqndK66+~&%D@nop;eDO+Of1AvY(InTO<91l+x^#gJ5gRDj50Cy;e35#^N3s>FLokg z4LCR7^}KS=CVM?l+vtX6>%|#1$&L|>sn`ZaVEKc|GoxL#T?ZNpaG=|9#PKa57 zenH|*>%aWYyxzh`XV-E~H+VSgtkGpG5~snsmyU2*7poS{@mgB>2;BcHRjPwl!VrlD z{drCLGZO?tOi~1Sy&}|{o1TfDG_mn{l8Lj{%HnMP<4by%0e5OPX;?4Vbu*`K`kB(< zz_xtlVL=k&HfOK4S<&af+eEx~es>v_-v7_v4Xb7iKPLq*G)~wm?`56lAL_1KY@eoe z?6n`q*A}#PQ?vr7o$E(B7DplY5FlMEKTUmsZ(jA%<54C4mEng>{NP2WtbHZrV(W7u zBj~DNm!=jL{X@;Dz25V6(GJW>C6Pi;Q6Cx}M!h{TK00tEkWy{@!rh^T>T48AOqopc z7U~b#7&3vjEK9mSORq~%6we0_UE<_BKRqwTvC{9MmYo{rZf@V`+yawcS-OHGE{VWX zz<;iM zai~u9My^MjBxR)w`Rff>qG2|Q21V%G<#~8=oFJGvxU-9k?)cwR6()40So&5&Jdy89 zwu77!kZ;s!*TU4+14^k%2-Z$Pa_cI2!1SNdiUAD_(7qAJD zfRoM*V*DDv&v*KIu)kO=YlI1$&Fhy#NcuL*!)}g?QtVLEAqTkE=akJtb_wk@n?IGB zHQHL z4=j?Fw89m*fmawNY9;Bb=J6t5B)P9vTDsH%k1OdmgtpcZ^agW^1PT{Ma zirX&4_rFc7Xe;!(e;0V7Tf#a30uP}^^)BGdW$de;77-BIo~$0drClwL{oejDVe#L* znrTePHE}bJESXw<_<(z?TuABR`!|zf%egL&*A&AH-0=o?roHZG7)OcE0ML~Y8D*|( zx{{wFi56-GG%GdP1zHjDu^?F9urswNLuD&f^)gSp#MrKWuvh8hPcx)2iF>HWA9+yM z4TelrtaUd+57L`RmFx&qDq-=bK&y}9uJi#HD5z*&Qa#% zVskfDy_xb;Z##>FvObXhMO0oTHq^d{@cnqL*fxom$1VtaCJ}aCU30V!#(>3|nTb|qf1ll`G*qqhNk;;zDZqAhV=W+k>{G?Tu;uZl zgAw{0pX9#yAnL$;W$!kP%y2IkZ-w8;dW#}y6JJ&EN4h6Eddf&;vR(>n`}>)r9bda7 zWM;vb+u+GGOF_AJO_q)y8C56E=!xI7yGK>twPg>*kb~BLrau?>w(w>sbiwvie^E^I zb7yj%+GerPD5CpEUO@b%Tr-WBazMmsbiqndK66+~&%D@nop;eDO+Of1AvY(InTO<91l+x^#gJ5gRDj50Cy;e35#^N3s>FLokg z4LCR7^}KS=CVM?l+vtX6>%|#1$&L|>sn`ZaVEKc|GoxL#T?ZNpaG=|9#PKa57 zenH|*>%aWYyxzh`XV-E~H+VSgtkGpG5~snsmyU2*7poS{@mgB>2;BcHRjPwl!VrlD z{drCLGZO?tOi~1Sy&}|{o1TfDG_mn{l8Lj{%HnMP<4by%0e5OPX;?4Vbu*`K`kB(< zz_xtlVL=k&HfOK4S<&af+eEx~es>v_-v7_v4Xb7iKPLq*G)~wm?`56lAL_1KY@eoe z?6n`q*A}#PQ?vr7o$E(B7DplY5FlMEKTUmsZ(jA%<54C4mEng>{NP2WtbHZrV(W7u zBj~DNm!=jL{X@;Dz25V6(GJW>C6Pi;Q6Cx}M!h{TK00tEkWy{@!rh^T>T48AOqopc z7U~b#7&3vjEK9mSORq~%6we0_UE<_BKRqwTvC{9MmYo{rZf@V`+yawcS-OHGE{VWX zz<;iM zai~u9My^MjBxR)w`Rff>qG2|Q21V%G<#~8=oFJGvxU-9k?)cwR6()40So&5&Jdy89 zwu77!kZ;s!*TU4+14^k%2-Z$Pa_cI2!1SNdiUAD_(7qAJD zfRoM*V*DDv&v*KIu)kO=YlI1$&Fhy#NcuL*!)}g?QtVLEAqTkE=akJtb_wk@n?IGB zHQHL z4=j?Fw89m*fmawNY9;Bb=J6t5B)P9vTDsH%k1OdmgtpcZ^agW^1PT{Ma zirX&4_rFc7Xe;!(e;0V7Tf#a30uP}^^)BGdW$de;77-BIo~$0drClwL{oejDVe#L* znrTePHE}bJESXw<_<(z?TuABR`!|zf%egL&*A&AH-0=o?roHZG7)OcE0ML~Y8D*|( zx{{wFi56-GG%GdP1zHjDu^?F9urswNLuD&f^)gSp#MrKWuvh8hPcx)2iF>HWA9+yM z4TelrtaUd+57L`RmFx&qDq-=bK&y}9uJi#HD5z*&Qa#% zVskfDy_xb;Z##>FvObXhMO0oTHq^d{@cnqL*fxom$1VtaCJ}aCU30V!#(>3|nTb|qf1ll`G*qqhNk;;zDZqAhV=W+k>{G?Tu;uZl zgAw{0pX9#yAnL$;W$!kP%y2IkZ-w8;dW#}y6JJ&EN4h6Eddf&;vR(>n`}>)r9bda7 zWM;vb+u+GGOF_AJO_q)y8C56E=!xI7yGK>twPg>*kb~BLrau?>w(w>sbiwvie^E^I zb7yj%+GerPD5CpEUO@b%Tr-WBazMmsbiqndK66+~&%D@nop;eDO+Of1AvY(InTO<91l+x^#gJ5gRDj50Cy;e35#^N3s>FLokg z4LCR7^}KS=CVM?l+vtX6>%|#1$&L|>sn`ZaVEKc|GoxL#T?ZNpaG=|9#PKa57 zenH|*>%aWYyxzh`XV-E~H+VSgtkGpG5~snsmyU2*7poS{@mgB>2;BcHRjPwl!VrlD z{drCLGZO?tOi~1Sy&}|{o1TfDG_mn{l8Lj{%HnMP<4by%0e5OPX;?4Vbu*`K`kB(< zz_xtlVL=k&HfOK4S<&af+eEx~es>v_-v7_v4Xb7iKPLq*G)~wm?`56lAL_1KY@eoe z?6n`q*A}#PQ?vr7o$E(B7DplY5FlMEKTUmsZ(jA%<54C4mEng>{NP2WtbHZrV(W7u zBj~DNm!=jL{X@;Dz25V6(GJW>C6Pi;Q6Cx}M!h{TK00tEkWy{@!rh^T>T48AOqopc z7U~b#7&3vjEK9mSORq~%6we0_UE<_BKRqwTvC{9MmYo{rZf@V`+yawcS-OHGE{VWX zz<;iM zai~u9My^MjBxR)w`Rff>qG2|Q21V%G<#~8=oFJGvxU-9k?)cwR6()40So&5&Jdy89 zwu77!kZ;s!*TU4+14^k%2-Z$Pa_cI2!1SNdiUAD_(7qAJD zfRoM*V*DDv&v*KIu)kO=YlI1$&Fhy#NcuL*!)}g?QtVLEAqTkE=akJtb_wk@n?IGB zHQHL z4=j?Fw89m*fmawNY9;Bb=J6t5B)P9vTDsH%k1OdmgtpcZ^agW^1PT{Ma zirX&4_rFc7Xe;!(e;0V7Tf#a30uP}^^)BGdW$de;77-BIo~$0drClwL{oejDVe#L* znrTePHE}bJESXw<_<(z?TuABR`!|zf%egL&*A&AH-0=o?roHZG7)OcE0ML~Y8D*|( zx{{wFi56-GG%GdP1zHjDu^?F9urswNLuD&f^)gSp#MrKWuvh8hPcx)2iF>HWA9+yM z4TelrtaUd+57L`RmFx&qDq-=bK&y}9uJi#HD5z*&Qa#% zVskfDy_xb;Z##>FvObXhMO0oTHq^d{@cnqL*fxom$1VtaCJ}aCU30V!#(>3|nTb|qf1ll`G*qqhNk;;zDZqAhV=W+k>{G?Tu;uZl zgAw{0pX9#yAnL$;W$!kP%y2IkZ-w8;dW#}y6JJ&EN4h6Eddf&;vR(>n`}>)r9bda7 zWM;vb+u+GGOF_AJO_q)y8C56E=!xI7yGK>twPg>*kb~BLrau?>w(w>sbiwvie^E^I zb Date: Fri, 25 Oct 2013 11:47:53 +0800 Subject: [PATCH 42/93] fix for bug 4319: should not require ipmitool-xcat and xCAT-genesis-base on AIX --- xCAT/xCAT.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 7d44b2049..e418e8b92 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -63,10 +63,12 @@ Requires: syslinux xCAT-genesis-scripts-x86_64 elilo-xcat Requires: ipmitool-xcat >= 1.8.9 Requires: xnba-undi %endif +%ifos linux %ifarch ppc ppc64 Requires: xCAT-genesis-scripts-ppc64 Requires: ipmitool-xcat >= 1.8.9 %endif +%endif %if %notpcm %ifarch i386 i586 i686 x86 x86_64 From a3028511faf9cdaeb0ca548a69964786e42f97b6 Mon Sep 17 00:00:00 2001 From: ligc Date: Fri, 24 Oct 2014 03:54:08 -0400 Subject: [PATCH 43/93] remove the ifnarch s390x, the ifarch/ifnarch does not work for noarch package, grub2-xcat is shipped with s390 xcat-dep --- xCAT-server/xCAT-server.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index d2245da4d..5ecaca236 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -32,10 +32,11 @@ Obsoletes: atftp-xcat # The aix rpm cmd forces us to do this outside of ifos type stmts %if %notpcm %ifos linux -%ifnarch s390x +# ifarch/ifnarch does not work for noarch package +#%ifnarch s390x # PCM does not use or ship grub2-xcat Requires: grub2-xcat -%endif +#%endif %endif %endif From 62449203055562a29d2b83f50022e902700efbf8 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Fri, 24 Oct 2014 09:43:31 -0400 Subject: [PATCH 44/93] Enhance the ddns.pm to support the site.dnsinterfaces for DNS server to listen on specific interfaces instead of all --- perl-xCAT/xCAT/Schema.pm | 10 ++++ xCAT-server/lib/xcat/plugins/ddns.pm | 90 +++++++++++++++++++++++++++- 2 files changed, 98 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 8ed823d11..7770e9971 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -995,6 +995,16 @@ site => { " dnsupdaters: The value are \',\' separated string which will be added to the zone config\n". " section. This is an interface for user to add configuration entries to\n". " the zone sections in named.conf.\n\n". + " dnsinterfaces: The network interfaces DNS server should listen on. If it is the same\n". + " for all nodes, use a simple comma-separated list of NICs. To\n". + " specify different NICs for different nodes:\n". + " xcatmn|eth1,eth2;service|bond0.\n". + " In this example xcatmn is the name of the xCAT MN, and DNS there\n". + " should listen on eth1 and eth2. On all of the nodes in group\n". + " 'service' DNS should listen on the bond0 nic.\n". + " NOTE: if using this attribute to block certain interfaces, make sure\n". + " the ip maps to your hostname of xCAT MN is not blocked since xCAT needs to\n". + " use this ip to communicate with the local NDS server on MN.\n\n". " -------------------------\n". "HARDWARE CONTROL ATTRIBUTES\n". " -------------------------\n". diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 2d6175f20..8ade8cbf8 100755 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -515,6 +515,61 @@ sub process_request { $ctx->{zonestotouch}->{$_->{domain}}=1; } } + + # get the listen on port for the DNS server from site.dnsinterfaces + my @dnsifinsite = xCAT::TableUtils->get_site_attribute("dnsinterfaces"); + if (@dnsifinsite) + #syntax should be like host|ifname1,ifname2;host2|ifname3,ifname2 etc or simply ifname,ifname2 + { + my $dnsinterfaces = $dnsifinsite[0]; + my $listenonifs; + foreach my $dnsif (split /;/,$dnsinterfaces) { + if ($dnsif =~ /\|/) { # there's host in the string + my ($hosts,$dnsif) = split /\|/,$dnsif; + if (! xCAT::NetworkUtils->thishostisnot($hosts)) { + $listenonifs=$dnsif; + } else { + # this host string might be a xcat group, try to test each node in the group + foreach my $host (noderange($hosts)) { + unless (xCAT::NetworkUtils->thishostisnot($host)) { + $listenonifs=$dnsif; + last; + } + } + } + } else { + $listenonifs = $dnsif; + } + + # get the ip for each interface and set it to $ctx->{dnslistenonifs} + if ($listenonifs) { + $listenonifs = "lo,".$listenonifs; + # get the ip address for each interface + my (@listenipv4, @listenipv6); + for my $if (split /,/, $listenonifs) { + my @ifaddrs = `ip addr show $if`; + foreach (@ifaddrs) { + if (/^\s*inet\s+([^ ]*)/) { + my $ip = $1; + $ip =~ s/\/.*//; + push @listenipv4, $ip; + } elsif (/^\s*inet6\s+([^ ]*)/) { + my $ip = $1; + $ip =~ s/\/.*//; + push @listenipv6, $ip; + } + } + } + if (@listenipv4) { + $ctx->{dnslistenonifs}->{ipv4} = \@listenipv4; + } + if (@listenipv6) { + $ctx->{dnslistenonifs}->{ipv6} = \@listenipv6; + } + last; + } + } + } xCAT::SvrUtils::sendmsg("Getting reverse zones, this may take several minutes for a large cluster.", $callback); @@ -930,6 +985,20 @@ sub update_namedconf { push @newnamed,"\t\t".$_.";\n"; } push @newnamed,"\t};\n"; + } elsif (defined($ctx->{dnslistenonifs}) and defined($ctx->{dnslistenonifs}->{ipv4}) and $line =~ /listen-on {/) { + push @newnamed,"\tlisten-on \{\n"; + $skip=1; + foreach (@{$ctx->{dnslistenonifs}->{ipv4}}) { + push @newnamed,"\t\t".$_.";\n"; + } + push @newnamed,"\t};\n"; + } elsif (defined($ctx->{dnslistenonifs}) and defined($ctx->{dnslistenonifs}->{ipv6}) and $line =~ /listen-on-v6 {/) { + push @newnamed,"\tlisten-on-v6 \{\n"; + $skip=1; + foreach (@{$ctx->{dnslistenonifs}->{ipv6}}) { + push @newnamed,"\t\t".$_.";\n"; + } + push @newnamed,"\t};\n"; } elsif ($skip) { if ($line =~ /};/) { $skip = 0; @@ -1029,7 +1098,7 @@ sub update_namedconf { push @newnamed,"\tdirectory \"".$ctx->{zonesdir}."\";\n"; push @newnamed, "\tallow-recursion { any; };\n"; } - push @newnamed,"\t\t//listen-on-v6 { any; };\n"; + #push @newnamed,"\t\t//listen-on-v6 { any; };\n"; if ($ctx->{forwarders}) { push @newnamed,"\tforwarders {\n"; foreach (@{$ctx->{forwarders}}) { @@ -1055,6 +1124,23 @@ sub update_namedconf { push @newnamed,"\t};\n"; } } + + # add the listen-on option + if (defined($ctx->{dnslistenonifs}) and defined($ctx->{dnslistenonifs}->{ipv4})) { + push @newnamed, "\tlisten-on \{\n"; + foreach (@{$ctx->{dnslistenonifs}->{ipv4}}) { + push @newnamed,"\t\t".$_.";\n"; + } + push @newnamed,"\t};\n" + } + if (defined($ctx->{dnslistenonifs}) and defined($ctx->{dnslistenonifs}->{ipv6})) { + push @newnamed,"\tlisten-on-v6 \{\n"; + foreach (@{$ctx->{dnslistenonifs}->{ipv6}}) { + push @newnamed,"\t\t".$_.";\n"; + } + push @newnamed,"\t};\n"; + } + push @newnamed,"};\n\n"; } @@ -1068,7 +1154,7 @@ sub update_namedconf { $ctx->{restartneeded}=1; } } - + my $cmd = "grep '^nameserver' /etc/resolv.conf | awk '{print \$2}'"; my @output = xCAT::Utils->runcmd($cmd, 0); my $zone; From f00771ff9262af118a79bb012fb8d0f4dfc1ebed Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 24 Oct 2014 15:03:40 -0400 Subject: [PATCH 45/93] add rhel6.6 compute node media info to discinfo.pm --- perl-xCAT/xCAT/data/discinfo.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 7fcb4ad77..454beb213 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -75,6 +75,7 @@ require Exporter; "1339640148.070971" => "rhelhpc6.3",#x86_64 "1359576195.413831" => "rhelhpc6.4",#x86_64, RHEL ComputeNode "1384196516.465862" => "rhelhpc6.5",#x86_64, RHEL ComputeNode + "1411733344.599861" => "rhelhpc6.6",#x86_64, RHEL ComputeNode "1399449226.140088" => "rhelhpc7.0",#x86_64, RHEL ComputeNode "1194015916.783841" => "fedora8", "1194015385.299901" => "fedora8", From 8431d6cad980b2d071ce3752e1599c1b500f27cc Mon Sep 17 00:00:00 2001 From: huweihua Date: Sun, 26 Oct 2014 22:38:25 -0400 Subject: [PATCH 46/93] fix defect 4295, sysclone can't clone a SLES11.3 golden client --- xCAT/postscripts/replace_byid_device | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/replace_byid_device b/xCAT/postscripts/replace_byid_device index 8d199c2a6..47429e9ff 100644 --- a/xCAT/postscripts/replace_byid_device +++ b/xCAT/postscripts/replace_byid_device @@ -19,7 +19,7 @@ do # str_dev_prefix=`basename $str_old_dev | awk -F'-' '{print $1}'` #find out the new by-id name - str_new_dev=`ls -l --time-style=locale /dev/disk/by-id/ | grep -E "$str_real\$" | awk '{print $9}'` + str_new_dev=`ls -l --time-style=locale /dev/disk/by-id/ | grep -E "$str_real\$" | awk '{print $9}'|head -n 1` if [ -z "$str_new_dev" ];then continue fi From a44d5080449da149b2602a1e058b650120e2a9a5 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Mon, 27 Oct 2014 03:57:21 -0700 Subject: [PATCH 47/93] add package xcat depending on xcat-buildkit --- xCAT/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/debian/control b/xCAT/debian/control index 31c38c62d..d39349e22 100644 --- a/xCAT/debian/control +++ b/xCAT/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.7.2 Package: xcat Architecture: amd64 ppc64el -Depends: ${perl:Depends}, xcat-server, xcat-client, libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, nmap, bind9, libxml-parser-perl, xinetd, tftpd-hpa, tftp-hpa, conserver-xcat, libnet-telnet-perl, ipmitool-xcat (>=1.8.9), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat[any-amd64], xnba-undi[any-amd64], xcat-genesis-scripts, elilo-xcat[any-amd64] +Depends: ${perl:Depends}, xcat-server, xcat-client, libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, nmap, bind9, libxml-parser-perl, xinetd, tftpd-hpa, tftp-hpa, conserver-xcat, libnet-telnet-perl, ipmitool-xcat (>=1.8.9), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat[any-amd64], xnba-undi[any-amd64], xcat-genesis-scripts, elilo-xcat[any-amd64], xcat-buildkit Description: Server and configuration utilities of the xCAT management project xcat-server provides the core server and configuration management components of xCAT. This package should be installed on your management server From f5cf1968dfdbe736f2233e1807e65db2acc2fa88 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Mon, 27 Oct 2014 04:49:39 -0400 Subject: [PATCH 48/93] add dependency xcat-buildkit for package xcat --- xCAT/xCAT.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index e418e8b92..a5501f261 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -64,6 +64,7 @@ Requires: ipmitool-xcat >= 1.8.9 Requires: xnba-undi %endif %ifos linux +Requires: xcat-buildkit %ifarch ppc ppc64 Requires: xCAT-genesis-scripts-ppc64 Requires: ipmitool-xcat >= 1.8.9 From 3ec9780b6ece9ce164cf362ca226ba43c6457b11 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 27 Oct 2014 05:59:56 -0400 Subject: [PATCH 49/93] fix 4322,genimage failed with pperte KIT componentwhich has environment variable --- .../share/xcat/netboot/ubuntu/genimage | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 12101fbd8..875233929 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -241,7 +241,14 @@ unless ($onlyinitrd) { my @line=split(" ",`ls -lh $installroot/$osver/$arch/dists/ | grep dr`); my $dist = $line[@line-1]; - my $aptgetcmd = "chroot $rootimg_dir apt-get update && chroot $rootimg_dir apt-get $non_interactive "; +# my $aptgetcmd = "chroot $rootimg_dir apt-get update && chroot $rootimg_dir apt-get $non_interactive "; + + # If there is env in otherpkg list + # apt-get update and apt-get install should be added env param + my $aptgetcmd = "chroot $rootimg_dir apt-get update"; + my $aptgetcmdby="chroot $rootimg_dir apt-get $non_interactive "; + + my $aptcachecmd = "chroot $rootimg_dir apt-get update && chroot $rootimg_dir apt-cache $non_interactive "; my $aptcmd1 = "debootstrap"; #my $aptcmd2 = "--arch $uarch $dist $rootimg_dir file://$installroot/$osver/$arch/"; @@ -408,9 +415,21 @@ unless ($onlyinitrd) { # install extra packages my $aptgetcmd_base = $aptgetcmd; + + #env param need to be added before each chroot + my $aptdevby=$aptgetcmd; + + # to prevent "The following packages cannot be authenticated" error, # invoke apt-get with "--allow-unauthenticated" option - $aptgetcmd .= " install --allow-unauthenticated "; + #example:If there is env IBM_PPE_RTE_LICENSE_ACCEPT , it should be in front of chroot + #IBM_PPE_RTE_LICENSE_ACCEPT=yes chroot /install/netboot/ubuntu14.04/ppc64el/compute/rootimg apt-get update&& IBM_PPE_RTE_LICENSE_ACCEPT=yes chroot /install/netboot/ubuntu14.04/ppc64el/compute/rootimg apt-get -y install --allow-unauthenticated pperte-license + $aptdevby .="&& ".$envlist." "; + $aptdevby .=$aptgetcmdby; + $aptdevby .=" install --allow-unauthenticated "; + $aptgetcmd=$aptdevby; + $aptgetcmd_base = $aptgetcmd; + # append extra pkg names to yum command if ($extrapkgnames{$pass}) { $aptgetcmd .= " $extrapkgnames{$pass} "; From 13c93831bf1ce75700c26a749c544be2b60db9ee Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 27 Oct 2014 08:53:44 -0400 Subject: [PATCH 50/93] use read only mount for kitcomponent during addkitcomp --- xCAT-server/lib/xcat/plugins/kit.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index e4a94a721..4314ca64e 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -589,7 +589,7 @@ sub assign_to_osimage { system("mkdir -p $otherpkgdir/$kitcomptable->{kitreponame}"); print "mkdir -p $otherpkgdir/$kitcomptable->{kitreponame}"; - system("mount --bind $kitrepodir $otherpkgdir/$kitcomptable->{kitreponame}"); + system("mount -o ro --bind $kitrepodir $otherpkgdir/$kitcomptable->{kitreponame}"); print "mount --bind $kitrepodir $otherpkgdir/$kitcomptable->{kitreponame}"; } } From 49e7a6d39398ba198c616f451b7674751292ba5b Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 27 Oct 2014 09:34:57 -0400 Subject: [PATCH 51/93] multipul env param --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 875233929..c03206811 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -428,7 +428,6 @@ unless ($onlyinitrd) { $aptdevby .=$aptgetcmdby; $aptdevby .=" install --allow-unauthenticated "; $aptgetcmd=$aptdevby; - $aptgetcmd_base = $aptgetcmd; # append extra pkg names to yum command if ($extrapkgnames{$pass}) { From c57e57fc3f6ccfda7ecc5a9990002435836b57f4 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 27 Oct 2014 10:04:02 -0400 Subject: [PATCH 52/93] fix 4313 update help iniformation for some kit commands --- xCAT-server/lib/xcat/plugins/kit.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 4314ca64e..0a14bf531 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -1461,7 +1461,7 @@ sub rmkit push@{ $rsp{data} }, "Usage: rmkit - Remove Kits from xCAT."; push@{ $rsp{data} }, "\trmkit [-h|--help]"; push@{ $rsp{data} }, "\trmkit [-v|--version]"; - push@{ $rsp{data} }, "\trmkit [-V|--verbose] [-f|--force] [-t|--test] ] [-V]"; + push@{ $rsp{data} }, "\trmkit [-V|--verbose] [-f|--force] [-t|--test] ]"; xCAT::MsgUtils->message( "I", \%rsp, $callback ); }; From 15bc5437f45141b3e81f032e6a64c7d3a2c505f1 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 27 Oct 2014 10:07:26 -0400 Subject: [PATCH 53/93] fix 4313 rmkitcomp, there is no options for --noscripts --- xCAT-server/lib/xcat/plugins/kit.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 0a14bf531..f0dc4a547 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -2419,7 +2419,7 @@ sub rmkitcomp push@{ $rsp{data} }, "Usage: rmkitcomp - Remove Kit components from an xCAT osimage."; push@{ $rsp{data} }, "\trmkitcomp [-h|--help]"; push@{ $rsp{data} }, "\trmkitcomp [-v|--version]"; - push@{ $rsp{data} }, "\trmkitcomp [-V|--verbose] [-u|--uninstall] [-f|--force] \n\t\t-i "; + push@{ $rsp{data} }, "\trmkitcomp [-V|--verbose] [-u|--uninstall] [-f|--force] [--noscripts] \n\t\t-i "; xCAT::MsgUtils->message( "I", \%rsp, $callback, $ret ); }; From dab45f5df2de641d0a50da802349330fac35763e Mon Sep 17 00:00:00 2001 From: baiyuan Date: Tue, 28 Oct 2014 03:39:23 -0400 Subject: [PATCH 54/93] change name compute.ubuntu14.04.ppc64el.pkglist to compute.ubuntu14.04.ppc64le.pkglist --- .../ubuntu/compute.ubuntu14.04.ppc64le.pkglist | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.ppc64le.pkglist diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.ppc64le.pkglist new file mode 100644 index 000000000..818b8f26f --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.ppc64le.pkglist @@ -0,0 +1,15 @@ +bash +nfs-common +openssl +isc-dhcp-client +libc-bin +linux-image-generic +openssh-server +openssh-client +wget +vim +ntp +rsync +busybox-static +gawk +dnsutils From f8db0659f010ae8375af618c5eb28c6019be3509 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Tue, 28 Oct 2014 03:45:23 -0400 Subject: [PATCH 55/93] fix 4325 Use buildkit to create kit,the osarch is always ppc64el .It's not consistenct with real osarch --- xCAT-buildkit/bin/buildkit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index d058c0e81..c9c4b6d13 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -1167,7 +1167,7 @@ sub edit_bldkitconf my $kitcomponent_basename = $kitname."_compute"; if ($debianflag==1) { - if($osarch == "ppc64le"){ + if($osarch eq "ppc64le"){ $osarch="ppc64el"; } $kitcomponent_basename = $kitname."-compute"; @@ -1893,7 +1893,7 @@ sub validate_os chomp($osarch); if ($debianflag==1) { - if($osarch == "ppc64le"){ + if($osarch eq "ppc64le"){ $osarch="ppc64el"; } } From fead0c878e4672b22da99c3017d92d818a286257 Mon Sep 17 00:00:00 2001 From: immarvin Date: Tue, 28 Oct 2014 01:58:19 -0700 Subject: [PATCH 56/93] fix defect #4327 [dev] copycds should use ppc64le instead of ppc64el in ubuntu ppc64le --- xCAT-server/lib/xcat/plugins/debian.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 62cc32abd..e44477788 100755 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -279,7 +279,7 @@ sub copycd } elsif ($darch and $darch =~ /ppc64el/) { - $darch = "ppc64el"; + $darch = "ppc64le"; } elsif ($darch and ($darch =~ /ppc/ or $darch =~ /powerpc/)) { From dcaa4416af8f02ff7e9495f65b1e328214d68da1 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Tue, 28 Oct 2014 04:19:59 -0400 Subject: [PATCH 57/93] remove xcat-buildkit,xCAT-buildkit is here --- xCAT/xCAT.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index a5501f261..e418e8b92 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -64,7 +64,6 @@ Requires: ipmitool-xcat >= 1.8.9 Requires: xnba-undi %endif %ifos linux -Requires: xcat-buildkit %ifarch ppc ppc64 Requires: xCAT-genesis-scripts-ppc64 Requires: ipmitool-xcat >= 1.8.9 From 475e64aa69a41009884853d9f8ce5a6fc83ca437 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Tue, 28 Oct 2014 05:14:42 -0400 Subject: [PATCH 58/93] use ppc64el now for ubuntu package use ppc64el --- xCAT-server/lib/xcat/plugins/debian.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index e44477788..62cc32abd 100755 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -279,7 +279,7 @@ sub copycd } elsif ($darch and $darch =~ /ppc64el/) { - $darch = "ppc64le"; + $darch = "ppc64el"; } elsif ($darch and ($darch =~ /ppc/ or $darch =~ /powerpc/)) { From 50f2f825acfe9bb652dc0ff7d05e45d8223df1d0 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Tue, 28 Oct 2014 05:36:29 -0400 Subject: [PATCH 59/93] use Utils instead of BuildkitUtils.pm --- xCAT-server/lib/xcat/plugins/kit.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index f0dc4a547..cb59fa0eb 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -17,7 +17,6 @@ use lib "$::XCATROOT/lib/perl"; use xCAT::Table; use xCAT::Utils; use xCAT::MsgUtils; -use xCAT::BuildKitUtils; use Getopt::Long; #use Data::Dumper; use File::Basename; @@ -33,7 +32,7 @@ $::KITFRAMEWORK ="2"; $::COMPATIBLE_KITFRAMEWORKS = "0,1,2"; my $debianflag = 0; -my $tempstring = xCAT::BuildKitUtils->osver(); +my $tempstring = xCAT::Utils->osver(); if ( $tempstring =~ /debian/ || $tempstring =~ /ubuntu/ ){ $debianflag = 1; print "debian"; From cf5ae4742850ee47e14c0eb0b61ae724cc5b07c3 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Tue, 28 Oct 2014 05:46:23 -0400 Subject: [PATCH 60/93] add osarch comments for Ubuntu Power LE --- xCAT-buildkit/share/xcat/kits/kit_template/buildkit.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-buildkit/share/xcat/kits/kit_template/buildkit.conf b/xCAT-buildkit/share/xcat/kits/kit_template/buildkit.conf index 86393c649..5f375942a 100644 --- a/xCAT-buildkit/share/xcat/kits/kit_template/buildkit.conf +++ b/xCAT-buildkit/share/xcat/kits/kit_template/buildkit.conf @@ -96,7 +96,8 @@ kit: # # osminorversion (optional) OS minor version. (ex. "4") # -# osarch (mandatory) OS architecture. (ex. "x86_64") +# osarch (mandatory) OS architecture. (ex.redhat x86_64 should be "x86_64", Ubuntu Power LE should be "ppc64el", +# For Ubuntu Power LE, system arch is ppc64le, for ubuntu software package, should use "ppc64el", # # compat_osbasenames (optional) Comma-separated list of compatible # OS distribution base names. (ex. "centos") From e81496cac95f2ebeef15d25c3f618619f33e96b6 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Tue, 28 Oct 2014 06:09:37 -0400 Subject: [PATCH 61/93] support ubuntu 14.04.1 ppc64el diskless --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index c03206811..efe37096c 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -465,7 +465,8 @@ unless ($onlyinitrd) { # run apt-get upgrade to update any installed debs # needed when running genimage again after updating software in repositories - my $aptgetcmd_update = $yumcmd_base . " upgrade "; + #my $aptgetcmd_update = $yumcmd_base . " upgrade "; + my $aptgetcmd_update = $aptgetcmd . "&&". $aptgetcmdby . " upgrade "; $rc = system("$aptgetcmd_update"); print("Umount /proc, /dev, /sys, pkgdir and otherpkgdir to the rootimg.\n"); umount_chroot($rootimg_dir); @@ -1783,9 +1784,13 @@ sub umount_chroot { #system("umount $rootimage_dir/proc"); #system("umount $rootimage_dir/sys"); system("umount $rootimage_dir/mnt/pkgdir"); - #system("umount $rootimage_dir/mnt/otherpkgdir"); - system("grep /mnt/otherpkgdir /proc/mounts | cut -f2 -d' ' | sort -r|xargs umount"); rmdir("$rootimage_dir/mnt/pkgdir"); + #system("umount $rootimage_dir/mnt/otherpkgdir"); + #system("grep /mnt/otherpkgdir /proc/mounts | cut -f2 -d' ' | sort -r|xargs umount"); + my @data = `grep /mnt/otherpkgdir /proc/mounts | cut -f2 -d' ' | sort -r`; + foreach (@data) { + `umount $_`; + } rmdir("$rootimage_dir/mnt/otherpkgdir"); } From 424886c5d0ce0d6b0e33e7034ee865512df83858 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 28 Oct 2014 07:15:05 -0400 Subject: [PATCH 62/93] defect 3723 --- perl-xCAT/xCAT/Schema.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 7770e9971..3a0fd505c 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -728,7 +728,7 @@ osimage => { description => 'OS Image Description', provmethod => 'The provisioning method for node deployment. The valid values are install, netboot,statelite,boottarget,dualboot,sysclone. If boottarget is set, you must set linuximage.boottarget to the name of the boottarget definition. It is not used by AIX.', rootfstype => 'The filesystem type for the rootfs is used when the provmethod is statelite. The valid values are nfs or ramdisk. The default value is nfs', - osdistroname => 'The name of the OS distro definition. This attribute can be used to specify which OS distro to use, instead of using the osname,osvers,and osarch attributes.', + osdistroname => 'The name of the OS distro definition. This attribute can be used to specify which OS distro to use, instead of using the osname,osvers,and osarch attributes. For *kit commands, the attribute will be used to read the osdistro table for the osname, osvers, and osarch attributes. If defined, the osname, osvers, and osarch attributes defined in the osimage table will be ignored.', osupdatename => 'A comma-separated list of OS distro updates to apply to this osimage.', cfmdir => 'CFM directory name for PCM. Set to /install/osimages//cfmdir by PCM. ', profile => 'The node usage category. For example compute, service.', From c40c63ad778ef7aa4ccbbd62a5475e5c74fe7c50 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 28 Oct 2014 09:38:02 -0400 Subject: [PATCH 63/93] defect 4329 --- xCAT-genesis-scripts/xCAT-genesis-scripts.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec index b714e094e..3b5d3baef 100755 --- a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec +++ b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec @@ -68,7 +68,7 @@ cd - # should run mknb. Tried to use rpm triggers, but in several cases the trigger would # get run multiple times. #echo "touching /etc/xcat/genesis-scripts-updated" -echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb manually'" +echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb ' manually" mkdir -p /etc/xcat touch /etc/xcat/genesis-scripts-updated From 4781a420d2b08fe4b2d937e47b294a5afca6d86a Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 28 Oct 2014 17:47:51 -0400 Subject: [PATCH 64/93] defect 3348 - rmkitcomp by basename now removes all kitcomponents matching that name instead of just the highest --- xCAT-client/pods/man1/rmkitcomp.1.pod | 2 +- xCAT-server/lib/xcat/plugins/kit.pm | 59 +++++++++++++++++++-------- 2 files changed, 44 insertions(+), 17 deletions(-) diff --git a/xCAT-client/pods/man1/rmkitcomp.1.pod b/xCAT-client/pods/man1/rmkitcomp.1.pod index 900556763..d9ba57b1d 100644 --- a/xCAT-client/pods/man1/rmkitcomp.1.pod +++ b/xCAT-client/pods/man1/rmkitcomp.1.pod @@ -48,7 +48,7 @@ osimage name that include this kit component. =item B -A comma-delimited list of valid full kit component names or kit component basenames that are to be removed from the osimage. +A comma-delimited list of valid full kit component names or kit component basenames that are to be removed from the osimage. If a basename is specified, all kitcomponents matching that basename will be removed from the osimage. =back diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index cb59fa0eb..9f2bedc9f 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -35,7 +35,7 @@ my $debianflag = 0; my $tempstring = xCAT::Utils->osver(); if ( $tempstring =~ /debian/ || $tempstring =~ /ubuntu/ ){ $debianflag = 1; - print "debian"; +# print "debian"; } #------------------------------------------------------- @@ -2489,6 +2489,7 @@ sub rmkitcomp } my %kitcomps; + my @remove_kitcomps_by_basename; my $des = shift @ARGV; my @kitcomponents = split ',', $des; foreach my $kitcomponent (@kitcomponents) { @@ -2519,19 +2520,22 @@ sub rmkitcomp xCAT::MsgUtils->message( "E", \%rsp, $callback ); return 1; } - - my $highest = get_highest_version('kitcompname', 'version', 'release', @entries); - $kitcomps{$highest}{name} = $highest; - (my $kitcomptable) = $tabs{kitcomponent}->getAttribs({kitcompname => $highest}, 'kitname', 'kitpkgdeps', 'prerequisite', 'postbootscripts', 'genimage_postinstall', 'kitreponame', 'exlist', 'basename', 'driverpacks'); - $kitcomps{$highest}{kitname} = $kitcomptable->{kitname}; - $kitcomps{$highest}{kitpkgdeps} = $kitcomptable->{kitpkgdeps}; - $kitcomps{$highest}{prerequisite} = $kitcomptable->{prerequisite}; - $kitcomps{$highest}{basename} = $kitcomptable->{basename}; - $kitcomps{$highest}{exlist} = $kitcomptable->{exlist}; - $kitcomps{$highest}{postbootscripts} = $kitcomptable->{postbootscripts}; - $kitcomps{$highest}{kitreponame} = $kitcomptable->{kitreponame}; - $kitcomps{$highest}{driverpacks} = $kitcomptable->{driverpacks}; - $kitcomps{$highest}{genimage_postinstall} = $kitcomptable->{genimage_postinstall}; + push (@remove_kitcomps_by_basename,$kitcomponent); + foreach $basename_entry (@entries) { + my $this_entry = $basename_entry->{kitcompname}; + $kitcomps{$this_entry}{name} = $this_entry; + (my $kitcomptable) = $tabs{kitcomponent}->getAttribs({kitcompname => $this_entry}, 'kitname', 'kitpkgdeps', 'prerequisite', 'postbootscripts', 'genimage_postinstall', 'kitreponame', 'exlist', 'basename', 'driverpacks'); + $kitcomps{$this_entry}{kitname} = $kitcomptable->{kitname}; + $kitcomps{$this_entry}{kitpkgdeps} = $kitcomptable->{kitpkgdeps}; + $kitcomps{$this_entry}{prerequisite} = $kitcomptable->{prerequisite}; + $kitcomps{$this_entry}{basename} = $kitcomptable->{basename}; + $kitcomps{$this_entry}{exlist} = $kitcomptable->{exlist}; + $kitcomps{$this_entry}{postbootscripts} = $kitcomptable->{postbootscripts}; + $kitcomps{$this_entry}{kitreponame} = $kitcomptable->{kitreponame}; + $kitcomps{$this_entry}{driverpacks} = $kitcomptable->{driverpacks}; + $kitcomps{$this_entry}{genimage_postinstall} = $kitcomptable->{genimage_postinstall}; + $kitcomps{$this_entry}{remove_by_basename} = '1'; + } } } # Check if the kitcomponents are existing in osimage.kitcomponents attribute. @@ -2559,13 +2563,35 @@ sub rmkitcomp my $invalidkitcomp = ''; foreach my $kitcomp ( keys %kitcomps) { if ( !$kitcomps{$kitcomp}{matched} ) { - if ( !$invalidkitcomp ) { - $invalidkitcomp = $kitcomp; + if ( $kitcomps{$kitcomp}{remove_by_basename} ) { + delete($kitcomps{$kitcomp}); } else { + if ( !$invalidkitcomp ) { + $invalidkitcomp = $kitcomp; + } else { $invalidkitcomp = join(',', $invalidkitcomp, $kitcomp); + } } } } + + foreach $basename_to_remove (@remove_kitcomps_by_basename) { + my $removing_at_least_one = 0; + foreach my $kitcomponent (keys %kitcomps) { + if ($basename_to_remove eq $kitcomps{$kitcomponent}{basename}) { + $removing_at_least_one = 1; + last; + } + } + if (!$removing_at_least_one) { + if ( !$invalidkitcomp ) { + $invalidkitcomp = $basename_to_remove; + } else { + $invalidkitcomp = join(',', $invalidkitcomp, $basename_to_remove); + } + } + } + if ( $invalidkitcomp ) { my %rsp; @@ -2574,6 +2600,7 @@ sub rmkitcomp return 1; } + # Now check if there is any other kitcomponent depending on this one. foreach my $kitcomponent (keys %kitcomps) { From b94dcb02e44a33b49a990f2c47d830a6745b3d4e Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 29 Oct 2014 00:54:58 -0700 Subject: [PATCH 65/93] fix defect #4326 [fvt]2.9:load config file failed if more than one mac during vm install --- perl-xCAT/xCAT/Utils.pm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index f8efb5dd0..5f37479b4 100755 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -4295,5 +4295,43 @@ sub cleanup_for_powerLE_hardware_discovery { } +#The parseMacTabEntry parses the mac table entry and return the mac address of nic in management network +#Arguments: +#macString : the string of mac table entry +#HostName : the hostname of the node +#The mac address is taken as installnic when: +#1. the mac addr does not have a suffix "!xxxx" +#2. the mac addr has a fuffix "!" +#The schema description of mac table is: +# mac: The mac address or addresses for which xCAT will manage static bindings for this node. +#This may be simply a mac address, which would be bound to the node name (such as "01:02:03:04:05:0E"). +#This may also be a "|" delimited string of "mac address!hostname" format (such as "01:02:03:04:05:0E!node5|01:02:03:05:0F!node6-eth1"). +sub parseMacTabEntry{ + + my $macString=shift; + if( $macString =~ /xCAT::Utils/) + { + $macString=shift; + + } + my $HostName=shift; + + my $mac_ret; + my @macEntry=split(/\|/,$macString); + + foreach my $mac_t (@macEntry){ + if($mac_t =~ /!/){ + if($mac_t =~ /(.+)!$HostName$/){ + $mac_ret=$1; + } + }else{ + $mac_ret=$mac_t; + } + } + + + return $mac_ret; +} + 1; From cd4c886ba182d0dd3757da3200ba24be6ed9090c Mon Sep 17 00:00:00 2001 From: ligc Date: Wed, 30 Oct 2013 14:55:32 +0800 Subject: [PATCH 66/93] fix for rcons problem with kvm on SLES 12 and on PowerKVM --- xCAT-server/share/xcat/cons/kvm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-server/share/xcat/cons/kvm b/xCAT-server/share/xcat/cons/kvm index da90b01b8..7d95cd3e4 100755 --- a/xCAT-server/share/xcat/cons/kvm +++ b/xCAT-server/share/xcat/cons/kvm @@ -75,6 +75,13 @@ until ($dsthost and $speed and $dstty) { exec "sleep $sleepint"; } release_lock(); +# The screen command needs the TERM env var, +# TERM might be empty for some unknown reasons, +# for example, on SLES 12 and on PowerKVM +if (!$ENV{'TERM'}) { + $ENV{'TERM'}="vt100"; +} + exec "ssh -t $dsthost screen -U -a -O -e ^]a -d -R -S serial-".$ARGV[0]."-cons -A $dstty $speed"; #my $pathtochild= dirname($scriptname). "/"; From f6d48a858b37650e72c1f4d2e135b159efb441a6 Mon Sep 17 00:00:00 2001 From: ligc Date: Wed, 30 Oct 2013 15:13:01 +0800 Subject: [PATCH 67/93] fix for bug 4333: add the powerkvm 2.1.1 disc info --- perl-xCAT/xCAT/data/discinfo.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 454beb213..1f637cfcb 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -100,6 +100,7 @@ require Exporter; "1390839789.062069" => "SL6.5", #x86_64 DVD ISO Install "1394111947.452332" => "pkvm2.1", # ppc64, PowerKVM + "1413749127.352649" => "pkvm2.1.1", # ppc64, PowerKVM ); my %numdiscs = ( "1156364963.862322" => 4, From 1c379b15900dbb37e9c149a616a99c39d3c83251 Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 29 Oct 2014 02:49:02 -0700 Subject: [PATCH 68/93] fix defect #4326 [fvt]2.9:load config file failed if more than one mac during vm install --- xCAT-server/lib/perl/xCAT/Template.pm | 8 ++++---- xCAT-server/lib/xcat/plugins/anaconda.pm | 10 +++++----- xCAT-server/lib/xcat/plugins/debian.pm | 4 ++-- xCAT-server/lib/xcat/plugins/rhevm.pm | 4 ++-- xCAT-server/lib/xcat/plugins/sles.pm | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 567efaff9..6852a0e27 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -473,7 +473,7 @@ sub windows_net_cfg { unless ($mactab) { die "mac table should always exist prior to template processing when doing autoula"; } my $ent = $mactab->getNodeAttribs($node,['mac'],prefetchcache=>1); unless ($ent and $ent->{mac}) { die "missing mac data for $node"; } - my $suffix = $ent->{mac}; + my $suffix = xCAT::Utils->parseMacTabEntry($ent->{mac},$node); my $mac = $suffix; $suffix = lc($suffix); $mac =~ s/:/-/g; @@ -665,7 +665,7 @@ sub esxipv6setup { my $hoststab; my $mactab = xCAT::Table->new('mac',-create=>0); my $ent = $mactab->getNodeAttribs($node,['mac'],prefetchcache=>1); - my $suffix = $ent->{mac}; + my $suffix = xCAT::Utils->parseMacTabEntry($ent->{mac},$node); $suffix = lc($suffix); unless ($mactab) { die "mac table should always exist prior to template processing when doing autoula"; } #in autoula, because ESXi weasel doesn't seemingly grok IPv6 at all, we'll have to do it in %pre @@ -693,7 +693,7 @@ sub kickstartnetwork { unless ($mactab) { $tmplerr ="mac table should always exist prior to template processing when doing autoula"; return;} my $ent = $mactab->getNodeAttribs($node,['mac'],prefetchcache=>1); unless ($ent and $ent->{mac}) { $tmplerr ="missing mac data for $node"; return;} - my $suffix = $ent->{mac}; + my $suffix = xCAT::Utils->parseMacTabEntry($ent->{mac},$node); $suffix = lc($suffix); if ($::XCATSITEVALS{managedaddressmode} eq "autoula") { unless ($hoststab) { $hoststab = xCAT::Table->new('hosts',-create=>1); } @@ -746,7 +746,7 @@ sub yast2network { unless ($mactab) { die "mac table should always exist prior to template processing when doing autoula"; } my $ent = $mactab->getNodeAttribs($node,['mac'],prefetchcache=>1); unless ($ent and $ent->{mac}) { die "missing mac data for $node"; } - my $suffix = $ent->{mac}; + my $suffix = xCAT::Utils->parseMacTabEntry($ent->{mac},$node); $suffix = lc($suffix); if ($::XCATSITEVALS{managedaddressmode} eq "autoula") { #TODO diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 033942f24..05d08fa2d 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1434,7 +1434,7 @@ sub mkinstall { my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $ksdev = $macref->{mac}; + $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } else { @@ -1447,7 +1447,7 @@ sub mkinstall { my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $ksdev = $macref->{mac}; + $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } else { @@ -1896,7 +1896,7 @@ sub mksysclone { my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $ksdev = $macref->{mac}; + $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } else { @@ -1909,7 +1909,7 @@ sub mksysclone { my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $ksdev = $macref->{mac}; + $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } else { @@ -1963,7 +1963,7 @@ sub mksysclone if ($archref->{arch} eq "ppc64"){ my $mactab = xCAT::Table->new('mac'); my $macref = $mactab->getNodeAttribs($node, ['mac']); - my $formatmac = $macref->{mac}; + my $formatmac = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); $formatmac =~ s/:/-/g; $formatmac = "01-".$formatmac; $kcmdline .= " BOOTIF=$formatmac "; diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 62cc32abd..7318d415a 100755 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -812,7 +812,7 @@ sub mkinstall if ($ent->{installnic} eq "mac"){ my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $ksdev = $macref->{mac}; + $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } else{ $ksdev = $ent->{installnic}; @@ -822,7 +822,7 @@ sub mkinstall if ($ent->{primarynic} eq "mac"){ my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $ksdev = $macref->{mac}; + $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } else{ $ksdev = $ent->{primarynic}; diff --git a/xCAT-server/lib/xcat/plugins/rhevm.pm b/xCAT-server/lib/xcat/plugins/rhevm.pm index b63a602a3..657c36a3d 100644 --- a/xCAT-server/lib/xcat/plugins/rhevm.pm +++ b/xCAT-server/lib/xcat/plugins/rhevm.pm @@ -579,7 +579,7 @@ sub mkinstall { if ($ent->{installnic} eq "mac") { my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $ksdev = $macref->{mac}; + $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } else { $ksdev = $ent->{installnic}; } @@ -587,7 +587,7 @@ sub mkinstall { if ($ent->{primarynic} eq "mac") { my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $ksdev = $macref->{mac}; + $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } else { $ksdev = $ent->{primarynic}; } diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index ce22e536c..32552732e 100755 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -582,7 +582,7 @@ sub mknetboot # add the kernel-booting parameter: netdev=, or BOOTIF= my $netdev = ""; - my $mac = $machash->{$node}->[0]->{mac}; + my $mac = xCAT::Utils->parseMacTabEntry($machash->{$node}->[0]->{mac},$node); if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic} and ($reshash->{$node}->[0]->{installnic} ne "mac")) { $kcmdline .= "netdev=" . $reshash->{$node}->[0]->{installnic} . " "; @@ -1115,7 +1115,7 @@ sub mkinstall { my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $netdev = $macref->{mac}; + $netdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } else { @@ -1128,7 +1128,7 @@ sub mkinstall { my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $netdev = $macref->{mac}; + $netdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } else { @@ -1463,7 +1463,7 @@ sub mksysclone { my $mactab = xCAT::Table->new("mac"); my $macref = $mactab->getNodeAttribs($node, ['mac']); - $ksdev = $macref->{mac}; + $ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); } unless ( $ksdev eq "bootif" ) { @@ -1498,7 +1498,7 @@ sub mksysclone if ($archref->{arch} eq "ppc64"){ my $mactab = xCAT::Table->new('mac'); my $macref = $mactab->getNodeAttribs($node, ['mac']); - my $formatmac = $macref->{mac}; + my $formatmac = xCAT::Utils->parseMacTabEntry($macref->{mac},$node); $formatmac =~ s/:/-/g; $formatmac = "01-".$formatmac; $kcmdline .= " BOOTIF=$formatmac "; From dff4cad29f8d3465638a52083b5001ec3074beff Mon Sep 17 00:00:00 2001 From: baiyuan Date: Wed, 29 Oct 2014 05:14:53 -0400 Subject: [PATCH 69/93] fix defect 3847 buildkit addpkgs -k -r left useless kit component rpm in complete kit repos dir --- xCAT-buildkit/bin/buildkit | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index c9c4b6d13..08d3e51e5 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -3892,6 +3892,47 @@ sub NEW_kit_addpkgs } } + + #When using -k -r, there are useless repodir + #delete useless repo dir + my $kitrepodirby=$::base_repodir; + my $cmdby = "/bin/ls $kitrepodirby 2>/dev/null"; + my $outputby = `$cmdby`; + my @allrepolist = split(/\n/, $outputby); + my @dellist; + + foreach my $reponame (@allrepolist) + { + my $match=0; + foreach my $kr (@{$::bldkit_config->{kitrepo}{entries}}) + { + my $repodirname = "$kr->{kitreponame}"; + + if ( ${repodirname} eq ${reponame} ) + { + ${match}++; + } + } + if ( ${match} == 0 ) + { + push(@dellist,$reponame); + } + } + + foreach my $del (@dellist) + { + my $delrepodir=$::base_repodir."/".$del ; + if ( -d $delrepodir ) + { + my $delcmd="rm -Rf $delrepodir"; + if ( system($delcmd) ) + { + print "Failed to delete useless repo directory \n"; + } + } + } + + # Build the full kit tar file my $buildtar_rc = &kit_buildtar; From 0b35d9edd78a53eaba36554e1f79cea8651edf52 Mon Sep 17 00:00:00 2001 From: mellor Date: Wed, 29 Oct 2014 10:41:13 -0400 Subject: [PATCH 70/93] defect 4335 - remove confluent.pm and kit.pm from AIX builds --- xCAT-server/xCAT-server.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 5ecaca236..810109b66 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -176,6 +176,8 @@ rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/xen.pm rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/kvm.pm rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/vbox.pm rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/activedirectory.pm +rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/kit.pm +rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/confluent.pm %endif cp lib/xcat/dsh/Context/* $RPM_BUILD_ROOT/%{prefix}/xdsh/Context From f101f97df40ed3565920206bd7c04e8f28912c78 Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 31 Oct 2013 13:23:19 +0800 Subject: [PATCH 71/93] fix for defect 4337, add TERM into the systemd through systemctl import-environment TERM --- xCAT-server/sbin/xcatconfig | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 088388a3b..b504063cd 100755 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -404,9 +404,18 @@ if ($::INITIALINSTALL || $::FORCE || $::UPDATEINSTALL) verbose("syslog has been set up."); } } - - -# +# The systemd only has LANG and PATH as default environmental variables, +# TERM is needed for KVM consoles(actually screen command needs TERM) +# import the TERM into systemd +if ( -d "/usr/lib/systemd/system" ) { + my $cmd = "systemctl import-environment TERM"; + xCAT::Utils->runcmd("$cmd", 0); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->message('E', "Could not import TERM into systemd."); + } else { + verbose("Imported TERM=$ENV{'TERM'} into systemd."); + } +} # # start xcatd From 2170c7196f1521de62d7ac30706e7ebfbf417858 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Mon, 3 Nov 2014 07:13:53 -0800 Subject: [PATCH 72/93] defect 4303 arrange lskit options --- xCAT-server/lib/xcat/plugins/kit.pm | 113 +++++++++++++++++++++------- 1 file changed, 84 insertions(+), 29 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 18b094f61..149c498af 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -4256,6 +4256,8 @@ sub lskit { my $kitrepo_hash = get_kitrepo_hash($::kitnames, $::kitrepoattrs); my $kitcomp_hash = get_kitcomp_hash($::kitnames, $::kitcompattrs); + + # Now display the output my @kitnames = keys(%$kit_hash); if (scalar @kitnames == 0) { @@ -4264,43 +4266,51 @@ sub lskit { xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); return 0; } + if ( defined($::opt_K) || defined($::opt_R) || defined($::opt_C) ) { + if ( ! defined($::opt_x)) { + if ( defined($::opt_K) ){ + lskit_K($kit_hash); + } - # Option -R for kit repo attributes - if ( defined($::opt_R) ) { + # Option -R for kit repo attributes + if ( defined($::opt_R) ) { + my @kitrepos = keys(%$kitrepo_hash); + if (scalar @kitrepos == 0) { + my $rsp = {}; + push @{ $rsp->{data} }, "No kit repos were found."; + xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); + return 0; + } + lskit_R($kit_hash,$kitrepo_hash); + } - my @kitrepos = keys(%$kitrepo_hash); - if (scalar @kitrepos == 0) { - my $rsp = {}; - push @{ $rsp->{data} }, "No kit repos were found."; - xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); - return 0; + if ( defined($::opt_C) ) { + my @kitcomplist = keys(%$kitcomp_hash); + if (scalar @kitcomplist == 0) { + my $rsp = {}; + push @{ $rsp->{data} }, "No kit components were found."; + xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); + return 0; + } + lskit_C($kit_hash,$kitcomp_hash); + } + }else + { + create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash); } - lskit_R($kit_hash,$kitrepo_hash); - return 0; } - - if ( defined($::opt_C) ) { - - my @kitcomplist = keys(%$kitcomp_hash); - if (scalar @kitcomplist == 0) { - my $rsp = {}; - push @{ $rsp->{data} }, "No kit components were found."; - xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); - return 0; - } - lskit_C($kit_hash,$kitcomp_hash); - return 0; - } - - - if (defined($::opt_x)) { - create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash); - } else { - create_lskit_stanza_response($kit_hash, $kitrepo_hash, $kitcomp_hash); + else + { + if (defined($::opt_x)) { + create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash); + } else { + create_lskit_stanza_response($kit_hash, $kitrepo_hash, $kitcomp_hash); + } } return 0; } + #---------------------------------------------------------------------------- =head3 lskit_R @@ -4346,6 +4356,51 @@ sub lskit_R { xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); +} + + +#---------------------------------------------------------------------------- + +=head3 lskit_K + + Support for listing kit + + Arguments: + Returns: + 0 - OK + 1 - help + 2 - error +=cut + +#----------------------------------------------------------------------------- + +sub lskit_K { + + my $kit_hash = shift; + my $rsp = {}; + my $count = 0; + + + for my $kitname (sort(keys(%$kit_hash))) { + + my $output .= "\nkit : $kitname\n----------------------------------------------------\n"; + # Kit info + if (defined($kit_hash->{$kitname})) { + my $kit = $kit_hash->{$kitname}->[0]; + $output .= "kit:\n"; + for my $kit_attr (sort(keys(%$kit))) { + $output .= sprintf(" %s=%s\n", $kit_attr, $kit->{$kit_attr}); + } + $output .= "\n"; + } + + + push @{ $rsp->{data} }, $output; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); + + } #---------------------------------------------------------------------------- From da874a91f2a1dd49939f5b26ace6746431ce98a2 Mon Sep 17 00:00:00 2001 From: ligc Date: Mon, 4 Nov 2013 15:42:23 +0800 Subject: [PATCH 73/93] fix for bug 4347: lsvpd does not output the word 'cpu' on Ubuntu LE, it outputs 'processor' instead --- xCAT/postscripts/xcatdsklspost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index c9ac442bc..e279b9b89 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -29,7 +29,7 @@ update_VPD() # Run updatevpd only when necessary if [ -f /usr/sbin/lsvpd ]; then - /usr/sbin/lsvpd | grep -i cpu 2>&1 1>/dev/null + /usr/sbin/lsvpd | grep -i -E 'cpu|processor' 2>&1 1>/dev/null if [ "$?" = "1" ]; then update_VPD fi From aa0f63c2b7492dd33e680c24cdbba64cc39af1f7 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Thu, 30 Oct 2014 03:24:58 -0400 Subject: [PATCH 74/93] fix bug 4340:could not do diskless install on p8le vm --- xCAT-server/lib/xcat/plugins/debian.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 7318d415a..5d9d59a90 100755 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -1437,9 +1437,9 @@ sub mknetboot #} # append the mac address my $mac; - if( !$useifname && $machash->{$node}->[0] && $machash->{$node}->[0]->{'mac'}) { + if( $machash->{$node}->[0] && $machash->{$node}->[0]->{'mac'}) { # TODO: currently, only "mac" attribute with classic style is used, the "|" delimited string of "macaddress!hostname" format is not used - $mac = $machash->{$node}->[0]->{'mac'}; + $mac = xCAT::Utils->parseMacTabEntry($machash->{$node}->[0]->{'mac'},$node); # if ( (index($mac, "|") eq -1) and (index($mac, "!") eq -1) ) { #convert to linux format if ($mac !~ /:/) { @@ -1451,9 +1451,9 @@ sub mknetboot # } } - #if ($useifname && $mac) { - # $kcmdline .= "$mac "; - #} + if ($useifname && $mac) { + $kcmdline .= "$mac "; + } # add "netdev=" or "BOOTIF=" # which are used for other scenarios From 9539644ca195c4897b2892d4b94b9a15a98a5802 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Thu, 30 Oct 2014 08:36:47 -0400 Subject: [PATCH 75/93] fix 4344 kit repo lose mount after xcat MN reboot in ubuntu --- xCAT-server/lib/xcat/plugins/kit.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 9f2bedc9f..e3e96804b 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -586,10 +586,10 @@ sub assign_to_osimage { unless ( -d "$otherpkgdir/$kitcomptable->{kitreponame}" ) { - system("mkdir -p $otherpkgdir/$kitcomptable->{kitreponame}"); - print "mkdir -p $otherpkgdir/$kitcomptable->{kitreponame}"; - system("mount -o ro --bind $kitrepodir $otherpkgdir/$kitcomptable->{kitreponame}"); - print "mount --bind $kitrepodir $otherpkgdir/$kitcomptable->{kitreponame}"; + # system("mkdir -p $otherpkgdir/$kitcomptable->{kitreponame}"); + # print "mkdir -p $otherpkgdir/$kitcomptable->{kitreponame}"; + system("cp -Rf $kitrepodir $otherpkgdir/"); + print "cp -Rf $kitrepodir $otherpkgdir/"; } } else From 6b040b23f744f93445a35aef03bf1bbf67402c47 Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 30 Oct 2014 08:49:19 -0400 Subject: [PATCH 76/93] fix defect 4343 --- xCAT-client/bin/mysqlsetup | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 2e9f48fe2..0947a4688 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -883,8 +883,11 @@ sub mysqlstart else { if ($::MariaDB==1) { # running MariaDB - #$cmd = "service mariadb start"; - $ret=xCAT::Utils->startservice("mariadb"); + if ($::linuxos =~ /rh.*/) { + $ret=xCAT::Utils->startservice("mariadb"); + } else { # sles + $ret=xCAT::Utils->startservice("mysql"); + } } else { # it is mysql @@ -993,7 +996,11 @@ sub mysqlreboot { if ($::MariaDB==1 ) { # MariaDB not MySQL + if ($::linuxos =~ /rh.*/) { $cmd = "chkconfig mariadb on"; + } else { #sles + $cmd = "chkconfig mysql on"; + } } else { # mysql if ($::linuxos =~ /rh.*/) { From ec1ef81ea8f44807c07118872aabb43372907972 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Fri, 31 Oct 2014 04:40:09 -0400 Subject: [PATCH 77/93] fix defect 4349 [dev]after rmkit/rmkitcomp -i kitcomp list, kitrepo dir in otherpkgdir is not deleted --- xCAT-server/lib/xcat/plugins/kit.pm | 58 ++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index e3e96804b..c8f08846e 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -2776,7 +2776,9 @@ sub rmkitcomp if ( !$match ) { if ( $debianflag ) { - system("umount -f $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame}"); + #Now we do not use moun --bind for kitrepo dir to otherpkgdir + #leave this line is support old way when using mount + system("umount -f $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame} > /dev/null"); } system("rm -rf $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame}"); } @@ -3249,6 +3251,60 @@ sub rmkitcomp # Write osimage table with all the above udpates. $tabs{osimage}->setAttribs({imagename => $osimage }, \%{$osimagetable} ); + #After all the data updated in osimage and linuximage table + #check if these kitcomponents are assigned to other osimage + #if these kitcomponents are not used by other osimage, find their kitrepo and kitrepo directory under otherpkg dir + #delete these kitrepo + my @allosikitcomps = $tabs{osimage}->getAllAttribs( 'imagename', 'kitcomponents' ); + + (my $linuximagetable) = $tabs{linuximage}->getAttribs({imagename=> $osimage}, 'postinstall', 'exlist', 'otherpkglist', 'otherpkgdir', 'driverupdatesrc'); + if ( $linuximagetable and $linuximagetable->{otherpkgdir} ) { + + my $otherpkgdir = $linuximagetable->{otherpkgdir}; + foreach my $kitcomponent (keys %kitcomps) { + + my %newosikitcomponents; + foreach my $allosikitcomp (@allosikitcomps) { + if ( $allosikitcomp->{kitcomponents} and $allosikitcomp->{imagename} ) { + my @allkitcomps = split /,/, $allosikitcomp->{kitcomponents}; + foreach my $allkitcomp ( @allkitcomps ) { + if ( $allosikitcomp->{imagename} ne $osimage or $allkitcomp ne $kitcomponent ) { + $newosikitcomponents{$allkitcomp} = 1; + } + } + } + } + + if ( $kitcomps{$kitcomponent}{kitreponame} ) { + if ( -d "$otherpkgdir/$kitcomps{$kitcomponent}{kitreponame}" ) { + + # Check if this repo is used by other kitcomponent before removing the link + my $match = 0; + foreach my $osikitcomp ( keys %newosikitcomponents ) { + + my $depkitrepodir; + (my $kitcomptable) = $tabs{kitcomponent}->getAttribs({kitcompname => $osikitcomp}, 'kitreponame'); + if ( $kitcomptable and $kitcomptable->{kitreponame} ) { + $depkitrepodir = "$otherpkgdir/$kitcomptable->{kitreponame}"; + } + if ( $depkitrepodir =~ /^$otherpkgdir\/$kitcomps{$kitcomponent}{kitreponame}$/) { + $match = 1; + } + } + if ( !$match ) { + if ( $debianflag ) + { + system("umount -f $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame} > /dev/null"); + } + system("rm -rf $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame}"); + } + } + } + } + } + + + return; } From 9ba2726f83ff7fb388cba0f2f8157fdf00fbac0c Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 31 Oct 2014 02:43:22 -0700 Subject: [PATCH 78/93] add conf support for apache2.4 --- xCAT-server/xCAT-server.spec | 52 ++++++++++++++----- ...-ws.conf.apache2 => xcat-ws.conf.apache24} | 3 +- xCAT-server/xCAT-wsapi/xcat-ws.conf.httpd | 4 -- 3 files changed, 40 insertions(+), 19 deletions(-) rename xCAT-server/xCAT-wsapi/{xcat-ws.conf.apache2 => xcat-ws.conf.apache24} (85%) delete mode 100644 xCAT-server/xCAT-wsapi/xcat-ws.conf.httpd diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 810109b66..7320448a2 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -328,6 +328,8 @@ chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-server/* mkdir -p $RPM_BUILD_ROOT/%{prefix}/ws mkdir -p $RPM_BUILD_ROOT/etc/apache2/conf.d mkdir -p $RPM_BUILD_ROOT/etc/httpd/conf.d +mkdir -p $RPM_BUILD_ROOT/etc/xcat/conf.orig + cp xCAT-wsapi/* $RPM_BUILD_ROOT/%{prefix}/ws # PCM does not need xcatws.cgi @@ -338,20 +340,24 @@ rm -f $RPM_BUILD_ROOT/%{prefix}/ws/xcatws.cgi %if %fsm %else -echo "ScriptAlias /xcatrhevh %{prefix}/ws/xcatrhevh.cgi" > $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat-ws.conf +echo "ScriptAlias /xcatrhevh %{prefix}/ws/xcatrhevh.cgi" > $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 +echo "ScriptAlias /xcatrhevh %{prefix}/ws/xcatrhevh.cgi" > $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache24 %if %notpcm -echo "ScriptAlias /xcatws %{prefix}/ws/xcatws.cgi" >> $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat-ws.conf +echo "ScriptAlias /xcatws %{prefix}/ws/xcatws.cgi" >> $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 +echo "ScriptAlias /xcatws %{prefix}/ws/xcatws.cgi" >> $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache24 %endif -cat $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.apache2 >> $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat-ws.conf -echo "ScriptAlias /xcatrhevh %{prefix}/ws/xcatrhevh.cgi" > $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat-ws.conf -%if %notpcm -echo "ScriptAlias /xcatws %{prefix}/ws/xcatws.cgi" >> $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat-ws.conf +cat $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.apache22 >> $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 +cat $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.apache24 >> $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache24 +#install lower version(<2.4) apache/httpd conf files by default +cp $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat-ws.conf +cp $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat-ws.conf %endif -cat $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.httpd >> $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat-ws.conf -%endif -rm -f $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.apache2 -rm -f $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.httpd + + + +rm -f $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.apache22 +rm -f $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.apache24 %clean rm -rf $RPM_BUILD_ROOT @@ -364,6 +370,8 @@ rm -rf $RPM_BUILD_ROOT %if %fsm %else /etc/init.d/xcatd +#/etc/xcat/conf.orig/xcat-ws.conf.apache24 +#/etc/xcat/conf.orig/xcat-ws.conf.apache22 /etc/apache2/conf.d/xcat-ws.conf /etc/httpd/conf.d/xcat-ws.conf %endif @@ -409,8 +417,8 @@ fi if [ "$1" -gt "1" ]; then #only on upgrade... #migration issue for monitoring XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/chtab filename=monitorctrl.pm notification -d - fi + %else if [ "$1" -gt "1" ]; then #only on upgrade for AIX... #migration issue for monitoring @@ -420,6 +428,26 @@ fi %endif +#Apply the correct httpd/apache configuration file according to the httpd/apache version +if [ -n "$(httpd -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ] +then + rm -rf /etc/httpd/conf.d/xcat-ws.conf + cp /etc/xcat/conf.orig/xcat-ws.conf.apache24 /etc/httpd/conf.d/xcat-ws.conf +fi + +if [ -n "$(apachectl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ] +then + rm -rf /etc/apache2/conf.d/xcat-ws.conf + cp /etc/xcat/conf.orig/xcat-ws.conf.apache24 /etc/apache2/conf.d/xcat-ws.conf +fi + +if [ -n "$(apache2ctl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ] +then + rm -rf /etc/apache2/conf.d/xcat-ws.conf + cp /etc/xcat/conf.orig/xcat-ws.conf.apache24 /etc/apache2/conf.d/xcat-ws.conf +fi + + exit 0 %preun @@ -435,8 +463,6 @@ if [ $1 == 0 ]; then #This means only on -e fi rm -f /usr/sbin/xcatd #remove the symbolic - rm -f /etc/httpd/conf.d/xcat-ws.conf - rm -f /etc/httpd/conf.d/xcat-ws.conf fi %endif diff --git a/xCAT-server/xCAT-wsapi/xcat-ws.conf.apache2 b/xCAT-server/xCAT-wsapi/xcat-ws.conf.apache24 similarity index 85% rename from xCAT-server/xCAT-wsapi/xcat-ws.conf.apache2 rename to xCAT-server/xCAT-wsapi/xcat-ws.conf.apache24 index 8e7326c59..b10ccf224 100644 --- a/xCAT-server/xCAT-wsapi/xcat-ws.conf.apache2 +++ b/xCAT-server/xCAT-wsapi/xcat-ws.conf.apache24 @@ -5,7 +5,6 @@ RewriteCond %{REQUEST_URI} xcatws RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R,L] - Order allow,deny - Allow from all +Require all granted diff --git a/xCAT-server/xCAT-wsapi/xcat-ws.conf.httpd b/xCAT-server/xCAT-wsapi/xcat-ws.conf.httpd deleted file mode 100644 index 921735e12..000000000 --- a/xCAT-server/xCAT-wsapi/xcat-ws.conf.httpd +++ /dev/null @@ -1,4 +0,0 @@ -RewriteEngine On -RewriteCond %{SERVER_PORT} 80 -RewriteCond %{REQUEST_URI} xcatws -RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R,L] From b6c35465dc7b10911c8a90eb96e73c0aa590cf97 Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 31 Oct 2014 02:48:33 -0700 Subject: [PATCH 79/93] update configuration file for apache2.4 on sles12 --- xCAT/xCAT.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index e418e8b92..4593a7bd4 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -184,6 +184,11 @@ then cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/apache2/conf.d/xcat.conf fi +if [ -n "$(apache2ctl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ] +then + rm -rf /etc/apache2/conf.d/xcat.conf + cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/apache2/conf.d/xcat.conf +fi %endif From dd63773ee8048d3decaa39d0be8fb686d1d24c8e Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 31 Oct 2014 03:12:25 -0700 Subject: [PATCH 80/93] dd conf support for apache2.4:create a new file xcat-ws.conf.apache22 --- xCAT-server/xCAT-wsapi/xcat-ws.conf.apache22 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 xCAT-server/xCAT-wsapi/xcat-ws.conf.apache22 diff --git a/xCAT-server/xCAT-wsapi/xcat-ws.conf.apache22 b/xCAT-server/xCAT-wsapi/xcat-ws.conf.apache22 new file mode 100644 index 000000000..8e7326c59 --- /dev/null +++ b/xCAT-server/xCAT-wsapi/xcat-ws.conf.apache22 @@ -0,0 +1,11 @@ +LoadModule rewrite_module /usr/lib64/apache2-prefork/mod_rewrite.so +RewriteEngine On +RewriteCond %{SERVER_PORT} 80 +RewriteCond %{REQUEST_URI} xcatws +RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R,L] + + + Order allow,deny + Allow from all + + From 5c9bd40b1fa53ef139f22eadb488d40a10b90078 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 3 Nov 2014 00:08:49 -0500 Subject: [PATCH 81/93] defect4303 --- add -R support for lskit --- xCAT-server/lib/xcat/plugins/kit.pm | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index c8f08846e..14a88d625 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -4265,6 +4265,20 @@ sub lskit { return 0; } + # Option -R for kit repo attributes + if ( defined($::opt_R) ) { + + my @kitrepos = keys(%$kitrepo_hash); + if (scalar @kitrepos == 0) { + my $rsp = {}; + push @{ $rsp->{data} }, "No kit repos were found."; + xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); + return 0; + } + lskit_R($kit_hash,$kitrepo_hash); + return 0; + } + if (defined($::opt_x)) { create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash); } else { @@ -4273,6 +4287,54 @@ sub lskit { return 0; } +#---------------------------------------------------------------------------- + +=head3 lskit_R + + Support for listing kit repo + + Arguments: + Returns: + 0 - OK + 1 - help + 2 - error +=cut + +#----------------------------------------------------------------------------- + +sub lskit_R { + + my $kit_hash = shift; + my $kitrepo_hash = shift; + my $rsp = {}; + my $count = 0; + + + for my $kitname (sort(keys(%$kit_hash))) { + + my $output .= "\nkit : $kitname\n----------------------------------------------------\n"; + + + # Kit repository info + if (defined($kitrepo_hash->{$kitname})) { + for my $kitrepo (@{$kitrepo_hash->{$kitname}}) { + $output .= "kitrepo:\n"; + for my $kitrepo_attr (sort(keys(%$kitrepo))) { + $output .= sprintf(" %s=%s\n", $kitrepo_attr, $kitrepo->{$kitrepo_attr}); + } + $output .= "\n"; + } + } + + push @{ $rsp->{data} }, $output; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); + + +} + + #---------------------------------------------------------------------------- From 943b31d0ffd2baef5bcf0c1c08fda463005d18dc Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 3 Nov 2014 00:40:30 -0500 Subject: [PATCH 82/93] defect4303 --- add -C support for lskit --- xCAT-server/lib/xcat/plugins/kit.pm | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 14a88d625..18b094f61 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -4279,6 +4279,20 @@ sub lskit { return 0; } + if ( defined($::opt_C) ) { + + my @kitcomplist = keys(%$kitcomp_hash); + if (scalar @kitcomplist == 0) { + my $rsp = {}; + push @{ $rsp->{data} }, "No kit components were found."; + xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); + return 0; + } + lskit_C($kit_hash,$kitcomp_hash); + return 0; + } + + if (defined($::opt_x)) { create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash); } else { @@ -4334,6 +4348,53 @@ sub lskit_R { } +#---------------------------------------------------------------------------- + +=head3 lskit_C + + Support for listing kitcomponent + + Arguments: + Returns: + 0 - OK + 1 - help + 2 - error +=cut + +#----------------------------------------------------------------------------- + +sub lskit_C { + + my $kit_hash = shift; + my $kitcomp_hash = shift; + my $rsp = {}; + my $count = 0; + + + for my $kitname (sort(keys(%$kit_hash))) { + + my $output .= "\nkit : $kitname\n----------------------------------------------------\n"; + + + # Kit component info + if (defined($kitcomp_hash->{$kitname})) { + for my $kitcomp (@{$kitcomp_hash->{$kitname}}) { + $output .= "kitcomponent:\n"; + for my $kitcomp_attr (sort(keys(%$kitcomp))) { + $output .= sprintf(" %s=%s\n", $kitcomp_attr, $kitcomp->{$kitcomp_attr}); + } + $output .= "\n"; + } + } + + + push @{ $rsp->{data} }, $output; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); + + +} #---------------------------------------------------------------------------- From c8426f9f432f925de5ae76f15b0ba44942e321ab Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 3 Nov 2014 03:34:33 -0500 Subject: [PATCH 83/93] pick up ligc fix for bug 4347: lsvpd does not output the word 'cpu' on Ubuntu LE --- xCAT/postscripts/xcatdsklspost | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index c9ac442bc..e279b9b89 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -29,7 +29,7 @@ update_VPD() # Run updatevpd only when necessary if [ -f /usr/sbin/lsvpd ]; then - /usr/sbin/lsvpd | grep -i cpu 2>&1 1>/dev/null + /usr/sbin/lsvpd | grep -i -E 'cpu|processor' 2>&1 1>/dev/null if [ "$?" = "1" ]; then update_VPD fi From 47c91ef186e918cb6cbbe5724b35e05a49683fb9 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Mon, 3 Nov 2014 07:48:57 -0800 Subject: [PATCH 84/93] defect lskit to support seperate -R -C as xml format --- xCAT-server/lib/xcat/plugins/kit.pm | 177 ++++++++++++++++++++++++---- 1 file changed, 151 insertions(+), 26 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 149c498af..a3cead27e 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -4267,36 +4267,45 @@ sub lskit { return 0; } if ( defined($::opt_K) || defined($::opt_R) || defined($::opt_C) ) { - if ( ! defined($::opt_x)) { - if ( defined($::opt_K) ){ - lskit_K($kit_hash); - } - # Option -R for kit repo attributes - if ( defined($::opt_R) ) { - my @kitrepos = keys(%$kitrepo_hash); - if (scalar @kitrepos == 0) { - my $rsp = {}; - push @{ $rsp->{data} }, "No kit repos were found."; - xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); - return 0; - } - lskit_R($kit_hash,$kitrepo_hash); - } - - if ( defined($::opt_C) ) { - my @kitcomplist = keys(%$kitcomp_hash); - if (scalar @kitcomplist == 0) { - my $rsp = {}; - push @{ $rsp->{data} }, "No kit components were found."; - xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); - return 0; + if ( ! defined($::opt_x)) { + if ( defined($::opt_K) ){ + lskit_K($kit_hash); } - lskit_C($kit_hash,$kitcomp_hash); - } + + # Option -R for kit repo attributes + if ( defined($::opt_R) ) { + my @kitrepos = keys(%$kitrepo_hash); + if (scalar @kitrepos == 0) { + my $rsp = {}; + push @{ $rsp->{data} }, "No kit repos were found."; + xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); + return 0; + } + lskit_R($kit_hash,$kitrepo_hash); + } + + if ( defined($::opt_C) ) { + my @kitcomplist = keys(%$kitcomp_hash); + if (scalar @kitcomplist == 0) { + my $rsp = {}; + push @{ $rsp->{data} }, "No kit components were found."; + xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); + return 0; + } + lskit_C($kit_hash,$kitcomp_hash); + } }else { - create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash); + if (defined($::opt_K)) { + create_lskit_K_xml_response($kit_hash); + } + if (defined($::opt_R)) { + create_lskit_R_xml_response($kit_hash,$kitrepo_hash); + } + if (defined($::opt_C)) { + create_lskit_C_xml_response($kit_hash,$kitcomp_hash); + } } } else @@ -5114,6 +5123,122 @@ sub create_lskit_xml_response { } +#---------------------------------------------------------------------------- + +=head3 create_lskit_K_xml_response + + Prepare a response that returns the kit info in XML format. + + Arguments: + kit hash table + + Note: Hash tables are created by create_hash_from_table_rows() +=cut + +#----------------------------------------------------------------------------- + +sub create_lskit_K_xml_response { + + my $kit_hash = shift; + + my $rsp = {}; + + for my $kitname (sort(keys(%$kit_hash))) { + my $output_hash = {"kitinfo" => {"kit" => [], "kitrepo" => [], "kitcomponent" => [] } }; + + # Kit info + if (defined($kit_hash->{$kitname})) { + my $kit = $kit_hash->{$kitname}->[0]; + push(@{$output_hash->{kitinfo}->{kit}}, $kit); + } + + push @{ $rsp->{data} }, $output_hash; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); +} + +#---------------------------------------------------------------------------- + +=head3 create_lskit_R_xml_response + + Prepare a response that returns the kit repository + info in XML format. + + Arguments: + kit repo hash table + + Note: Hash tables are created by create_hash_from_table_rows() +=cut + +#----------------------------------------------------------------------------- + +sub create_lskit_R_xml_response { + + my $kit_hash = shift; + my $kitrepo_hash = shift; + + my $rsp = {}; + + for my $kitname (sort(keys(%$kit_hash))) { + my $output_hash = {"kitinfo" => {"kit" => [], "kitrepo" => [], "kitcomponent" => [] } }; + + # Kit repository info + if (defined($kitrepo_hash->{$kitname})) { + for my $kitrepo (@{$kitrepo_hash->{$kitname}}) { + push(@{$output_hash->{kitinfo}->{kitrepo}}, $kitrepo); + } + } + + push @{ $rsp->{data} }, $output_hash; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); +} + + +#---------------------------------------------------------------------------- + +=head3 create_lskit_C_xml_response + + Prepare a response that returns the + kit component info in XML format. + + Arguments: + kit hash table + kit component hash table + + Note: Hash tables are created by create_hash_from_table_rows() +=cut + +#----------------------------------------------------------------------------- + +sub create_lskit_C_xml_response { + + my $kit_hash = shift; + my $kitcomp_hash = shift; + + my $rsp = {}; + + for my $kitname (sort(keys(%$kit_hash))) { + my $output_hash = {"kitinfo" => {"kit" => [], "kitrepo" => [], "kitcomponent" => [] } }; + + + # Kit component info + if (defined($kitcomp_hash->{$kitname})) { + for my $kitcomp (@{$kitcomp_hash->{$kitname}}) { + push(@{$output_hash->{kitinfo}->{kitcomp}}, $kitcomp); + } + } + + push @{ $rsp->{data} }, $output_hash; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); +} + + + #---------------------------------------------------------------------------- =head3 create_lskit_stanza_response From 852fc3c1647874805f22f24055f002a3c98dff32 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 3 Nov 2014 03:49:19 -0500 Subject: [PATCH 85/93] back to original kit.pm --- xCAT-server/lib/xcat/plugins/kit.pm | 321 +--------------------------- 1 file changed, 9 insertions(+), 312 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index a3cead27e..5db77268f 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -2651,10 +2651,12 @@ sub rmkitcomp # Remove each kitcomponent from osimage. my @newosikitcomps; + my @myoskitcomps; foreach my $osikitcomp ( @osikitcomps ) { my $match = 0; foreach my $kitcomponent (keys %kitcomps) { if ( $kitcomponent eq $osikitcomp ) { + push @myoskitcomps, $osikitcomp; $match = 1; last; } @@ -2776,8 +2778,6 @@ sub rmkitcomp if ( !$match ) { if ( $debianflag ) { - #Now we do not use moun --bind for kitrepo dir to otherpkgdir - #leave this line is support old way when using mount system("umount -f $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame} > /dev/null"); } system("rm -rf $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame}"); @@ -3251,6 +3251,7 @@ sub rmkitcomp # Write osimage table with all the above udpates. $tabs{osimage}->setAttribs({imagename => $osimage }, \%{$osimagetable} ); + #After all the data updated in osimage and linuximage table #check if these kitcomponents are assigned to other osimage #if these kitcomponents are not used by other osimage, find their kitrepo and kitrepo directory under otherpkg dir @@ -3301,9 +3302,8 @@ sub rmkitcomp } } } - } - - + } + return; } @@ -4256,8 +4256,6 @@ sub lskit { my $kitrepo_hash = get_kitrepo_hash($::kitnames, $::kitrepoattrs); my $kitcomp_hash = get_kitcomp_hash($::kitnames, $::kitcompattrs); - - # Now display the output my @kitnames = keys(%$kit_hash); if (scalar @kitnames == 0) { @@ -4266,201 +4264,16 @@ sub lskit { xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); return 0; } - if ( defined($::opt_K) || defined($::opt_R) || defined($::opt_C) ) { - if ( ! defined($::opt_x)) { - if ( defined($::opt_K) ){ - lskit_K($kit_hash); - } - - # Option -R for kit repo attributes - if ( defined($::opt_R) ) { - my @kitrepos = keys(%$kitrepo_hash); - if (scalar @kitrepos == 0) { - my $rsp = {}; - push @{ $rsp->{data} }, "No kit repos were found."; - xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); - return 0; - } - lskit_R($kit_hash,$kitrepo_hash); - } - - if ( defined($::opt_C) ) { - my @kitcomplist = keys(%$kitcomp_hash); - if (scalar @kitcomplist == 0) { - my $rsp = {}; - push @{ $rsp->{data} }, "No kit components were found."; - xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); - return 0; - } - lskit_C($kit_hash,$kitcomp_hash); - } - }else - { - if (defined($::opt_K)) { - create_lskit_K_xml_response($kit_hash); - } - if (defined($::opt_R)) { - create_lskit_R_xml_response($kit_hash,$kitrepo_hash); - } - if (defined($::opt_C)) { - create_lskit_C_xml_response($kit_hash,$kitcomp_hash); - } - } - } - else - { - if (defined($::opt_x)) { - create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash); - } else { - create_lskit_stanza_response($kit_hash, $kitrepo_hash, $kitcomp_hash); - } + if (defined($::opt_x)) { + create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash); + } else { + create_lskit_stanza_response($kit_hash, $kitrepo_hash, $kitcomp_hash); } return 0; } -#---------------------------------------------------------------------------- - -=head3 lskit_R - - Support for listing kit repo - - Arguments: - Returns: - 0 - OK - 1 - help - 2 - error -=cut - -#----------------------------------------------------------------------------- - -sub lskit_R { - - my $kit_hash = shift; - my $kitrepo_hash = shift; - my $rsp = {}; - my $count = 0; - - - for my $kitname (sort(keys(%$kit_hash))) { - - my $output .= "\nkit : $kitname\n----------------------------------------------------\n"; - - - # Kit repository info - if (defined($kitrepo_hash->{$kitname})) { - for my $kitrepo (@{$kitrepo_hash->{$kitname}}) { - $output .= "kitrepo:\n"; - for my $kitrepo_attr (sort(keys(%$kitrepo))) { - $output .= sprintf(" %s=%s\n", $kitrepo_attr, $kitrepo->{$kitrepo_attr}); - } - $output .= "\n"; - } - } - - push @{ $rsp->{data} }, $output; - } - - xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); - - -} - - -#---------------------------------------------------------------------------- - -=head3 lskit_K - - Support for listing kit - - Arguments: - Returns: - 0 - OK - 1 - help - 2 - error -=cut - -#----------------------------------------------------------------------------- - -sub lskit_K { - - my $kit_hash = shift; - my $rsp = {}; - my $count = 0; - - - for my $kitname (sort(keys(%$kit_hash))) { - - my $output .= "\nkit : $kitname\n----------------------------------------------------\n"; - # Kit info - if (defined($kit_hash->{$kitname})) { - my $kit = $kit_hash->{$kitname}->[0]; - $output .= "kit:\n"; - for my $kit_attr (sort(keys(%$kit))) { - $output .= sprintf(" %s=%s\n", $kit_attr, $kit->{$kit_attr}); - } - $output .= "\n"; - } - - - push @{ $rsp->{data} }, $output; - } - - xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); - - -} - -#---------------------------------------------------------------------------- - -=head3 lskit_C - - Support for listing kitcomponent - - Arguments: - Returns: - 0 - OK - 1 - help - 2 - error -=cut - -#----------------------------------------------------------------------------- - -sub lskit_C { - - my $kit_hash = shift; - my $kitcomp_hash = shift; - my $rsp = {}; - my $count = 0; - - - for my $kitname (sort(keys(%$kit_hash))) { - - my $output .= "\nkit : $kitname\n----------------------------------------------------\n"; - - - # Kit component info - if (defined($kitcomp_hash->{$kitname})) { - for my $kitcomp (@{$kitcomp_hash->{$kitname}}) { - $output .= "kitcomponent:\n"; - for my $kitcomp_attr (sort(keys(%$kitcomp))) { - $output .= sprintf(" %s=%s\n", $kitcomp_attr, $kitcomp->{$kitcomp_attr}); - } - $output .= "\n"; - } - } - - - push @{ $rsp->{data} }, $output; - } - - xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); - - -} - - #---------------------------------------------------------------------------- =head3 lskitcomp @@ -5123,122 +4936,6 @@ sub create_lskit_xml_response { } -#---------------------------------------------------------------------------- - -=head3 create_lskit_K_xml_response - - Prepare a response that returns the kit info in XML format. - - Arguments: - kit hash table - - Note: Hash tables are created by create_hash_from_table_rows() -=cut - -#----------------------------------------------------------------------------- - -sub create_lskit_K_xml_response { - - my $kit_hash = shift; - - my $rsp = {}; - - for my $kitname (sort(keys(%$kit_hash))) { - my $output_hash = {"kitinfo" => {"kit" => [], "kitrepo" => [], "kitcomponent" => [] } }; - - # Kit info - if (defined($kit_hash->{$kitname})) { - my $kit = $kit_hash->{$kitname}->[0]; - push(@{$output_hash->{kitinfo}->{kit}}, $kit); - } - - push @{ $rsp->{data} }, $output_hash; - } - - xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); -} - -#---------------------------------------------------------------------------- - -=head3 create_lskit_R_xml_response - - Prepare a response that returns the kit repository - info in XML format. - - Arguments: - kit repo hash table - - Note: Hash tables are created by create_hash_from_table_rows() -=cut - -#----------------------------------------------------------------------------- - -sub create_lskit_R_xml_response { - - my $kit_hash = shift; - my $kitrepo_hash = shift; - - my $rsp = {}; - - for my $kitname (sort(keys(%$kit_hash))) { - my $output_hash = {"kitinfo" => {"kit" => [], "kitrepo" => [], "kitcomponent" => [] } }; - - # Kit repository info - if (defined($kitrepo_hash->{$kitname})) { - for my $kitrepo (@{$kitrepo_hash->{$kitname}}) { - push(@{$output_hash->{kitinfo}->{kitrepo}}, $kitrepo); - } - } - - push @{ $rsp->{data} }, $output_hash; - } - - xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); -} - - -#---------------------------------------------------------------------------- - -=head3 create_lskit_C_xml_response - - Prepare a response that returns the - kit component info in XML format. - - Arguments: - kit hash table - kit component hash table - - Note: Hash tables are created by create_hash_from_table_rows() -=cut - -#----------------------------------------------------------------------------- - -sub create_lskit_C_xml_response { - - my $kit_hash = shift; - my $kitcomp_hash = shift; - - my $rsp = {}; - - for my $kitname (sort(keys(%$kit_hash))) { - my $output_hash = {"kitinfo" => {"kit" => [], "kitrepo" => [], "kitcomponent" => [] } }; - - - # Kit component info - if (defined($kitcomp_hash->{$kitname})) { - for my $kitcomp (@{$kitcomp_hash->{$kitname}}) { - push(@{$output_hash->{kitinfo}->{kitcomp}}, $kitcomp); - } - } - - push @{ $rsp->{data} }, $output_hash; - } - - xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); -} - - - #---------------------------------------------------------------------------- =head3 create_lskit_stanza_response From 2ace529feeeb9b3f52b6307d8023d23daad9ac3d Mon Sep 17 00:00:00 2001 From: baiyuan Date: Mon, 3 Nov 2014 03:55:24 -0500 Subject: [PATCH 86/93] range lskit to support -K -R -C and theirs xml format --- xCAT-server/lib/xcat/plugins/kit.pm | 325 +++++++++++++++++++++++++++- 1 file changed, 316 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 5db77268f..72a9a2c83 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -2651,12 +2651,10 @@ sub rmkitcomp # Remove each kitcomponent from osimage. my @newosikitcomps; - my @myoskitcomps; foreach my $osikitcomp ( @osikitcomps ) { my $match = 0; foreach my $kitcomponent (keys %kitcomps) { if ( $kitcomponent eq $osikitcomp ) { - push @myoskitcomps, $osikitcomp; $match = 1; last; } @@ -2778,6 +2776,8 @@ sub rmkitcomp if ( !$match ) { if ( $debianflag ) { + #Now we do not use moun --bind for kitrepo dir to otherpkgdir + #leave this line is support old way when using mount system("umount -f $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame} > /dev/null"); } system("rm -rf $otherpkgdir/$kitcomps{$kitcomponent}{kitreponame}"); @@ -3251,7 +3251,6 @@ sub rmkitcomp # Write osimage table with all the above udpates. $tabs{osimage}->setAttribs({imagename => $osimage }, \%{$osimagetable} ); - #After all the data updated in osimage and linuximage table #check if these kitcomponents are assigned to other osimage #if these kitcomponents are not used by other osimage, find their kitrepo and kitrepo directory under otherpkg dir @@ -3302,8 +3301,9 @@ sub rmkitcomp } } } - } - + } + + return; } @@ -4256,6 +4256,8 @@ sub lskit { my $kitrepo_hash = get_kitrepo_hash($::kitnames, $::kitrepoattrs); my $kitcomp_hash = get_kitcomp_hash($::kitnames, $::kitcompattrs); + + # Now display the output my @kitnames = keys(%$kit_hash); if (scalar @kitnames == 0) { @@ -4265,15 +4267,204 @@ sub lskit { return 0; } - if (defined($::opt_x)) { - create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash); - } else { - create_lskit_stanza_response($kit_hash, $kitrepo_hash, $kitcomp_hash); + #lskit use options + if ( defined($::opt_K) || defined($::opt_R) || defined($::opt_C) ) { + + if ( ! defined($::opt_x)) { + if ( defined($::opt_K) ){ + lskit_K($kit_hash); + } + + # Option -R for kit repo attributes + if ( defined($::opt_R) ) { + my @kitrepos = keys(%$kitrepo_hash); + if (scalar @kitrepos == 0) { + my $rsp = {}; + push @{ $rsp->{data} }, "No kit repos were found."; + xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); + return 0; + } + lskit_R($kit_hash,$kitrepo_hash); + } + + if ( defined($::opt_C) ) { + my @kitcomplist = keys(%$kitcomp_hash); + if (scalar @kitcomplist == 0) { + my $rsp = {}; + push @{ $rsp->{data} }, "No kit components were found."; + xCAT::MsgUtils->message("I", $rsp, $::CALLBACK); + return 0; + } + lskit_C($kit_hash,$kitcomp_hash); + } + }else + { + #To support xml format + if (defined($::opt_K)) { + create_lskit_K_xml_response($kit_hash); + } + if (defined($::opt_R)) { + create_lskit_R_xml_response($kit_hash,$kitrepo_hash); + } + if (defined($::opt_C)) { + create_lskit_C_xml_response($kit_hash,$kitcomp_hash); + } + } + } + else + { + #lskit use no options + if (defined($::opt_x)) { + create_lskit_xml_response($kit_hash, $kitrepo_hash, $kitcomp_hash); + } else { + create_lskit_stanza_response($kit_hash, $kitrepo_hash, $kitcomp_hash); + } } return 0; } +#---------------------------------------------------------------------------- + +=head3 lskit_R + + Support for listing kit repo + + Arguments: + Returns: + 0 - OK + 1 - help + 2 - error +=cut + +#----------------------------------------------------------------------------- + +sub lskit_R { + + my $kit_hash = shift; + my $kitrepo_hash = shift; + my $rsp = {}; + my $count = 0; + + + for my $kitname (sort(keys(%$kit_hash))) { + + my $output .= "\nkit : $kitname\n----------------------------------------------------\n"; + + + # Kit repository info + if (defined($kitrepo_hash->{$kitname})) { + for my $kitrepo (@{$kitrepo_hash->{$kitname}}) { + $output .= "kitrepo:\n"; + for my $kitrepo_attr (sort(keys(%$kitrepo))) { + $output .= sprintf(" %s=%s\n", $kitrepo_attr, $kitrepo->{$kitrepo_attr}); + } + $output .= "\n"; + } + } + + push @{ $rsp->{data} }, $output; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); + + +} + + +#---------------------------------------------------------------------------- + +=head3 lskit_K + + Support for listing kit + + Arguments: + Returns: + 0 - OK + 1 - help + 2 - error +=cut + +#----------------------------------------------------------------------------- + +sub lskit_K { + + my $kit_hash = shift; + my $rsp = {}; + my $count = 0; + + + for my $kitname (sort(keys(%$kit_hash))) { + + my $output .= "\nkit : $kitname\n----------------------------------------------------\n"; + # Kit info + if (defined($kit_hash->{$kitname})) { + my $kit = $kit_hash->{$kitname}->[0]; + $output .= "kit:\n"; + for my $kit_attr (sort(keys(%$kit))) { + $output .= sprintf(" %s=%s\n", $kit_attr, $kit->{$kit_attr}); + } + $output .= "\n"; + } + + + push @{ $rsp->{data} }, $output; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); + + +} + +#---------------------------------------------------------------------------- + +=head3 lskit_C + + Support for listing kitcomponent + + Arguments: + Returns: + 0 - OK + 1 - help + 2 - error +=cut + +#----------------------------------------------------------------------------- + +sub lskit_C { + + my $kit_hash = shift; + my $kitcomp_hash = shift; + my $rsp = {}; + my $count = 0; + + + for my $kitname (sort(keys(%$kit_hash))) { + + my $output .= "\nkit : $kitname\n----------------------------------------------------\n"; + + + # Kit component info + if (defined($kitcomp_hash->{$kitname})) { + for my $kitcomp (@{$kitcomp_hash->{$kitname}}) { + $output .= "kitcomponent:\n"; + for my $kitcomp_attr (sort(keys(%$kitcomp))) { + $output .= sprintf(" %s=%s\n", $kitcomp_attr, $kitcomp->{$kitcomp_attr}); + } + $output .= "\n"; + } + } + + + push @{ $rsp->{data} }, $output; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); + + +} + + #---------------------------------------------------------------------------- =head3 lskitcomp @@ -4936,6 +5127,122 @@ sub create_lskit_xml_response { } +#---------------------------------------------------------------------------- + +=head3 create_lskit_K_xml_response + + Prepare a response that returns the kit info in XML format. + + Arguments: + kit hash table + + Note: Hash tables are created by create_hash_from_table_rows() +=cut + +#----------------------------------------------------------------------------- + +sub create_lskit_K_xml_response { + + my $kit_hash = shift; + + my $rsp = {}; + + for my $kitname (sort(keys(%$kit_hash))) { + my $output_hash = {"kitinfo" => {"kit" => [], "kitrepo" => [], "kitcomponent" => [] } }; + + # Kit info + if (defined($kit_hash->{$kitname})) { + my $kit = $kit_hash->{$kitname}->[0]; + push(@{$output_hash->{kitinfo}->{kit}}, $kit); + } + + push @{ $rsp->{data} }, $output_hash; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); +} + +#---------------------------------------------------------------------------- + +=head3 create_lskit_R_xml_response + + Prepare a response that returns the kit repository + info in XML format. + + Arguments: + kit repo hash table + + Note: Hash tables are created by create_hash_from_table_rows() +=cut + +#----------------------------------------------------------------------------- + +sub create_lskit_R_xml_response { + + my $kit_hash = shift; + my $kitrepo_hash = shift; + + my $rsp = {}; + + for my $kitname (sort(keys(%$kit_hash))) { + my $output_hash = {"kitinfo" => {"kit" => [], "kitrepo" => [], "kitcomponent" => [] } }; + + # Kit repository info + if (defined($kitrepo_hash->{$kitname})) { + for my $kitrepo (@{$kitrepo_hash->{$kitname}}) { + push(@{$output_hash->{kitinfo}->{kitrepo}}, $kitrepo); + } + } + + push @{ $rsp->{data} }, $output_hash; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); +} + + +#---------------------------------------------------------------------------- + +=head3 create_lskit_C_xml_response + + Prepare a response that returns the + kit component info in XML format. + + Arguments: + kit hash table + kit component hash table + + Note: Hash tables are created by create_hash_from_table_rows() +=cut + +#----------------------------------------------------------------------------- + +sub create_lskit_C_xml_response { + + my $kit_hash = shift; + my $kitcomp_hash = shift; + + my $rsp = {}; + + for my $kitname (sort(keys(%$kit_hash))) { + my $output_hash = {"kitinfo" => {"kit" => [], "kitrepo" => [], "kitcomponent" => [] } }; + + + # Kit component info + if (defined($kitcomp_hash->{$kitname})) { + for my $kitcomp (@{$kitcomp_hash->{$kitname}}) { + push(@{$output_hash->{kitinfo}->{kitcomp}}, $kitcomp); + } + } + + push @{ $rsp->{data} }, $output_hash; + } + + xCAT::MsgUtils->message("D", $rsp, $::CALLBACK); +} + + + #---------------------------------------------------------------------------- =head3 create_lskit_stanza_response From df45650bfbb741bf272ba753d15f39ca07422691 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 4 Nov 2014 07:51:04 -0500 Subject: [PATCH 87/93] defect 4355 --- xCAT-client/bin/xdsh | 47 +++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/xCAT-client/bin/xdsh b/xCAT-client/bin/xdsh index 5a81f3103..a026544c5 100644 --- a/xCAT-client/bin/xdsh +++ b/xCAT-client/bin/xdsh @@ -443,22 +443,41 @@ sub parse_args_xdsh } - # add config file with strict host checking no - my $cmd = "echo \"StrictHostKeyChecking no\" >> $home/.ssh/config"; - xCAT::Utils->runcmd($cmd, 0); - if ($::RUNCMD_RC != 0) - { # error - $msg = "Error from $cmd\n"; - xCAT::MsgUtils->message("E", $msg); + # add config file with strict host checking no, if not already there + my $configinfo = "StrictHostKeyChecking no"; + my $configfile= "$home/.ssh/config"; + if (-e $configfile) + { + my $cmd = "grep StrictHostKeyChecking $configfile"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) + { # not there + $cmd = "echo $configinfo >> $configfile"; + my @output = xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) + { # error + xCAT::MsgUtils->message("E", "Error on $cmd, @output"); + return 1; + } + + } + } + else # file does not exist + { + my $cmd = "echo $configinfo >> $configfile"; + my @output = xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) + { # error + xCAT::MsgUtils->message("E", "Error on $cmd, @output"); + return 1; + } + else + { + chmod 0600, $configfile; + + } } - my $cmd = "chmod 0600 $home/.ssh/config"; - xCAT::Utils->runcmd($cmd, 0); - if ($::RUNCMD_RC != 0) - { # error - $msg = "Error from $cmd\n"; - xCAT::MsgUtils->message("E", $msg); - } # if current_userid is not "root", we need to generate the keys # here before becoming root while running under xcatd From 1fb1b283bba26762ca2bd703b0391f5ed3a158db Mon Sep 17 00:00:00 2001 From: Lei Ai Date: Tue, 4 Nov 2014 22:16:09 +0800 Subject: [PATCH 88/93] set netboot to for PPC64LE --- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index 5fee1f892..37714c867 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -888,6 +888,7 @@ sub check_profile_consistent{ $ppc_netboot = 'grub2'; } my %profile_dict = ('x86' => 'xnba','x86_64' => 'xnba', 'ppc64' => $ppc_netboot, + 'ppc64el' => $ppc_netboot, 'fsp' => 'FSP', 'ipmi' => 'BMC'); # Check if imageprofile is consistent with networkprofile if ($profile_dict{$arch} ne $netboot) { From 8622f3f9bd570b7a7cc1fab77bcff2a521bde41b Mon Sep 17 00:00:00 2001 From: linggao Date: Tue, 4 Nov 2014 11:39:58 -0500 Subject: [PATCH 89/93] fixed defect 2994 imgexport/imgimport problems --- xCAT-server/lib/xcat/plugins/imgport.pm | 29 ++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/imgport.pm b/xCAT-server/lib/xcat/plugins/imgport.pm index 77aa7bac2..4ad889ab1 100644 --- a/xCAT-server/lib/xcat/plugins/imgport.pm +++ b/xCAT-server/lib/xcat/plugins/imgport.pm @@ -998,7 +998,7 @@ sub make_bundle { # Local imgexports go to the current working directory $dest = "$dir/$bundleName"; } - + $callback->( {data => ["Compressing $imagename bundle. Please be patient."]}); if($::VERBOSE){ $callback->({data => ["tar czvf $dest . "]}); @@ -1971,6 +1971,10 @@ sub make_files { $callback->({error=>["Could not open the litefile table."],errorcode=>[1]}); return 0; } + #get current litefile table entries + my @entries = $lftab->getAllAttribsWhere( "\"image\" = 'ALL'", 'file', 'options'); + + #get the entries for image open(FILE,"$fn") or die "Could not open $fn."; foreach my $line () { chomp($line); @@ -1978,10 +1982,25 @@ sub make_files { my @tmp=split('"', $line); my %keyhash; my %updates; - $keyhash{image}=$data->{osimage}->{imagename}; - $keyhash{file}=$tmp[3]; - $updates{options}=$tmp[5]; - $lftab->setAttribs(\%keyhash, \%updates ); + my $filename = $tmp[3]; + my $options = $tmp[5]; + + # If there is an entry with image as ALL for the same file, + # then no need to add the file name in the table + my $skip = 0; + foreach my $entry (@entries) { + if (($filename eq $entry->{'file'}) && ($options eq $entry->{'options'})){ + $skip = 1; + last; + } + } + + if ($skip == 0) { + $keyhash{image}=$data->{osimage}->{imagename}; + $keyhash{file}=$filename; + $updates{options}=$options; + $lftab->setAttribs(\%keyhash, \%updates ); + } } close(FILE); $lftab->commit; From 06bbdbc33ff9a5199c4778ecb3cec624ae816eb8 Mon Sep 17 00:00:00 2001 From: huweihua Date: Tue, 4 Nov 2014 21:40:49 -0500 Subject: [PATCH 90/93] support rhels7.0 --- xCAT/postscripts/configefi | 42 +++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/configefi b/xCAT/postscripts/configefi index b5cc4e54c..1d71caaca 100644 --- a/xCAT/postscripts/configefi +++ b/xCAT/postscripts/configefi @@ -17,6 +17,26 @@ if [ "$arch" = "x86_64" ]; then if [ -f "/boot/efi/EFI/redhat/grub.efi" ];then efibootmgr -c -l \\EFI\\redhat\\grub.efi -L syscloneLinux + #support for redhat 7.0 + elif [ -f "/boot/efi/EFI/redhat/grubx64.efi" ];then + efibootmgr -c -l \\EFI\\redhat\\grubx64.efi -L syscloneLinux + + boot_root=`mount | grep -E ' on\s+/ type ' | awk '{print $1}'` + sed -i 's| root=\S*| root='$boot_root'|' /boot/efi/EFI/redhat/grub.cfg + + blkid -c /dev/null |grep UUID|while read str_line + do + partition=`echo "$str_line"|grep UUID|awk '{print $1}'|sed -e 's|/dev/\(.*\):|\1|g'` + #echo "partition=$partition" + + if echo "$partition"|grep /; then + continue + fi + + newuuid=`blkid -c /dev/null|grep "$partition"|sed -e 's|.*UUID="\(.*\)" T.*|\1|g'` + #echo "newuuid=$newuuid" + sed -i '/'$partition'/s|UUID=\S*|UUID='$newuuid'|' /etc/fstab + done elif [ -f "/boot/efi/efi/SuSE/elilo.efi" ];then efibootmgr -c -l \\efi\\SuSE\\elilo.efi -L syscloneLinux else @@ -101,8 +121,28 @@ elif [ "$arch" = "ppc64" ]; then # Set 0x41 as the partition type of the first partition # echo A | dd of=/dev/sda bs=1 count=1 seek=450 + elif [ -f "/boot/grub2/grub" ];then + echo "dd if=/boot/grub2/grub of=/dev/sda1 bs=4096" + dd if=/boot/grub2/grub of=/dev/sda1 bs=4096 + + boot_root=`mount | grep -E ' on\s+/ type ' | awk '{print $1}'` + sed -i 's| root=UUID=\S*| root='$boot_root'|' /boot/grub2/grub.cfg + + blkid -c /dev/null |grep UUID|while read str_line + do + partition=`echo "$str_line"|grep UUID|awk '{print $1}'|sed -e 's|/dev/\(.*\):|\1|g'` + #echo "partition=$partition" + + if echo "$partition"|grep /; then + continue + fi + + newuuid=`blkid -c /dev/null|grep "$partition"|sed -e 's|.*UUID="\(.*\)" T.*|\1|g'` + #echo "newuuid=$newuuid" + sed -i '/'$partition'/s|UUID=\S*|UUID='$newuuid'|' /etc/fstab + done else - echo "there isn't yaboot bootloader" + echo "Can not find boot loader" fi else echo "[ERROR]: unsupport arch....." From 51f9f121bc69bf7547f850ce035e963a642c1981 Mon Sep 17 00:00:00 2001 From: huweihua Date: Tue, 4 Nov 2014 21:43:02 -0500 Subject: [PATCH 91/93] get rid of needless output --- xCAT/postscripts/updatenetwork | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/updatenetwork b/xCAT/postscripts/updatenetwork index de7db45c8..dd3e18900 100644 --- a/xCAT/postscripts/updatenetwork +++ b/xCAT/postscripts/updatenetwork @@ -4,8 +4,8 @@ . /tmp/post-install/variables.txt #delete the udev rule in the image -rule_file=`ls /etc/udev/rules.d/*net_persistent_names.rules` -if [ -n "$rule_file" ];then +rule_file="/etc/udev/rules.d/*net_persistent_names.rules" +if ls $rule_file >/dev/null 2>&1;then rm -f $rule_file fi From 23a132c4977a1232ff1d908beb8351b832ee654b Mon Sep 17 00:00:00 2001 From: huweihua Date: Tue, 4 Nov 2014 21:45:44 -0500 Subject: [PATCH 92/93] fix the bug when use dracut to rebuild initrd --- xCAT/postscripts/makeinitrd | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/makeinitrd b/xCAT/postscripts/makeinitrd index ec71a5440..ecdadcd68 100755 --- a/xCAT/postscripts/makeinitrd +++ b/xCAT/postscripts/makeinitrd @@ -10,17 +10,28 @@ # And do whatever is necessary on ubuntu. if [[ -f /sbin/dracut ]]; then - # redhat6.x/centos6.x + # redhat6.x/centos6.x/rhels7.x echo "Running dracut to regenerate the initrd with the drivers needed by this node:" - dracut --force + arch=`uname -m` + #echo "arch=$arch" + initrdfile=`find /boot -name "initramfs-*.$arch.img"` + #echo "initrdfile=$initrdfile" + kernelversion=`echo $initrdfile |sed -e 's:/boot/initramfs-\(.*\)\.img:\1:g'` + #echo "kernelversion=$kernelversion" + mv $initrdfile $initrdfile.org + echo "dracut $initrdfile $kernelversion" + dracut $initrdfile $kernelversion else # suse/sles and redhat5.x/centos5.x echo "Running mkinitrd to regenerate the initrd with the drivers needed by this node:" osvers=`cat /etc/*release|sed -e 's/.*\([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/'` if [[ $osvers == 5\.* ]];then initrdfile=`find /boot -name "initrd-*.img"` + #echo "initrdfile=$initrdfile" kernelversion=`echo $initrdfile |sed -e 's:/boot/initrd-\(.*\)\.img:\1:g'` + #echo "kernelversion=$kernelversion" mv $initrdfile $initrdfile.org + echo "mkinitrd $initrdfile $kernelversion" mkinitrd $initrdfile $kernelversion else mkinitrd From 9f830ffc17bae2a9021158a48073d5f0185e8bcd Mon Sep 17 00:00:00 2001 From: huweihua Date: Tue, 4 Nov 2014 21:52:13 -0500 Subject: [PATCH 93/93] get rid of needless systemimager monitor service for sysclone --- xCAT-server/lib/xcat/plugins/anaconda.pm | 13 ++++++++++--- xCAT-server/lib/xcat/plugins/sles.pm | 12 +++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 05d08fa2d..316bee41d 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1690,12 +1690,19 @@ sub mksysclone copy("/var/lib/systemimager/scripts/post-install/10all.fix_swap_uuids","$pspath"); } - unless (-r "$pspath/95all.monitord_rebooted") + #unless (-r "$pspath/95all.monitord_rebooted") + #{ + # mkpath("$pspath"); + # copy("/var/lib/systemimager/scripts/post-install/95all.monitord_rebooted","$pspath"); + #} + + + if(-e "$pspath/95all.monitord_rebooted") { - mkpath("$pspath"); - copy("/var/lib/systemimager/scripts/post-install/95all.monitord_rebooted","$pspath"); + `rm $pspath/95all.monitord_rebooted`; } + # copy hosts copy("/etc/hosts","$installroot/sysclone/scripts/"); diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 32552732e..032df544e 100755 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1379,12 +1379,18 @@ sub mksysclone # copy("/var/lib/systemimager/scripts/post-install/11all.replace_byid_device","$pspath"); #} - unless (-r "$pspath/95all.monitord_rebooted") + #unless (-r "$pspath/95all.monitord_rebooted") + #{ + # mkpath("$pspath"); + # copy("/var/lib/systemimager/scripts/post-install/95all.monitord_rebooted","$pspath"); + #} + + if(-e "$pspath/95all.monitord_rebooted") { - mkpath("$pspath"); - copy("/var/lib/systemimager/scripts/post-install/95all.monitord_rebooted","$pspath"); + `rm $pspath/95all.monitord_rebooted`; } + # copy hosts copy("/etc/hosts","$installroot/sysclone/scripts/");