diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed new file mode 100644 index 000000000..713b04959 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat_postscripts_failed @@ -0,0 +1,69 @@ +start:reg_linux_diskfull_installation_flat_postscripts_failed +description:This case is for postscripts failed the status will return failed during diskfull installation. +attribute:$$CN-The operation object of diskfull installation. +os:Linux + +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:MINIISO=NUll;if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi +check:rc==0 + +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 +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:chtab key=extntpservers site.value="" +check:rc==0 +cmd:chtab key=ntpservers site.value="" +check:rc==0 +cmd:makentp +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:sleep 10 +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +check:rc==0 +cmd:copycds $$ISO +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/setup_postscript_failed.sh +check:rc==0 +cmd:chmod 777 /install/postscripts/test +check:rc==0 +cmd:chdef $$CN -p postscripts=test +check:rc==0 +cmd:lsdef -l $$CN +check:rc==0 +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:rc==0 +check:output=~Provision node\(s\)\: $$CN + +cmd:sleep 300 +cmd:a=0;while ! `lsdef -l $$CN|grep status|grep failed >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done + +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=~failed +cmd:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +cmd:xdsh $$CN mount +check:rc==0 +cmd:sleep 120 +cmd:lsdef -l $$CN +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" +cmd: chdef -t node -o $$CN -m postscripts="test"; rm -rf /install/postscripts/test +end diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed new file mode 100644 index 000000000..3a1d12b57 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed @@ -0,0 +1,77 @@ +start:reg_linux_diskless_installation_flat_postscripts_failed +description:This case is for postscripts failed the status will return failed during diskless installation. +attribute:$$CN-The operation object of diskless installation. +os:Linux + +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 +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done +check:rc==0 + +cmd:copycds $$ISO +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/setup_postscript_failed.sh +check:rc==0 +cmd:chmod 777 /install/postscripts/test +check:rc==0 +cmd:chdef $$CN -p postscripts=test +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:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi +cmd:mount |sort > /tmp/mountoutput/file.org +cmd:cat /tmp/mountoutput/file.org +cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +cmd:mount |sort > /tmp/mountoutput/file.new +cmd:cat /tmp/mountoutput/file.new +cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new +check:rc==0 +cmd:rm -rf /tmp/mountoutput +cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 + +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute +check:rc==0 +check:output=~Provision node\(s\)\: $$CN + +cmd:sleep 900 +cmd:a=0;while ! `lsdef -l $$CN|grep status|grep failed >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done + +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=~failed +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:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi +check:rc==0 +cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" +cmd: chdef -t node -o $$CN -m postscripts="test"; rm -rf /install/postscripts/test +end diff --git a/xCAT-test/autotest/testcase/installation/setup_postscript_failed.sh b/xCAT-test/autotest/testcase/installation/setup_postscript_failed.sh new file mode 100755 index 000000000..ebc29ec64 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/setup_postscript_failed.sh @@ -0,0 +1,6 @@ +#!/bin/bash +cat >> /install/postscripts/test <