[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/25] tests/acceptance: refactor boot_linux_console test to allow
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 24/25] tests/acceptance: refactor boot_linux_console test to allow code reuse |
Date: |
Sun, 31 May 2020 18:38:45 +0200 |
From: Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
This patch splits code in BootLinuxConsole class into two different
classes to allow reusing it by record/replay tests.
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <159073588490.20809.13942096070255577558.stgit@pasha-ThinkPad-X280>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
tests/acceptance/boot_linux_console.py | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/tests/acceptance/boot_linux_console.py
b/tests/acceptance/boot_linux_console.py
index c6b06a1a13..12725d4529 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -28,19 +28,13 @@
except CmdNotFoundError:
P7ZIP_AVAILABLE = False
-class BootLinuxConsole(Test):
- """
- Boots a Linux kernel and checks that the console is operational and the
- kernel command line is properly passed from QEMU to the kernel
- """
-
- timeout = 90
-
+class LinuxKernelTest(Test):
KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
- def wait_for_console_pattern(self, success_message):
+ def wait_for_console_pattern(self, success_message, vm=None):
wait_for_console_pattern(self, success_message,
- failure_message='Kernel panic - not syncing')
+ failure_message='Kernel panic - not syncing',
+ vm=vm)
def extract_from_deb(self, deb, path):
"""
@@ -79,6 +73,13 @@ def extract_from_rpm(self, rpm, path):
os.chdir(cwd)
return os.path.normpath(os.path.join(self.workdir, path))
+class BootLinuxConsole(LinuxKernelTest):
+ """
+ Boots a Linux kernel and checks that the console is operational and the
+ kernel command line is properly passed from QEMU to the kernel
+ """
+ timeout = 90
+
def test_x86_64_pc(self):
"""
:avocado: tags=arch:x86_64
--
2.21.3
- [PULL 14/25] python/qemu: Adjust traceback typing, (continued)
- [PULL 14/25] python/qemu: Adjust traceback typing, Philippe Mathieu-Daudé, 2020/05/31
- [PULL 15/25] python/qemu/qmp: use True/False for non/blocking modes, Philippe Mathieu-Daudé, 2020/05/31
- [PULL 16/25] python/qemu/qmp: assert sockfile is not None, Philippe Mathieu-Daudé, 2020/05/31
- [PULL 17/25] python/qemu/qtest: Check before accessing _qtest, Philippe Mathieu-Daudé, 2020/05/31
- [PULL 18/25] tests/vm: Pass --debug through for vm-boot-ssh, Philippe Mathieu-Daudé, 2020/05/31
- [PULL 19/25] tests/vm: Add ability to select QEMU from current build, Philippe Mathieu-Daudé, 2020/05/31
- [PULL 20/25] tests/vm: allow wait_ssh() to specify command, Philippe Mathieu-Daudé, 2020/05/31
- [PULL 21/25] tests/migration/guestperf: Use Python 3 interpreter, Philippe Mathieu-Daudé, 2020/05/31
- [PULL 22/25] tests/acceptance/migration.py: Wait for both sides, Philippe Mathieu-Daudé, 2020/05/31
- [PULL 23/25] tests/acceptance: allow console interaction with specific VMs, Philippe Mathieu-Daudé, 2020/05/31
- [PULL 24/25] tests/acceptance: refactor boot_linux_console test to allow code reuse,
Philippe Mathieu-Daudé <=
- [PULL 25/25] tests/acceptance: refactor boot_linux to allow code reuse, Philippe Mathieu-Daudé, 2020/05/31