[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/7] tests/functional/qemu_test: Add a function for launching ker
From: |
Thomas Huth |
Subject: |
[PATCH 1/7] tests/functional/qemu_test: Add a function for launching kernels more easily |
Date: |
Thu, 19 Sep 2024 20:57:41 +0200 |
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.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/functional/qemu_test/linuxkernel.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
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 @@ def wait_for_console_pattern(self, success_message, vm=None):
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
--
2.46.0
- [PATCH 0/7] tests/functional: Convert the advent calendar tests, Thomas Huth, 2024/09/19
- [PATCH 1/7] tests/functional/qemu_test: Add a function for launching kernels more easily,
Thomas Huth <=
- [PATCH 2/7] tests/functional: Convert the vexpressa9 Avocado test, Thomas Huth, 2024/09/19
- [PATCH 3/7] tests/functional: Convert the xtensa lx60 Avocado test, Thomas Huth, 2024/09/19
- [PATCH 4/7] tests/functional: Convert the SPARCStation Avocado test, Thomas Huth, 2024/09/19
- [PATCH 5/7] tests/functional: Convert the e500 ppc64 Avocado test, Thomas Huth, 2024/09/19
- [PATCH 6/7] tests/functional: Convert the mac ppc Avocado tests, Thomas Huth, 2024/09/19
- [PATCH 7/7] tests/functional: Convert the r2d sh4 Avocado test, Thomas Huth, 2024/09/19
- Re: [PATCH 0/7] tests/functional: Convert the advent calendar tests, Richard Henderson, 2024/09/22