diff options
author | Thomas Huth <thuth@redhat.com> | 2024-09-19 20:57:41 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2024-09-24 13:38:29 +0200 |
commit | d2a500cea9b55ed437940c83b9753df71a1c8f8c (patch) | |
tree | 74b2a34b649e1e6bbe690de1aa53f232c5fbe378 /tests/functional/qemu_test | |
parent | 01dc65a3bc262ab1bec8fe89775e9bbfa627becb (diff) |
tests/functional/qemu_test: Add a function for launching kernels more easily
The task for launching a kernel is quite repetitive: Set the serial
console, set the -kernel and maybe -initrd and -dtb parameters,
launch the VM and then wait for the expected console output. So
it's easier in some tests to provide these steps via a separate
function.
Message-ID: <20240919185749.71222-2-thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/functional/qemu_test')
-rw-r--r-- | tests/functional/qemu_test/linuxkernel.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/functional/qemu_test/linuxkernel.py b/tests/functional/qemu_test/linuxkernel.py index fdd5307629..2b5b9a5fda 100644 --- a/tests/functional/qemu_test/linuxkernel.py +++ b/tests/functional/qemu_test/linuxkernel.py @@ -17,6 +17,18 @@ class LinuxKernelTest(QemuSystemTest): failure_message='Kernel panic - not syncing', vm=vm) + def launch_kernel(self, kernel, initrd=None, dtb=None, console_index=0, + wait_for=None): + self.vm.set_console(console_index=console_index) + self.vm.add_args('-kernel', kernel) + if initrd: + self.vm.add_args('-initrd', initrd) + if dtb: + self.vm.add_args('-dtb', dtb) + self.vm.launch() + if wait_for: + self.wait_for_console_pattern(wait_for) + def extract_from_deb(self, deb_path, path): """ Extracts a file from a deb package into the test workdir |