mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-26 13:10:35 +00:00
* update cases for task168, support environment variables in osimage inventory data and files * update label for this case * update label for this case * update according to comments * update according to comments
81 lines
3.1 KiB
Plaintext
81 lines
3.1 KiB
Plaintext
start:import_osimage_with_environments_in_yaml
|
|
description:this case is to verify if osimage import could support environment variables.
|
|
os:Linux
|
|
label:xcat_install,xcat_inventory,provision
|
|
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: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: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:export GITREPO="/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/gitrepo";export SWDIR="/opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/swdir";xcat-inventory import -f /opt/xcat/share/xcat/tools/autotest/testcase/xcat-inventory/templates/environment/test.environments.osimage.yaml
|
|
check:output=~Importing object: test.environments.osimage
|
|
check:output=~Inventory import successfully!
|
|
check:rc==0
|
|
cmd:lsdef -t osimage -o test.environments.osimage
|
|
check:rc==0
|
|
cmd:genimage test.environments.osimage
|
|
check:rc==0
|
|
cmd:packimage test.environments.osimage
|
|
check:rc==0
|
|
|
|
cmd:rinstall $$CN osimage=test.environments.osimage
|
|
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:cat /tmp/mountoutput/file.org
|
|
cmd:sleep 300
|
|
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
|
|
|
|
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
|
|
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:xdsh $$CN "cat /tmp/synclist"
|
|
check:rc==0
|
|
cmd:xdsh $$CN "cat /tmp/test1.postinstall"
|
|
check:rc==0
|
|
check:output=~test postisntall
|
|
cmd:xdsh $$CN "cat /tmp/test2.postinstall"
|
|
check:rc==0
|
|
check:output=~test postisntall
|
|
cmd:xdsh $$CN "rpm -qa |grep -i conserver-xcat"
|
|
check:rc==0
|
|
cmd:xdsh $$CN "rpm -qa |grep -i perl-Net-Telnet"
|
|
check:rc==0
|
|
cmd:xdsh $$CN "rpm -qa |grep -i tftp"
|
|
check:rc==0
|
|
cmd:xdsh $$CN "rpm -qa |grep -w dhcp"
|
|
check:rc==0
|
|
end
|