mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-21 18:50:28 +00:00
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
This commit is contained in:
@@ -27,7 +27,6 @@ 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
|
||||
@@ -173,29 +172,173 @@ check:output=~Warning: testnode1: petitboot might be invalid|testnode1 could not
|
||||
cmd:noderm testnode1
|
||||
end
|
||||
|
||||
start:nodeset_addkcmdline
|
||||
description: This case is to verify when netboot=xnba, addkcmdline is correctly supported.
|
||||
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
|
||||
os=__GETNODEATTR($$CN,os)__
|
||||
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=xnba addkcmdline=rd.break=pre-pivot
|
||||
cmd:chdef testnode1 netboot=grub2 addkcmdline=debug
|
||||
check:rc==0
|
||||
cmd: mkdef "__GETNODEATTR($$CN,os)__-x86_64-install-compute" -u profile=compute provmethod=install osvers=__GETNODEATTR($$CN,os)__
|
||||
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:nodeset testnode1 osimage=__GETNODEATTR($$CN,os)__-x86_64-install-compute
|
||||
cmd:grep "debug" /tftpboot/boot/grub2/testnode1
|
||||
check:rc==0
|
||||
cmd:grep "rd.break=pre-pivot" /tftpboot/xcat/xnba/nodes/testnode1
|
||||
cmd:grep "debug" /tftpboot/boot/grub2/grub.cfg-01-e6-d4-d2-3a-ad-06
|
||||
check:rc==0
|
||||
cmd:grep "rd.break=pre-pivot" /tftpboot/xcat/xnba/nodes/testnode1.elilo
|
||||
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:noderm testnode1
|
||||
cmd:rmdef -t osimage -o "__GETNODEATTR($$CN,os)__-x86_64-install-compute"
|
||||
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
|
||||
|
Reference in New Issue
Block a user