Skip to content

Commit

Permalink
Merge pull request #525 from yoguo/master
Browse files Browse the repository at this point in the history
Enhance test_kdump_fastboot_* cases for image mode
  • Loading branch information
yoguo authored Feb 27, 2025
2 parents 04966e9 + acbe8f8 commit 9f7251d
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions os_tests/tests/test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,15 @@ def test_kdump_fastboot_systemctl_kexec(self):
self.fail("No kernel found from {}".format(output))
for kernel in kernels_list:
self.log.info('try to swith {}'.format(kernel))
kernel_vmlinuz = "/boot/" + kernel.replace('kernel','vmlinuz')
kernel_initramfs = "/boot/" + kernel.replace('kernel','initramfs') + ".img"
if utils_lib.is_ostree_system(self):
# Not considering multiple kernels,only test the current kernel in image mode
cmd = 'sudo find /boot/ostree -name vmlinuz*'
kernel_vmlinuz = utils_lib.run_cmd(self, cmd, msg='Get vmlinuz path').strip()
cmd = 'sudo find /boot/ostree -name initramfs*'
kernel_initramfs = utils_lib.run_cmd(self, cmd, msg='Get initramfs path').strip()
else:
kernel_vmlinuz = "/boot/" + kernel.replace('kernel','vmlinuz')
kernel_initramfs = "/boot/" + kernel.replace('kernel','initramfs') + ".img"
if self.vm and self.vm.provider == 'nutanix' and self.vm.prism.if_secure_boot:
cmd = "sudo kexec -s -l %s --initrd=%s --reuse-cmdline -s" % (kernel_vmlinuz, kernel_initramfs) #kexec systems using UEFI + SecureBoot using the kexec option "-s"
else:
Expand Down Expand Up @@ -760,8 +767,15 @@ def test_kdump_fastboot_kexec_e(self):
self.fail("No kernel found from {}".format(output))
for kernel in kernels_list:
self.log.info('try to swith {}'.format(kernel))
kernel_vmlinuz = "/boot/" + kernel.replace('kernel','vmlinuz')
kernel_initramfs = "/boot/" + kernel.replace('kernel','initramfs') + ".img"
if utils_lib.is_ostree_system(self):
# Not considering multiple kernels,only test the current kernel in image mode
cmd = 'sudo find /boot/ostree -name vmlinuz*'
kernel_vmlinuz = utils_lib.run_cmd(self, cmd, msg='Get vmlinuz path').strip()
cmd = 'sudo find /boot/ostree -name initramfs*'
kernel_initramfs = utils_lib.run_cmd(self, cmd, msg='Get initramfs path').strip()
else:
kernel_vmlinuz = "/boot/" + kernel.replace('kernel','vmlinuz')
kernel_initramfs = "/boot/" + kernel.replace('kernel','initramfs') + ".img"
if self.vm and self.vm.provider == 'nutanix' and self.vm.prism.if_secure_boot:
cmd = "sudo kexec -s -l %s --initrd=%s --reuse-cmdline -s" % (kernel_vmlinuz, kernel_initramfs) #kexec systems using UEFI + SecureBoot using the kexec option "-s"
else:
Expand Down

0 comments on commit 9f7251d

Please sign in to comment.