mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-07-08 13:55:37 +00:00
[Draft] Test cases for service node pool (#4158)
* Test cases for service node pool - setup_sn_pool_tftp_sync_mode * Test cases for service node pool - set_xcatmaster_in_sn_pool_tftp_sync_mode * Test cases for service node pool - not_set_xcatmaster_in_sn_pool_tftp_sync_mode * Test cases for service node pool - set_disjointdhcps_in_sn_pool_tftp_sync_mode * Test cases for service node pool - cfg_wrong_cn_in_sn_pool_tftp_sync_mode
This commit is contained in:
@ -0,0 +1,155 @@
|
||||
start:cfg_wrong_cn_in_sn_pool_tftp_sync_mode
|
||||
description:The test case is intend to test the error handling of the service node pool when a compute has misconfigured node definition
|
||||
cmd:fdisk -l
|
||||
cmd:df -T
|
||||
#cmd:XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
|
||||
cmd:if [ ! -f /etc/xcat/cfgloc ];then XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__;fi
|
||||
check:rc==0
|
||||
|
||||
cmd:chtab key=nameservers site.value="<xcatmaster>"
|
||||
check:rc==0
|
||||
|
||||
cmd:makedns -n
|
||||
check:rc==0
|
||||
cmd:makeconservercf $$SN,$$CN
|
||||
check:rc==0
|
||||
cmd:cat /etc/conserver.cf | grep $$SN
|
||||
check:output=~$$SN
|
||||
cmd:cat /etc/conserver.cf | grep $$CN
|
||||
check:output=~$$CN
|
||||
cmd:sleep 20
|
||||
cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$SN -V; fi
|
||||
check:rc==0
|
||||
cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$CN -V; 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:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$CN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$CN;fi
|
||||
check:output=~$$CN
|
||||
cmd:chdef -t node $$SN,$$CN groups=service,all
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service profile=service installnic=mac
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service setupnfs=1 setupdhcp=1 setuptftp=1 setupnameserver=1 setupconserver=1 setupntp=1
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service nfsserver= tftpserver= xcatmaster= monserver=
|
||||
check:rc==0
|
||||
|
||||
cmd:copycds $$ISO
|
||||
check:rc==0
|
||||
|
||||
cmd:chdef -t site clustersite sharedtftp=0
|
||||
check:rc==0
|
||||
cmd:chdef -t site clustersite installloc=""
|
||||
check:rc==0
|
||||
|
||||
cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo .
|
||||
check:rc==0
|
||||
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .;
|
||||
check:rc==0
|
||||
|
||||
cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__
|
||||
check:rc==0
|
||||
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;
|
||||
check:rc==0
|
||||
|
||||
cmd:rinstall $$SN,$$CN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service
|
||||
check:rc==0
|
||||
check:output=~Provision node\(s\)\: $$SN $$CN
|
||||
|
||||
cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/customize_sleep_for_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
|
||||
|
||||
#Check status on SN after SN is installed
|
||||
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
|
||||
#after bug 2586 is fixed, following 2 lines should be removed.
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then xdsh $$SN service xcatd restart; fi
|
||||
check:rc==0
|
||||
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:rsync -auv --exclude 'autoinst' /install $$SN:/
|
||||
check:rc==0
|
||||
|
||||
#Check status on CN after CN is installed since CN is taken as another SN.
|
||||
cmd:ping $$CN -c 3
|
||||
check:rc==0
|
||||
check:output=~64 bytes from $$CN
|
||||
cmd:lsdef -l $$CN | grep status
|
||||
check:rc==0
|
||||
check:output=~booted
|
||||
cmd:xdsh $$CN date
|
||||
check:rc==0
|
||||
check:output=~\d\d:\d\d:\d\d
|
||||
#after bug 2586 is fixed, following 2 lines should be removed.
|
||||
cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "sles" ]];then xdsh $$CN service xcatd restart; fi
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "ps -ef | grep xcatd"
|
||||
check:rc==0
|
||||
check:output=~xcatd:
|
||||
cmd:xdsh $$CN "lsdef"
|
||||
check:rc==0
|
||||
check:output=~$$CN: $$CN
|
||||
cmd:xdsh $$CN "tabdump site"
|
||||
check:rc==0
|
||||
check:output=~tftpdir
|
||||
cmd:rsync -auv --exclude 'autoinst' /install $$CN:/
|
||||
check:rc==0
|
||||
|
||||
#create a test compute node, set it's xcatmaster as SN, set it's service node as SN and CN
|
||||
cmd:mkdef -t node -o compute1 groups=compute ip=10.0.0.199 mac=4a:c8:f7:de:d0:09 profile=compute os=__GETNODEATTR($$CN,os)__ arch=__GETNODEATTR($$CN,arch)__ netboot=__GETNODEATTR($$CN,netboot)__
|
||||
check:rc==0
|
||||
cmd:chdef -t node -o compute1 servicenode=$$SN,$$CN xcatmaster=$$SN
|
||||
check:rc==0
|
||||
cmd:makehosts compute1
|
||||
check:rc==0
|
||||
cmd:cat /etc/hosts
|
||||
check:output=~compute1
|
||||
cmd:cp /etc/resolv.conf /etc/resolv.conf.bak
|
||||
cmd:echo "nameserver $$MN" >> /etc/resolv.conf
|
||||
check:rc==0
|
||||
cmd:makedns -n
|
||||
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 compute1;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep compute1;fi
|
||||
check:output=~compute1
|
||||
cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN cat /var/lib/dhcp/db/dhcpd.leases|grep compute1;elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN cat /var/lib/dhcpd/dhcpd.leases|grep compute1;fi
|
||||
check:output=~compute1
|
||||
cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$CN cat /var/lib/dhcp/db/dhcpd.leases|grep compute1;elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$CN cat /var/lib/dhcpd/dhcpd.leases|grep compute1;fi
|
||||
check:output=~compute1
|
||||
##
|
||||
# Unset mac
|
||||
##
|
||||
cmd:chdef compute1 mac=
|
||||
check:rc==0
|
||||
cmd:nodeset compute1 osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-compute
|
||||
check:rc!=0
|
||||
check:output=~compute1: Error
|
||||
|
||||
cmd:noderm compute1
|
||||
check:rc==0
|
||||
cmd:cp -f /etc/resolv.conf.bak /etc/resolv.conf
|
||||
end
|
@ -0,0 +1,165 @@
|
||||
start:not_set_xcatmaster_in_sn_pool_tftp_sync_mode
|
||||
description: this case is to test when compute nodes' xcatmaster is not set in service node pool environment, compute node's provision files are correctly set after nodeset.
|
||||
cmd:fdisk -l
|
||||
cmd:df -T
|
||||
#cmd:XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
|
||||
cmd:if [ ! -f /etc/xcat/cfgloc ];then XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__;fi
|
||||
check:rc==0
|
||||
|
||||
cmd:chtab key=nameservers site.value="<xcatmaster>"
|
||||
check:rc==0
|
||||
|
||||
cmd:makedns -n
|
||||
check:rc==0
|
||||
cmd:makeconservercf $$SN,$$CN
|
||||
check:rc==0
|
||||
cmd:cat /etc/conserver.cf | grep $$SN
|
||||
check:output=~$$SN
|
||||
cmd:cat /etc/conserver.cf | grep $$CN
|
||||
check:output=~$$CN
|
||||
cmd:sleep 20
|
||||
cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$SN -V; fi
|
||||
check:rc==0
|
||||
cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$CN -V; 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:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$CN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$CN;fi
|
||||
check:output=~$$CN
|
||||
cmd:chdef -t node $$SN,$$CN groups=service,all
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service profile=service installnic=mac
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service setupnfs=1 setupdhcp=1 setuptftp=1 setupnameserver=1 setupconserver=1 setupntp=1
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service nfsserver= tftpserver= xcatmaster= monserver=
|
||||
check:rc==0
|
||||
|
||||
cmd:copycds $$ISO
|
||||
check:rc==0
|
||||
|
||||
|
||||
cmd:chdef -t site clustersite sharedtftp=0
|
||||
check:rc==0
|
||||
cmd:chdef -t site clustersite installloc=""
|
||||
check:rc==0
|
||||
|
||||
cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo .
|
||||
check:rc==0
|
||||
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .;
|
||||
check:rc==0
|
||||
|
||||
cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__
|
||||
check:rc==0
|
||||
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;
|
||||
check:rc==0
|
||||
|
||||
cmd:rinstall $$SN,$$CN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service
|
||||
check:rc==0
|
||||
check:output=~Provision node\(s\)\: $$SN $$CN
|
||||
|
||||
cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/customize_sleep_for_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
|
||||
|
||||
#Check status on SN after SN is installed
|
||||
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
|
||||
#after bug 2586 is fixed, following 2 lines should be removed.
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then xdsh $$SN service xcatd restart; fi
|
||||
check:rc==0
|
||||
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:rsync -auv --exclude 'autoinst' /install $$SN:/
|
||||
check:rc==0
|
||||
|
||||
#Check status on CN after CN is installed since CN is taken as another SN.
|
||||
cmd:ping $$CN -c 3
|
||||
check:rc==0
|
||||
check:output=~64 bytes from $$CN
|
||||
cmd:lsdef -l $$CN | grep status
|
||||
check:rc==0
|
||||
check:output=~booted
|
||||
cmd:xdsh $$CN date
|
||||
check:rc==0
|
||||
check:output=~\d\d:\d\d:\d\d
|
||||
#after bug 2586 is fixed, following 2 lines should be removed.
|
||||
cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "sles" ]];then xdsh $$CN service xcatd restart; fi
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "ps -ef |grep xcatd"
|
||||
check:rc==0
|
||||
check:output=~xcatd:
|
||||
cmd:xdsh $$CN "lsdef"
|
||||
check:rc==0
|
||||
check:output=~$$CN: $$CN
|
||||
cmd:xdsh $$CN "tabdump site"
|
||||
check:rc==0
|
||||
check:output=~tftpdir
|
||||
cmd:rsync -auv --exclude 'autoinst' /install $$CN:/
|
||||
check:rc==0
|
||||
|
||||
#create a test compute node, don't set it's xcatmaster, set it's service node as SN and CN
|
||||
cmd:mkdef -t node -o compute1 groups=compute ip=10.0.0.199 mac=4a:c8:f7:de:d0:09 profile=compute os=__GETNODEATTR($$CN,os)__ arch=__GETNODEATTR($$CN,arch)__ netboot=__GETNODEATTR($$CN,netboot)__
|
||||
check:rc==0
|
||||
cmd:chdef -t node -o compute1 servicenode=$$SN,$$CN xcatmaster=
|
||||
check:rc==0
|
||||
cmd:makehosts compute1
|
||||
check:rc==0
|
||||
cmd:cat /etc/hosts
|
||||
check:output=~compute1
|
||||
cmd:cp /etc/resolv.conf /etc/resolv.conf.bak
|
||||
cmd:echo "nameserver $$MN" >> /etc/resolv.conf
|
||||
check:rc==0
|
||||
cmd:makedns -n
|
||||
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 compute1;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep compute1;fi
|
||||
check:output=~compute1
|
||||
cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN cat /var/lib/dhcp/db/dhcpd.leases|grep compute1;elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN cat /var/lib/dhcpd/dhcpd.leases|grep compute1;fi
|
||||
check:output=~compute1
|
||||
cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$CN cat /var/lib/dhcp/db/dhcpd.leases|grep compute1;elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$CN cat /var/lib/dhcpd/dhcpd.leases|grep compute1;fi
|
||||
check:output=~compute1
|
||||
cmd:nodeset compute1 osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-compute
|
||||
check:rc==0
|
||||
check:output=~compute1: install __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-compute
|
||||
cmd:if [[ "__GETNODEATTR($$CN,netboot)__" =~ "grub2" ]]; then cat /tftpboot/boot/__GETNODEATTR($$CN,netboot)__/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "yaboot" ]];then cat /tftpboot/yaboot.conf*;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "xnba" ]];then cat /tftpboot/xcat/xnba/nodes/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "petitboot" ]];then cat /tftpboot/petitboot/compute1;fi
|
||||
check:output=~http://$$MN|http://$$MASTERIP|http://${next-server}
|
||||
cmd:if [[ "__GETNODEATTR($$CN,netboot)__" =~ "grub2" ]]; then xdsh $$SN cat /tftpboot/boot/__GETNODEATTR($$CN,netboot)__/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "yaboot" ]];then xdsh $$SN cat /tftpboot/yaboot.conf*;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "xnba" ]];then xdsh $$SN cat /tftpboot/xcat/xnba/nodes/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "petitboot" ]];then xdsh $$SN cat /tftpboot/petitboot/compute1;fi
|
||||
check:output=~http://$$SN|http://__GETNODEATTR($$SN,ip)__|http://${next-server}
|
||||
cmd:if [[ "__GETNODEATTR($$CN,netboot)__" =~ "grub2" ]]; then xdsh $$CN cat /tftpboot/boot/__GETNODEATTR($$CN,netboot)__/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "yaboot" ]];then xdsh $$CN cat /tftpboot/yaboot.conf*;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "xnba" ]];then xdsh $$CN cat /tftpboot/xcat/xnba/nodes/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "petitboot" ]];then xdsh $$CN cat /tftpboot/petitboot/compute1;fi
|
||||
check:output=~http://$$CN|http://__GETNODEATTR($$CN,ip)__|http://${next-server}
|
||||
|
||||
#process the speicial case when netboot=petitboot, since we have no physical machine test environment at the moment
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64le" ]] && [[ "__GETNODEATTR($$CN,netboot)__" != "petitboot" ]]; then chdef compute1 netboot=petitboot;nodeset compute1 osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute;cat /tftpboot/petitboot/compute1;else echo "http://$$MN";fi
|
||||
check:output=~http://$$MN|http://$$MASTERIP|http://${next-server}
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64le" ]]; then xdsh $$SN cat /tftpboot/petitboot/compute1;else echo "http://$$SN";fi
|
||||
check:output=~http://$$SN|http://__GETNODEATTR($$SN,ip)__|http://${next-server}
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64le" ]]; then xdsh $$CN cat /tftpboot/petitboot/compute1;else echo "http://$$CN";fi
|
||||
check:output=~http://$$CN|http://__GETNODEATTR($$CN,ip)__|http://${next-server}
|
||||
|
||||
cmd:noderm compute1
|
||||
check:rc==0
|
||||
cmd:cp -f /etc/resolv.conf.bak /etc/resolv.conf
|
||||
end
|
@ -0,0 +1,118 @@
|
||||
start:set_disjointdhcps_in_sn_pool_tftp_sync_mode
|
||||
description: Verify the disjointdhcps feature when petitboot is used for OS loader.
|
||||
cmd:rmdef testnode1
|
||||
cmd:rm -f /tftpboot/petitboot/testnode1
|
||||
cmd:mkdef -t node -o testnode1 arch=ppc64le cons=bmc groups=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=ipmi profile=compute os=rhels7.99
|
||||
check:rc==0
|
||||
cmd:cp -f /etc/hosts /etc/hosts.xcattestbak
|
||||
cmd:echo "10.1.1.200 testnode1" >> /etc/hosts
|
||||
cmd:makedns -n
|
||||
check:rc==0
|
||||
cmd:chdef testnode1 netboot=petitboot addkcmdline=debug
|
||||
check:rc==0
|
||||
cmd:mkdef "rhels7.99-ppc64le-install-compute" -u profile=compute provmethod=install osvers=rhels7.99 osarch=ppc64le
|
||||
cmd:xdsh $$SN 'mkdir -p /install/rhels7.99/ppc64le'
|
||||
cmd:xdsh $$SN 'mkdir -p /install/rhels7.99/ppc64le/ppc/ppc64le'
|
||||
cmd:xdsh $$SN 'echo blah >/install/rhels7.99/ppc64le/ppc/ppc64le/vmlinuz'
|
||||
cmd:xdsh $$SN 'echo blah >/install/rhels7.99/ppc64le/ppc/ppc64le/initrd.img'
|
||||
cmd:xdsh $$CN 'mkdir -p /install/rhels7.99/ppc64le'
|
||||
cmd:xdsh $$CN 'mkdir -p /install/rhels7.99/ppc64le/ppc/ppc64le'
|
||||
cmd:xdsh $$CN 'echo blah >/install/rhels7.99/ppc64le/ppc/ppc64le/vmlinuz'
|
||||
cmd:xdsh $$CN 'echo blah >/install/rhels7.99/ppc64le/ppc/ppc64le/initrd.img'
|
||||
cmd:mkdir -p /install/rhels7.99/ppc64le
|
||||
cmd:mkdir -p /install/rhels7.99/ppc64le/ppc/ppc64le
|
||||
cmd:echo blah >/install/rhels7.99/ppc64le/ppc/ppc64le/vmlinuz
|
||||
cmd:echo blah >/install/rhels7.99/ppc64le/ppc/ppc64le/initrd.img
|
||||
cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute
|
||||
check:rc==0
|
||||
cmd:grep "debug" /tftpboot/petitboot/testnode1
|
||||
check:rc==0
|
||||
#cmd:makedhcp -q testnode1 | grep ^testnode1:
|
||||
#check:rc==0
|
||||
cmd:nodeset testnode1 offline
|
||||
check:rc==0
|
||||
cmd:grep "debug" /tftpboot/petitboot/testnode1
|
||||
check:rc!=0
|
||||
cmd:chdef -t site sharedtftp=0 disjointdhcps=0
|
||||
check:rc==0
|
||||
cmd:xdsh $$SN 'umount /tftpboot'
|
||||
cmd:xdsh $$CN 'umount /tftpboot'
|
||||
|
||||
##
|
||||
# Do rsync against /tftpboot directory
|
||||
##
|
||||
##
|
||||
|
||||
cmd:cd / && rsync -P -p -r -o -g -v tftpboot $$SN:/
|
||||
check:rc==0
|
||||
cmd:cd / && rsync -P -p -r -o -g -v tftpboot $$CN:/
|
||||
check:rc==0
|
||||
|
||||
cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute
|
||||
check:rc==0
|
||||
cmd:xdsh $$SN 'test -f /tftpboot/petitboot/testnode1'
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN 'test -f /tftpboot/petitboot/testnode1'
|
||||
check:rc==0
|
||||
cmd:nodeset testnode1 offline
|
||||
check:rc==0
|
||||
|
||||
##
|
||||
# Do testing
|
||||
##
|
||||
##
|
||||
|
||||
cmd:chdef -t site disjointdhcps=1
|
||||
check:rc==0
|
||||
cmd:chdef -t node testnode1 servicenode=$$SN
|
||||
|
||||
check:rc==0
|
||||
cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute
|
||||
check:rc==0
|
||||
cmd:test -f /tftpboot/petitboot/testnode1
|
||||
check:rc!=0
|
||||
cmd:xdsh $$SN 'test -f /tftpboot/petitboot/testnode1'
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN 'test -f /tftpboot/petitboot/testnode1'
|
||||
check:rc!=0
|
||||
cmd:nodeset testnode1 offline
|
||||
check:rc==0
|
||||
# DHCP dynamic range
|
||||
cmd:chdef -t network 20_0_0_0-255_0_0_0 net=20.0.0.0 mask=255.0.0.0 dynamicrange=20.0.0.1-20.0.0.2 tftpserver=$$SN dhcpserver=$$CN
|
||||
check:rc==0
|
||||
cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute
|
||||
#check:rc==0
|
||||
cmd:xdsh $$SN 'test -f /tftpboot/petitboot/testnode1'
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN 'test -f /tftpboot/petitboot/testnode1'
|
||||
check:rc!=0
|
||||
##
|
||||
# Check the DHCP lease file
|
||||
##
|
||||
cmd:xdsh $$CN 'cat /var/lib/dhcp/db/dhcpd.leases /var/lib/dhcpd/dhcpd.leases 2>/dev/null' | grep e6:d4:d2:3a:ad:06
|
||||
check:rc==0
|
||||
|
||||
##
|
||||
# Clean up
|
||||
##
|
||||
##
|
||||
|
||||
#cmd:chdef -t site sharedtftp=1
|
||||
#check:rc==0
|
||||
cmd:chdef -t site disjointdhcps=0
|
||||
check:rc==0
|
||||
cmd:xdsh $$SN 'rm -rf /tftpboot'
|
||||
cmd:xdsh $$CN 'rm -rf /tftpboot'
|
||||
cmd:chdef -t node -o testnode1 ip=
|
||||
check:rc==0
|
||||
cmd:cp -f /etc/hosts.xcattestbak /etc/hosts
|
||||
cmd:getent hosts testnode1 | grep testnode1
|
||||
check:rc!=0
|
||||
cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute
|
||||
check:rc!=0
|
||||
cmd:noderm testnode1
|
||||
cmd:rmdef -t osimage -o "rhels7.99-ppc64le-install-compute"
|
||||
cmd:rm -rf /install/rhels7.99
|
||||
cmd:xdsh $$SN 'rm -rf /install/rhels7.99'
|
||||
cmd:xdsh $$CN 'rm -rf /install/rhels7.99'
|
||||
end
|
@ -0,0 +1,165 @@
|
||||
start:set_xcatmaster_in_sn_pool_tftp_sync_mode
|
||||
description: this case is to test when compute nodes' xcatmaster is set in service node pool environment,compute node's provision files are correctly set after nodeset.
|
||||
cmd:fdisk -l
|
||||
cmd:df -T
|
||||
#cmd:XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
|
||||
cmd:if [ ! -f /etc/xcat/cfgloc ];then XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__;fi
|
||||
check:rc==0
|
||||
|
||||
cmd:chtab key=nameservers site.value="<xcatmaster>"
|
||||
check:rc==0
|
||||
|
||||
cmd:makedns -n
|
||||
check:rc==0
|
||||
cmd:makeconservercf $$SN,$$CN
|
||||
check:rc==0
|
||||
cmd:cat /etc/conserver.cf | grep $$SN
|
||||
check:output=~$$SN
|
||||
cmd:cat /etc/conserver.cf | grep $$CN
|
||||
check:output=~$$CN
|
||||
cmd:sleep 20
|
||||
cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$SN -V; fi
|
||||
check:rc==0
|
||||
cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$CN -V; 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:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$CN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$CN;fi
|
||||
check:output=~$$CN
|
||||
cmd:chdef -t node $$SN,$$CN groups=service,all
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service profile=service installnic=mac
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service setupnfs=1 setupdhcp=1 setuptftp=1 setupnameserver=1 setupconserver=1 setupntp=1
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service nfsserver= tftpserver= xcatmaster= monserver=
|
||||
check:rc==0
|
||||
|
||||
cmd:copycds $$ISO
|
||||
check:rc==0
|
||||
|
||||
cmd:chdef -t site clustersite sharedtftp=0
|
||||
check:rc==0
|
||||
cmd:chdef -t site clustersite installloc=""
|
||||
check:rc==0
|
||||
|
||||
cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo .
|
||||
check:rc==0
|
||||
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .;
|
||||
check:rc==0
|
||||
|
||||
cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__
|
||||
check:rc==0
|
||||
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;
|
||||
check:rc==0
|
||||
|
||||
cmd:rinstall $$SN,$$CN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service
|
||||
check:rc==0
|
||||
check:output=~Provision node\(s\)\: $$SN $$CN
|
||||
|
||||
cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/customize_sleep_for_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
|
||||
|
||||
#Check status on SN after SN is installed
|
||||
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
|
||||
#after bug 2586 is fixed, following 2 lines should be removed.
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then xdsh $$SN service xcatd restart; fi
|
||||
check:rc==0
|
||||
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:rsync -auv --exclude 'autoinst' /install $$SN:/
|
||||
check:rc==0
|
||||
|
||||
#Check status on CN after CN is installed since CN is taken as another SN.
|
||||
cmd:ping $$CN -c 3
|
||||
check:rc==0
|
||||
check:output=~64 bytes from $$CN
|
||||
cmd:lsdef -l $$CN | grep status
|
||||
check:rc==0
|
||||
check:output=~booted
|
||||
cmd:xdsh $$CN date
|
||||
check:rc==0
|
||||
check:output=~\d\d:\d\d:\d\d
|
||||
#after bug 2586 is fixed, following 2 lines should be removed.
|
||||
cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "sles" ]];then xdsh $$CN service xcatd restart; fi
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "ps -ef |grep xcatd"
|
||||
check:rc==0
|
||||
check:output=~xcatd:
|
||||
cmd:xdsh $$CN "lsdef"
|
||||
check:rc==0
|
||||
check:output=~$$CN: $$CN
|
||||
cmd:xdsh $$CN "tabdump site"
|
||||
check:rc==0
|
||||
check:output=~tftpdir
|
||||
cmd:rsync -auv --exclude 'autoinst' /install $$CN:/
|
||||
check:rc==0
|
||||
|
||||
|
||||
#create a test compute node, set it's xcatmaster as SN, set it's service node as SN and CN
|
||||
cmd:mkdef -t node -o compute1 groups=compute ip=10.0.0.199 mac=4a:c8:f7:de:d0:09 profile=compute os=__GETNODEATTR($$CN,os)__ arch=__GETNODEATTR($$CN,arch)__ netboot=__GETNODEATTR($$CN,netboot)__
|
||||
check:rc==0
|
||||
cmd:chdef -t node -o compute1 servicenode=$$SN,$$CN xcatmaster=$$SN
|
||||
check:rc==0
|
||||
cmd:makehosts compute1
|
||||
check:rc==0
|
||||
cmd:cat /etc/hosts
|
||||
check:output=~compute1
|
||||
cmd:cp /etc/resolv.conf /etc/resolv.conf.bak
|
||||
cmd:echo "nameserver $$MN" >> /etc/resolv.conf
|
||||
check:rc==0
|
||||
cmd:makedns -n
|
||||
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 compute1;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep compute1;fi
|
||||
check:output=~compute1
|
||||
cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN cat /var/lib/dhcp/db/dhcpd.leases|grep compute1;elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN cat /var/lib/dhcpd/dhcpd.leases|grep compute1;fi
|
||||
check:output=~compute1
|
||||
cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$CN cat /var/lib/dhcp/db/dhcpd.leases|grep compute1;elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$CN cat /var/lib/dhcpd/dhcpd.leases|grep compute1;fi
|
||||
check:output=~compute1
|
||||
cmd:nodeset compute1 osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-compute
|
||||
check:rc==0
|
||||
check:output=~compute1: install __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-compute
|
||||
cmd:if [[ "__GETNODEATTR($$CN,netboot)__" =~ "grub2" ]]; then cat /tftpboot/boot/__GETNODEATTR($$CN,netboot)__/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "yaboot" ]];then cat /tftpboot/yaboot.conf*;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "xnba" ]];then cat /tftpboot/xcat/xnba/nodes/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "petitboot" ]];then cat /tftpboot/petitboot/compute1;fi
|
||||
check:output=~http://$$SN|http://__GETNODEATTR($$SN,ip)__|http://${next-server}
|
||||
cmd:if [[ "__GETNODEATTR($$CN,netboot)__" =~ "grub2" ]]; then xdsh $$SN cat /tftpboot/boot/__GETNODEATTR($$CN,netboot)__/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "yaboot" ]];then xdsh $$SN cat /tftpboot/yaboot.conf*;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "xnba" ]];then xdsh $$SN cat /tftpboot/xcat/xnba/nodes/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "petitboot" ]];then xdsh $$SN cat /tftpboot/petitboot/compute1;fi
|
||||
check:output=~http://$$SN|http://__GETNODEATTR($$SN,ip)__|http://${next-server}
|
||||
cmd:if [[ "__GETNODEATTR($$CN,netboot)__" =~ "grub2" ]]; then xdsh $$CN cat /tftpboot/boot/__GETNODEATTR($$CN,netboot)__/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "yaboot" ]];then xdsh $$CN cat /tftpboot/yaboot.conf*;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "xnba" ]];then xdsh $$CN cat /tftpboot/xcat/xnba/nodes/compute1;elif [[ "__GETNODEATTR($$CN,netboot)__" =~ "petitboot" ]];then xdsh $$CN cat /tftpboot/petitboot/compute1;fi
|
||||
check:output=~http://$$SN|http://__GETNODEATTR($$SN,ip)__|http://${next-server}
|
||||
|
||||
#process the speicial case when netboot=petitboot, since we have no physical machine test environment at the moment
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64le" ]] && [[ "__GETNODEATTR($$CN,netboot)__" != "petitboot" ]]; then chdef compute1 netboot=petitboot;nodeset compute1 osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute;cat /tftpboot/petitboot/compute1;else echo "http://$$SN";fi
|
||||
check:output=~http://$$SN|http://__GETNODEATTR($$SN,ip)__|http://${next-server}
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64le" ]]; then xdsh $$SN cat /tftpboot/petitboot/compute1;else echo "http://$$SN";fi
|
||||
check:output=~http://$$SN|http://__GETNODEATTR($$SN,ip)__|http://${next-server}
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64le" ]]; then xdsh $$CN cat /tftpboot/petitboot/compute1;else echo "http://$$SN";fi
|
||||
check:output=~http://$$SN|http://__GETNODEATTR($$SN,ip)__|http://${next-server}
|
||||
|
||||
cmd:noderm compute1
|
||||
check:rc==0
|
||||
cmd:cp -f /etc/resolv.conf.bak /etc/resolv.conf
|
||||
end
|
118
xCAT-test/autotest/testcase/snpool/setup_sn_pool_tftp_sync_mode
Normal file
118
xCAT-test/autotest/testcase/snpool/setup_sn_pool_tftp_sync_mode
Normal file
@ -0,0 +1,118 @@
|
||||
start:setup_sn_pool_tftp_sync_mode
|
||||
description: this case is to test when sharedtftp=0 and installloc=/install are not set on mn, after all service nodes are installed, /tftpboot and /install directory on all service nodes are separated and need to be rsynced. Since test framework only support 1 sn and 1 cn parameter. This case will install CN as another service node.
|
||||
cmd:fdisk -l
|
||||
cmd:df -T
|
||||
#cmd:XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
|
||||
cmd:if [ ! -f /etc/xcat/cfgloc ];then XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__;fi
|
||||
check:rc==0
|
||||
|
||||
cmd:chtab key=nameservers site.value="<xcatmaster>"
|
||||
check:rc==0
|
||||
|
||||
cmd:makedns -n
|
||||
check:rc==0
|
||||
cmd:makeconservercf $$SN,$$CN
|
||||
check:rc==0
|
||||
cmd:cat /etc/conserver.cf | grep $$SN
|
||||
check:output=~$$SN
|
||||
cmd:cat /etc/conserver.cf | grep $$CN
|
||||
check:output=~$$CN
|
||||
cmd:sleep 20
|
||||
cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$SN -V; fi
|
||||
check:rc==0
|
||||
cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then getmacs -D $$CN -V; 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:if cat /etc/*release | grep SUSE >/dev/null ; then cat /var/lib/dhcp/db/dhcpd.leases | grep $$CN ; elif cat /etc/*release | grep "Red Hat" >/dev/null ; then cat /var/lib/dhcpd/dhcpd.leases | grep $$CN ; fi
|
||||
check:output=~$$CN
|
||||
cmd:chdef -t node $$SN,$$CN groups=service,all
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service profile=service installnic=mac
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service setupnfs=1 setupdhcp=1 setuptftp=1 setupnameserver=1 setupconserver=1 setupntp=1
|
||||
check:rc==0
|
||||
cmd:chdef -t group -o service nfsserver= tftpserver= xcatmaster= monserver=
|
||||
check:rc==0
|
||||
|
||||
cmd:copycds $$ISO
|
||||
check:rc==0
|
||||
|
||||
cmd:chdef -t site clustersite sharedtftp=0
|
||||
check:rc==0
|
||||
cmd:chdef -t site clustersite installloc=""
|
||||
check:rc==0
|
||||
|
||||
cmd:cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-core && createrepo .
|
||||
check:rc==0
|
||||
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; tmp=${ver%.*};ver=`echo "$tmp"|sed 's:[a-zA-Z]::g'`;cd /install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__/xcat/xcat-dep/$path$ver/__GETNODEATTR($$SN,arch)__ && createrepo .;
|
||||
check:rc==0
|
||||
|
||||
cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkgdir=/install/post/otherpkgs/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__
|
||||
check:rc==0
|
||||
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "rh" ]]; then path="rh";elif [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then path="sles";fi; ver="__GETNODEATTR($$SN,os)__"; chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service otherpkglist=/opt/xcat/share/xcat/install/$path/service.${ver%.*}.__GETNODEATTR($$SN,arch)__.otherpkgs.pkglist;
|
||||
check:rc==0
|
||||
|
||||
cmd:rinstall $$SN,$$CN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service
|
||||
check:rc==0
|
||||
check:output=~Provision node\(s\)\: $$SN $$CN
|
||||
|
||||
cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.leases; elif [[ -f /var/lib/dhcpd/dhcpd.leases ]];then cat /var/lib/dhcpd/dhcpd.leases;elif [[ -f /var/lib/dhcp/dhcpd.leases ]];then cat /var/lib/dhcp/dhcpd.leases; fi
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/customize_sleep_for_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__
|
||||
|
||||
#Check status on SN after SN is installed
|
||||
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
|
||||
#after bug 2586 is fixed, following 2 lines should be removed.
|
||||
cmd:if [[ "__GETNODEATTR($$SN,os)__" =~ "sles" ]];then xdsh $$SN service xcatd restart; fi
|
||||
check:rc==0
|
||||
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:rsync -auv --exclude 'autoinst' /install $$SN:/
|
||||
check:rc==0
|
||||
|
||||
#Check status on CN after CN is installed since CN is taken as another SN.
|
||||
cmd:ping $$CN -c 3
|
||||
check:rc==0
|
||||
check:output=~64 bytes from $$CN
|
||||
cmd:lsdef -l $$CN | grep status
|
||||
check:rc==0
|
||||
check:output=~booted
|
||||
cmd:xdsh $$CN date
|
||||
check:rc==0
|
||||
check:output=~\d\d:\d\d:\d\d
|
||||
#after bug 2586 is fixed, following 2 lines should be removed.
|
||||
cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "sles" ]] ; then xdsh $$CN service xcatd restart ; fi
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "ps -ef |grep xcatd"
|
||||
check:rc==0
|
||||
check:output=~xcatd:
|
||||
cmd:xdsh $$CN "lsdef"
|
||||
check:rc==0
|
||||
check:output=~$$CN: $$CN
|
||||
cmd:xdsh $$CN "tabdump site"
|
||||
check:rc==0
|
||||
check:output=~tftpdir
|
||||
cmd:rsync -auv --exclude 'autoinst' /install $$CN:/
|
||||
check:rc==0
|
||||
end
|
Reference in New Issue
Block a user