2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-31 10:06:39 +00:00

update case according to comments

This commit is contained in:
litingt@cn.ibm.com 2018-03-19 23:34:27 -04:00
parent c5950c1ad6
commit 30b6cee2ff

View File

@ -1,17 +1,10 @@
start:linux_diskless_kdump
os:Linux
cmd:fdisk -l
cmd:df -T
cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN
check:rc==0
cmd:makedns -n
check:rc==0
cmd:makeconservercf $$CN
check:rc==0
cmd:cat /etc/conserver.cf | grep $$CN
check:output=~$$CN
cmd:sleep 20
cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi
check:rc==0
cmd:makedhcp -n
@ -25,16 +18,22 @@ check:rc==0
cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi
check:rc==0
cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;cp $pkglistfile $pkglistfile.bak
cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\n" >> $pkglistfile; elif grep "Red Hat" /etc/*release;then echo -e "kexec-tools\ncrash\n" >> $pkglistfile;fi
check:rc==0
cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`;cp $exlistfile $exlistfile.bak
cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`; sed -i '/boot/d' $exlistfile
check:rc==0
cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;cp $postinstallfile $postinstallfile.bak
cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then sed -i "/\/tmp/ s/10/200/g" $postinstallfile; elif grep "Red Hat" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=200m 0 2" $postinstallfile;fi
check:rc==0
cmd:if [ ! -d /kdumpdir ]; then mkdir -p /kdumpdir && chmod 777 /kdumpdir; fi
cmd:if [ ! -f /etc/exports ] ;then touch /etc/exports;else cp /etc/exports /etc/exports.bak;fi
cmd:echo -e "/kdumpdir *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports && exportfs /etc/exports fi;
cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute dump=nfs://$$MN/kdumpdir
check:rc==0
@ -54,7 +53,6 @@ cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-ne
check:rc==0
check:output=~Provision node\(s\)\: $$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:sleep 900
cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done
@ -67,18 +65,17 @@ check:output=~booted
cmd:xdsh $$CN date
check:rc==0
check:output=~\d\d:\d\d:\d\d
cmd:xdsh $$CN mount
check:rc==0
check:output=~on / type tmpfs
cmd:sleep 120
cmd:ping $$CN -c 3
check:rc==0
check:output=~64 bytes from $$CN
cmd:xdsh $$CN echo 1 > /proc/sys/kernel/sysrq
cmd:xdsh $$CN echo c > /proc/sysrq-trigger
cmd:sleep 600
cmd:find /kdumpdir -name vmcore
check:rc==0
cmd:if [[ -s /hello ]]; then echo "this file is not empty";else echo "this file is empty"; fi
check:output=~not empty
cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;mv -f $pkglistfile.bak $pkglistfile
cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`;mv -f $exlistfile.bak $exlistfile
cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;mv -f $postinstallfile.bak $postinstallfile
cmd:if [ -f /etc/exports.bak ] ;then mv -f /etc/exports.bak /etc/exports; fi
end