xref: /openbmc/qemu/tests/functional/test_m68k_q800.py (revision 4b7ea33074450bc6148c8e1545d78f179e64adb4)
1*c7f3663cSThomas Huth#!/usr/bin/env python3
2*c7f3663cSThomas Huth#
3*c7f3663cSThomas Huth# Functional test for testing the q800 m68k machine
4*c7f3663cSThomas Huth#
5*c7f3663cSThomas Huth# This work is licensed under the terms of the GNU GPL, version 2 or
6*c7f3663cSThomas Huth# later.  See the COPYING file in the top-level directory.
7*c7f3663cSThomas Huth
8*c7f3663cSThomas Huthfrom qemu_test import LinuxKernelTest, Asset
9*c7f3663cSThomas Huth
10*c7f3663cSThomas Huthclass Q800MachineTest(LinuxKernelTest):
11*c7f3663cSThomas Huth
12*c7f3663cSThomas Huth    ASSET_KERNEL = Asset(
13*c7f3663cSThomas Huth        ('https://snapshot.debian.org/'
14*c7f3663cSThomas Huth         'archive/debian-ports/20191021T083923Z/pool-m68k/main/l/linux/'
15*c7f3663cSThomas Huth         'kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb'),
16*c7f3663cSThomas Huth        '949e50d74d4b9bc15d26c06d402717b7a4c0e32ff8100014f5930d8024de7b73')
17*c7f3663cSThomas Huth
18*c7f3663cSThomas Huth    def test_m68k_q800(self):
19*c7f3663cSThomas Huth        self.set_machine('q800')
20*c7f3663cSThomas Huth
21*c7f3663cSThomas Huth        deb_path = self.ASSET_KERNEL.fetch()
22*c7f3663cSThomas Huth        kernel_path = self.extract_from_deb(deb_path,
23*c7f3663cSThomas Huth                                            '/boot/vmlinux-5.3.0-1-m68k')
24*c7f3663cSThomas Huth
25*c7f3663cSThomas Huth        self.vm.set_console()
26*c7f3663cSThomas Huth        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
27*c7f3663cSThomas Huth                               'console=ttyS0 vga=off')
28*c7f3663cSThomas Huth        self.vm.add_args('-kernel', kernel_path,
29*c7f3663cSThomas Huth                         '-append', kernel_command_line)
30*c7f3663cSThomas Huth        self.vm.launch()
31*c7f3663cSThomas Huth        console_pattern = 'Kernel command line: %s' % kernel_command_line
32*c7f3663cSThomas Huth        self.wait_for_console_pattern(console_pattern)
33*c7f3663cSThomas Huth        console_pattern = 'No filesystem could mount root'
34*c7f3663cSThomas Huth        self.wait_for_console_pattern(console_pattern)
35*c7f3663cSThomas Huth
36*c7f3663cSThomas Huthif __name__ == '__main__':
37*c7f3663cSThomas Huth    LinuxKernelTest.main()
38