Skip to content

Commit

Permalink
tests/acceptance: refactor boot_linux_console test to allow code reuse
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dovgalyuk authored and philmd committed May 31, 2020
1 parent a5ba86d commit 12121c4
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/acceptance/boot_linux_console.py
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 12121c4

Please sign in to comment.