2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-24 05:11:12 +00:00
Files
xcat-core/xCAT-test/autotest/testcase/nodeset/cases0
GONG Jie b723610039 Add test cases for command nodeset for grub2/petitboot/yaboot (#3155)
* Add test cases for command nodeset for grub2/petitboot/yaboot

* Revise nodeset test cases and add more negative verifications

* Revise nodeset test cases by add more verifications with makedhcp and getent

* Temporary remove all dhcp lease checking from nodeset test cases, since it is rely on DNS service

* Minor tweaks while doing unit tests
2017-06-22 14:03:48 +08:00

350 lines
14 KiB
Plaintext

start:nodeset_stat
os:Linux
cmd:nodeset $$CN stat
check:rc==0
check:output=~$$CN:\s+[discover|boot|reboot|install|netboot|shell|standby]
end
start:nodeset_noderange
os:Linux
cmd:nodeset $$CN test
check:rc!=0
check:output=~Error
end
start:nodeset_check_yaboot_no
os:rhels
cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar hcp=hmc1 hwtype=lpar id=1 ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi parent=fsp1 pprofile=testnode1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1
check:rc==0
cmd:chdef testnode1 os=rhels7.5 netboot=yaboot
check:rc==0
cmd: mkdef "rhels7.5-ppc64-install-compute" -u profile=compute provmethod=install osvers=rhels7.5
check:rc==0
cmd:nodeset testnode1 osimage="rhels7.5-ppc64-install-compute"
check:rc!=0
check:output=~yaboot is not valid when provisioning
check:output=~valid options: "grub2,grub2-tftp,grub2-http"
cmd:rmdef -t osimage -o "rhels7.5-ppc64-install-compute"
cmd:noderm testnode1
end
start:nodeset_check_yaboot_yes
os:rhels
cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar hcp=hmc1 hwtype=lpar id=1 ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi parent=fsp1 pprofile=testnode1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1
check:rc==0
cmd:chdef testnode1 os=rhels5.5 netboot=yaboot
check:rc==0
cmd: mkdef "rhels5.5-ppc64-install-compute" -u profile=compute provmethod=install osvers=rhels5.5
check:rc==0
cmd:nodeset testnode1 osimage="rhels5.5-ppc64-install-compute"
check:rc!=0
check:output=~Install image not found in /install/rhels5.5/ppc64
cmd:rmdef -t osimage -o "rhels5.5-ppc64-install-compute"
cmd:noderm testnode1
end
start:nodeset_check_grub2_yes
os:rhels
cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar hcp=hmc1 hwtype=lpar id=1 ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi parent=fsp1 pprofile=testnode1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1
check:rc==0
cmd:chdef testnode1 os=rhels7.5 netboot=grub2
check:rc==0
cmd: mkdef "rhels7.5-ppc64-install-compute" -u profile=compute provmethod=install osvers=rhels7.5
check:rc==0
cmd:nodeset testnode1 osimage="rhels7.5-ppc64-install-compute"
check:output=~Install image not found in /install/rhels7.5/ppc64
cmd:rmdef -t osimage -o "rhels7.5-ppc64-install-compute"
cmd:noderm testnode1
check:rc==0
end
start:nodeset_check_grub2_no
os:rhels
cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar hcp=hmc1 hwtype=lpar id=1 ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi parent=fsp1 pprofile=testnode1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1
check:rc==0
cmd:chdef testnode1 os=rhels6.8 netboot=grub2
check:rc==0
cmd: mkdef "rhels6.8-ppc64-install-compute" -u profile=compute provmethod=install osvers=rhels6.8
check:rc==0
cmd:nodeset testnode1 osimage="rhels6.8-ppc64-install-compute"
check:rc!=0
check:output=~grub2 is not valid when provisioning rhels6.8-ppc64-install-compute
check:output=~valid options: "yaboot"
cmd:rmdef -t osimage -o "rhels6.8-ppc64-install-compute"
cmd:noderm testnode1
end
start:nodeset_check_grub2_ubuntu
os:ubuntu
cmd:mkdef -t node -o testnode1 arch=x86_64 cons=kvm groups=kvm ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=kvm monserver=10.1.1.1 nameservers=10.1.1.1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1
check:rc==0
cmd:chdef testnode1 os=ubuntu14.04.5 netboot=grub2
check:rc==0
cmd: mkdef "ubuntu14.04.5-x86_64-install-compute" -u profile=compute provmethod=install osvers=ubuntu14.04.5
check:rc==0
cmd:nodeset testnode1 osimage="ubuntu14.04.5-x86_64-install-compute"
check:rc!=0
check:output=~grub2 is not valid when provisioning ubuntu14.04.5-x86_64-install-compute
check:output=~valid options: "xnba,pxe"
cmd:rmdef -t osimage -o "ubuntu14.04.5-x86_64-install-compute"
cmd:noderm testnode1
end
start:nodeset_check_grub2_sles11
os:sles
cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar hcp=hmc1 hwtype=lpar id=1 ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi parent=fsp1 pprofile=testnode1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1
check:rc==0
cmd:chdef testnode1 os=sles11.4 netboot=grub2
check:rc==0
cmd:copycds $$ISO
check:rc==0
cmd:nodeset testnode1 osimage="sles11.4-ppc64-install-compute"
check:rc!=0
check:output=~install sles11.4-ppc64-compute
cmd:noderm testnode1
end
start:nodeset_check_yaboot_sles11
os:sles
cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar hcp=hmc1 hwtype=lpar id=1 ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi parent=fsp1 pprofile=testnode1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1
check:rc==0
cmd:chdef testnode1 os=sles11.4 netboot=yaboot
check:rc==0
cmd: mkdef "sles11.9-ppc64-install-compute" -u profile=compute provmethod=install osvers=sles11.9
check:rc==0
cmd:nodeset testnode1 osimage="sles11.9-ppc64-install-compute"
check:rc!=0
check:output=~yaboot is not valid when provisioning sles11.9-ppc64-install-compute
cmd:rmdef -t osimage -o "sles11.9-ppc64-install-compute"
cmd:noderm testnode1
end
start:nodeset_check_grub2_sles12
os:sles
cmd:mkdef -t node -o testnode1 arch=ppc64el cons=kvm groups=kvm ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=kvm monserver=10.1.1.1 nameservers=10.1.1.1 1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1
check:rc==0
cmd:chdef testnode1 os=sles12 netboot=grub2
check:rc==0
cmd: mkdef "sles12-ppc64el-install-compute" -u profile=compute provmethod=install osvers=sles12
check:rc==0
cmd:nodeset testnode1 osimage="sles12-ppc64el-install-compute"
check:rc!=0
check:output=~Failed to detect copycd configured install source at /install/sles12
cmd:rmdef -t osimage -o "sles12-ppc64el-install-compute"
cmd:noderm testnode1
end
start:nodeset_check_yaboot_sles12
os:sles
cmd:mkdef -t node -o testnode1 arch=ppc64el cons=kvm groups=kvm ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=kvm monserver=10.1.1.1 nameservers=10.1.1.1 1 profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1
check:rc==0
cmd:chdef testnode1 os=sles12 netboot=yaboot
check:rc==0
cmd: mkdef "sles12-ppc64el-install-compute" -u profile=compute provmethod=install osvers=sles12
check:rc==0
cmd:nodeset testnode1 osimage="sles12-ppc64el-install-compute"
check:rc!=0
check:output=~yaboot is not valid when provisioning sles12-ppc64el-install-compute
cmd:rmdef -t osimage -o "sles12-ppc64el-install-compute"
cmd:noderm testnode1
end
start:nodeset_check_petitboot
os:rhels
cmd:mkdef -t node -o testnode1 arch=ppc64el cons=ipmi groups=pbmc mgt=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1
check:rc==0
cmd:chdef testnode1 os=rhels7.5 netboot=petitboot
eck:rc==0
cmd: mkdef "rhels7.5-ppc64el-install-compute" -u profile=compute provmethod=install osvers=rhels7.5
check:rc==0
cmd:nodeset testnode1 osimage="rhels7.5-ppc64el-install-compute"
check:rc==0
cmd:rmdef -t osimage -o "rhels7.5-ppc64el-install-compute"
cmd:noderm testnode1
end
start:nodeset_check_warninginfo
cmd:mkdef -t node -o testnode1 arch=ppc64el cons=ipmi groups=pbmc mgt=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 monserver=10.1.1.1 nameservers=10.1.1.1 nodetype=ppc,osi profile=compute tftpserver=10.1.1.1 xcatmaster=10.1.1.1 netboot=petitboot
check:rc==0
cmd:nodeset testnode1 osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute
check:rc==0
check:output=~Warning: testnode1: petitboot might be invalid|testnode1 could not be resolved
cmd:noderm testnode1
end
start:nodeset_xnba
description: Verify when xnba is used for OS loader, whether the configuration files under /tftpboot can be generated corrently
cmd:rmdef testnode1
cmd:rm -f /tftpboot/xcat/xnba/nodes/testnode1 /tftpboot/xcat/xnba/nodes/testnode1.elilo
cmd:mkdef -t node -o testnode1 arch=x86_64 cons=kvm groups=kvm ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=kvm profile=compute os=rhels6.99
check:rc==0
cmd:cp -f /etc/hosts /etc/hosts.xcattestbak
cmd:echo "10.1.1.200 testnode1" >> /etc/hosts
check:rc==0
cmd:chdef testnode1 netboot=xnba addkcmdline=debug
check:rc==0
cmd:mkdef "rhels6.99-x86_64-install-compute" -u profile=compute provmethod=install osvers=rhels6.99 osarch=x86_64
cmd:mkdir -p /install/rhels6.99/x86_64/images/pxeboot
cmd:echo blah >/install/rhels6.99/x86_64/images/pxeboot/vmlinuz
cmd:echo blah >/install/rhels6.99/x86_64/images/pxeboot/initrd.img
cmd:nodeset testnode1 osimage=rhels6.99-x86_64-install-compute
check:rc==0
cmd:grep "debug" /tftpboot/xcat/xnba/nodes/testnode1
check:rc==0
cmd:grep "debug" /tftpboot/xcat/xnba/nodes/testnode1.elilo
check:rc==0
#cmd:makedhcp -q testnode1 | grep ^testnode1:
#check:rc==0
cmd:nodeset testnode1 offline
check:rc==0
cmd:grep "debug" /tftpboot/xcat/xnba/nodes/testnode1
check:rc!=0
#cmd:makedhcp -q testnode1 | grep ^testnode1:
#check:rc!=0
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=rhels6.99-x86_64-install-compute
check:rc!=0
cmd:noderm testnode1
cmd:rmdef -t osimage -o "rhels6.99-x86_64-install-compute"
cmd:rm -rf /install/rhels6.99
end
start:nodeset_grub2
description: Verify when grub2 is used for OS loader, whether the configuration files under /tftpboot can be generated corrently
cmd:rmdef testnode1
cmd:rm -f /tftpboot/boot/grub2/{testnode1,grub.cfg-{01-e6-d4-d2-3a-ad-06,0[aA]0101[cC]8}}
cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc 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=grub2 addkcmdline=debug
check:rc==0
cmd:mkdef "rhels7.99-ppc64-install-compute" -u profile=compute provmethod=install osvers=rhels7.99 osarch=ppc64
cmd:mkdir -p /install/rhels7.99/ppc64/ppc/ppc64
cmd:echo blah >/install/rhels7.99/ppc64/ppc/ppc64/vmlinuz
cmd:echo blah >/install/rhels7.99/ppc64/ppc/ppc64/initrd.img
cmd:nodeset testnode1 osimage=rhels7.99-ppc64-install-compute
check:rc==0
cmd:grep "debug" /tftpboot/boot/grub2/testnode1
check:rc==0
cmd:grep "debug" /tftpboot/boot/grub2/grub.cfg-01-e6-d4-d2-3a-ad-06
check:rc==0
cmd:grep "debug" /tftpboot/boot/grub2/grub.cfg-0[aA]0101[cC]8
check:rc==0
#cmd:makedhcp -q testnode1 | grep ^testnode1:
#check:rc==0
cmd:nodeset testnode1 offline
check:rc==0
cmd:grep "debug" /tftpboot/boot/grub2/testnode1
check:rc!=0
#cmd:makedhcp -q testnode1 | grep ^testnode1:
#check:rc!=0
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-ppc64-install-compute
check:rc!=0
cmd:noderm testnode1
cmd:rmdef -t osimage -o "rhels7.99-ppc64-install-compute"
cmd:rm -rf /install/rhels7.99
end
start:nodeset_petitboot
description: Verify when petitboot is used for OS loader, whether the configuration files under /tftpboot can be generated corrently
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: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:makedhcp -q testnode1 | grep ^testnode1:
#check:rc!=0
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
end
start:nodeset_yaboot
description: Verify when yaboot is used for OS loader, whether the configuration files under /tftpboot can be generated corrently
cmd:rmdef testnode1
cmd:rm -f /tftpboot/yaboot.conf-e6-d4-d2-3a-ad-06
cmd:mkdef -t node -o testnode1 arch=ppc64 cons=hmc groups=lpar ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=hmc profile=compute os=rhels6.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=yaboot addkcmdline=debug
check:rc==0
cmd:mkdef "rhels6.99-ppc64-install-compute" -u profile=compute provmethod=install osvers=rhels6.99 osarch=ppc64
cmd:mkdir -p /install/rhels6.99/ppc64/ppc/{chrp,ppc64}
cmd:echo blah >/install/rhels6.99/ppc64/ppc/ppc64/vmlinuz
cmd:echo blah >/install/rhels6.99/ppc64/ppc/ppc64/initrd.img
cmd:echo blah >/install/rhels6.99/ppc64/ppc/chrp/yaboot
cmd:nodeset testnode1 osimage=rhels6.99-ppc64-install-compute
check:rc==0
cmd:grep "debug" /tftpboot/yaboot.conf-e6-d4-d2-3a-ad-06
check:rc==0
#cmd:makedhcp -q testnode1 | grep ^testnode1:
#check:rc==0
cmd:nodeset testnode1 offline
check:rc==0
cmd:grep "debug" /tftpboot/yaboot.conf-e6-d4-d2-3a-ad-06
check:rc!=0
#cmd:makedhcp -q testnode1 | grep ^testnode1:
#check:rc!=0
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=rhels6.99-ppc64-install-compute
check:rc!=0
cmd:noderm testnode1
cmd:rmdef -t osimage -o "rhels6.99-ppc64-install-compute"
cmd:rm -rf /install/rhels6.99
end
start:nodeset_errorcommand
description:This testcase is to very nodeset osimage errorcommand could give right output
Attribute: $$CN-The operation object of nodeset command
cmd:nodeset $$CN osimage= __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute
check:rc==1
check:output=~Error: Invalid argument:
check:output=~Usage: nodeset <noderange>
end