mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 19:32:31 +00:00 
			
		
		
		
	add new SN setup case to support using bundle only in jenkins
This commit is contained in:
		
							
								
								
									
										107
									
								
								xCAT-test/autotest/testcase/installation/SN_setup_case
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										107
									
								
								xCAT-test/autotest/testcase/installation/SN_setup_case
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,107 @@ | ||||
| start:SN_setup_case | ||||
| os:Linux | ||||
| stop:yes | ||||
|  | ||||
| cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__  __GETNODEATTR($$SN,arch)__ | ||||
| check:rc==0 | ||||
|  | ||||
| cmd:chtab key=nameservers site.value="<xcatmaster>" | ||||
| check:rc==0 | ||||
| cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]];then chdef -t node -o $$SN vmstorage=dir:///var/lib/libvirt/images/ && rmvm $$SN -f -p &&  mkvm $$SN -s 25G; fi | ||||
|  | ||||
| cmd:makedns -n | ||||
| check:rc==0 | ||||
| cmd:makeconservercf  | ||||
| check:rc==0 | ||||
| cmd:cat /etc/conserver.cf | grep $$SN | ||||
| check:output=~$$SN | ||||
| cmd:sleep 20 | ||||
| cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "ppc64" ]]; then getmacs -D $$SN; fi | ||||
| check:rc==0 | ||||
| cmd:makedhcp -n | ||||
| check:rc==0 | ||||
| cmd:makedhcp -a | ||||
| check:rc==0 | ||||
| cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$SN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$SN;fi  | ||||
| check:output=~$$SN | ||||
|  | ||||
| cmd:chdef -t node $$SN groups=service,all | ||||
| check:rc==0 | ||||
| cmd:chdef -t group -o service profile=service  primarynic=mac installnic=mac | ||||
| check:rc==0 | ||||
| cmd:chdef -t group -o service setupnfs=1 setupdhcp=1 setuptftp=1 setupnameserver=1 setupconserver=1 | ||||
| check:rc==0 | ||||
| cmd:chdef -t group -o service nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN monserver=$$MN | ||||
| check:rc==0 | ||||
| cmd:chtab node=service postscripts.postscripts="servicenode" | ||||
| check:rc==0 | ||||
|  | ||||
| cmd:copycds $$ISO | ||||
| check:rc==0 | ||||
|  | ||||
| cmd:chdef -t site clustersite installloc="/install" | ||||
| check:rc==0 | ||||
|  | ||||
| cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo .   | ||||
| check:rc==0 | ||||
| #cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`; cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/sles$ver/__GETNODEATTR($$SN,arch)__ && createrepo . ;elif cat /etc/*release |grep "Red Hat" >/dev/null;then ver=`cat /etc/*release |awk '{print $7}' |awk -F"." '{print $1}'|head -n 1`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/rh$ver/__GETNODEATTR($$SN,arch)__ && createrepo . ;fi | ||||
| #check:rc==0 | ||||
|  | ||||
| cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__ | ||||
| check:rc==0 | ||||
| #cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/sles/service.sles$ver.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; elif cat /etc/*release |grep "Red Hat" >/dev/null;then ver=`cat /etc/*release |awk '{print $7}' |awk -F"." '{print $1}'|head -n 1`;chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/rh/service.rhels$ver.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;fi | ||||
| #cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/sles/service.sles$ver.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; elif cat /etc/*release |grep "Red Hat" >/dev/null;then chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/rh/service.__GETNODEATTR($$SN,os).__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;fi | ||||
| #check:rc==0 | ||||
|  | ||||
| cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/sles/service.sles$ver.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist; elif cat /etc/*release |grep "7.0" |grep "Red Hat">/dev/null;then chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/rh/service.__GETNODEATTR($$SN,os)__.ppc64.otherpkgs.pkglist;elif cat /etc/*release |grep "Red Hat" |grep "6.5">/dev/null;then ver=`cat /etc/*release |awk '{print $7}' |awk -F"." '{print $1}'|head -n 1`;chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/rh/service.rhels$ver.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;fi | ||||
|  | ||||
| check:rc==0 | ||||
|  | ||||
| #cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`;for i in mysql-client libmysqlclient_r15 libqt4-sql-mysql libmysqlclient15 perl-DBD-mysql mysql; do  cat /opt/xcat/share/xcat/install/sles/service.sles$ver.pkglist|grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /opt/xcat/share/xcat/install/sles/service.sles$ver.pkglist; fi done; elif cat /etc/*release |grep "Red Hat" >/dev/null;then ver=`cat /etc/*release |awk '{print $7}' |awk -F"." '{print $1}'|head -n 1`;for i in mysql; do cat /opt/xcat/share/xcat/install/rh/service.rhels$ver.ppc64.pkglist|grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /opt/xcat/share/xcat/install/rh/service.rhels$ver.ppc64.pkglist; fi done;fi | ||||
| #cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`;for i in  mariadb-devel-5.5.35-3.el7  mariadb-libs-5.5.35-3.el7  mariadb-server-5.5.35-3.el7 mariadb-bench-5.5.35-3.el7 mariadb-5.5.35-3.el7  perl-DBD-MySQL  mysql-connector-odbc unixODBC; do  cat /opt/xcat/share/xcat/install/sles/service.sles$ver.pkglist|grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /opt/xcat/share/xcat/install/sles/service.sles$ver.pkglist; fi done; elif cat /etc/*release |grep "Red Hat" >/dev/null;then ver=__GETNODEATTR($$SN,os)__;for i in mysql; do cat /opt/xcat/share/xcat/install/rh/service.$ver.ppc64.pkglist|grep "$i$";if [ $? -ne 0 ] ; then echo "$i" >> /opt/xcat/share/xcat/install/rh/service.$ver.ppc64.pkglist; fi done;fi | ||||
| check:rc==0 | ||||
| #cmd:if cat /etc/*release |grep SUSE >/dev/null;then ver=`cat /etc/*release |grep "VERSION = " | sed 's:VERSION = \(.*\):\1:g'`;chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkglist=/opt/xcat/share/xcat/install/sles/service.sles$ver.pkglist; elif cat /etc/*release |grep "Red Hat" >/dev/null;then ver=`cat /etc/*release |awk '{print $7}' |awk -F"." '{print $1}'|head -n 1`;chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkglist=/opt/xcat/share/xcat/install/rh/service.rhels$ver.__GETNODEATTR($$SN,arch)__.pkglist;fi | ||||
| check:rc==0 | ||||
| cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkgdir="/install/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__" | ||||
| check:rc==0 | ||||
|  | ||||
|  | ||||
| cmd:nodeset $$SN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service | ||||
| check:rc==0 | ||||
| cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "ppc64" ]]; then rnetboot $$SN;elif [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]];then rpower $$SN boot; fi | ||||
| check:rc==0 | ||||
|  | ||||
| cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/customize_sleep_for_sn   __GETNODEATTR($$SN,os)__  __GETNODEATTR($$SN,arch)__ | ||||
|  | ||||
| cmd:ping $$SN -c 3 | ||||
| check:rc==0 | ||||
| check:output=~64 bytes from $$SN | ||||
| cmd:lsdef -l $$SN | grep status | ||||
| check:rc==0 | ||||
| check:output=~booted | ||||
| cmd:xdsh $$SN date | ||||
| check:rc==0 | ||||
| check:output=~\d\d:\d\d:\d\d | ||||
| cmd:xdsh $$SN "ps -ef |grep xcatd" | ||||
| check:rc==0 | ||||
| check:output=~xcatd: | ||||
| cmd:xdsh $$SN "lsdef" | ||||
| check:rc==0 | ||||
| check:output=~$$SN: $$SN | ||||
| cmd:xdsh $$SN "tabdump site" | ||||
| check:rc==0 | ||||
| check:output=~tftpdir  | ||||
| cmd:xdsh $$SN "mount" | ||||
| check:rc==0 | ||||
| check:output=~/install on /install | ||||
| cmd:xdsh $$SN "mount" | ||||
| check:rc==0 | ||||
| check:output=~/tftpboot on /tftpboot | ||||
| #cmd:xdsh $$SN "nslookup $$CN" | ||||
| #check:rc==0 | ||||
| #check:output!~server can't find $$CN | ||||
|  | ||||
| cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]]; then if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN "zypper -n install perl-Sys-Virt"; elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN "yum install -y perl-Sys-Virt";fi;fi | ||||
| check:rc==0 | ||||
|  | ||||
| end | ||||
							
								
								
									
										28
									
								
								xCAT-test/autotest/testcase/installation/customize_sleep_for_sn
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										28
									
								
								xCAT-test/autotest/testcase/installation/customize_sleep_for_sn
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| #!/usr/bin/env perl | ||||
|  | ||||
| my $os=$ARGV[0]; | ||||
| my $arch=$ARGV[1]; | ||||
| my $log="/tmp/pre_deploy_sn.log"; | ||||
|  | ||||
| my $orgclusterconffile="/opt/xcat/share/xcat/tools/autotest/default.conf"; | ||||
| my $snnodename = `cat $orgclusterconffile |grep SN|grep =|awk -F'=' '{print \$2}'`; | ||||
| chomp($snnodename); | ||||
| `echo "SN=$snnodename" >> $log`; | ||||
| sleep 900; | ||||
|  | ||||
| my $timecnt=0; | ||||
| while($timecnt < 200){ | ||||
|     my $booted=system("lsdef -l $snnodename|grep status|grep booted"); | ||||
|     last if($booted==0); | ||||
|   | ||||
|     if($os =~ /rhel/i && $arch =~ /^ppc64$/i){ | ||||
|         my $booting=system("lsdef -l $snnodename|grep status|grep booting"); | ||||
|         system("xdsh $snnodename \"echo 1\"")  if($booting==0); | ||||
|         `echo "send signal to $snnodename for the $timecnt times" >> $log`; | ||||
|     } | ||||
|    | ||||
|     sleep 10; | ||||
|     $timecnt++; | ||||
| }  | ||||
|   | ||||
| exit 0; | ||||
							
								
								
									
										26
									
								
								xCAT-test/autotest/testcase/installation/pre_deploy_sn
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										26
									
								
								xCAT-test/autotest/testcase/installation/pre_deploy_sn
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| #!/usr/bin/env perl | ||||
|  | ||||
| my $os=$ARGV[0]; | ||||
| my $arch=$ARGV[1]; | ||||
| my $log="/tmp/pre_deploy_sn.log"; | ||||
|  | ||||
| sub runcmd{ | ||||
|     my $cmd=shift; | ||||
|     `$cmd >> $log 2>&1`; | ||||
|     if($?){ | ||||
|         #print "run $cmd ....[error]\n"; | ||||
|         exit 1; | ||||
|     } | ||||
| } | ||||
|  | ||||
| my $cmd = "XCATMYSQLADMIN_PW=12345 XCATMYSQLROOT_PW=12345 /opt/xcat/bin/mysqlsetup -i"; | ||||
| runcmd("$cmd"); | ||||
|  | ||||
| $cmd="echo \"GRANT ALL on xcatdb.* TO xcatadmin@\'%\'  IDENTIFIED BY \'12345\'\;\" | mysql -u root -p12345"; | ||||
| runcmd("$cmd"); | ||||
|  | ||||
| my $xcatballpath = "/install/post/otherpkgs/$os/$arch/xcat"; | ||||
| $cmd="mkdir -p $xcatballpath/xcat-core && cp -r /xcat-core/* $xcatballpath/xcat-core && cp -r /xcat-dep $xcatballpath"; | ||||
| runcmd("$cmd"); | ||||
|  | ||||
| exit 0; | ||||
		Reference in New Issue
	
	Block a user