[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-xen stable-4.14] tests/acceptance: refactor boot_linux_console test to allow code reuse



commit bc67d011c3a6a60fdaf790a72ab51bab263c7e9e
Author:     Pavel Dovgalyuk <Pavel.Dovgaluk@xxxxxxxxx>
AuthorDate: Fri May 29 10:04:44 2020 +0300
Commit:     Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
CommitDate: Wed Sep 2 19:06:19 2020 -0500

    tests/acceptance: refactor boot_linux_console test to allow code reuse
    
    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@xxxxxxxxx>
    Reviewed-by: Alex Bennée <alex.bennee@xxxxxxxxxx>
    Tested-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
    Message-Id: 
<159073588490.20809.13942096070255577558.stgit@pasha-ThinkPad-X280>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
    (cherry picked from commit 12121c496fcc609e23033c4a36399b54f98bcd56)
    Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx>
---
 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 d864d22ca8..e4204d8f09 100644
--- a/tests/acceptance/boot_linux_console.py
+++ b/tests/acceptance/boot_linux_console.py
@@ -28,19 +28,13 @@ try:
 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 @@ class BootLinuxConsole(Test):
         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
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.14



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.