xref: /qemu/tests/functional/test_sparc64_sun4u.py (revision 513823e7521a09ed7ad1e32e6454bac3b2cbf52d)
1#!/usr/bin/env python3
2#
3# Functional test that boots a Linux kernel and checks the console
4#
5# Copyright (c) 2020 Red Hat, Inc.
6#
7# Author:
8#  Thomas Huth <thuth@redhat.com>
9#
10# This work is licensed under the terms of the GNU GPL, version 2 or
11# later. See the COPYING file in the top-level directory.
12
13from qemu_test import QemuSystemTest, Asset
14from qemu_test import wait_for_console_pattern
15
16
17class Sun4uMachine(QemuSystemTest):
18    """Boots the Linux kernel and checks that the console is operational"""
19
20    timeout = 90
21
22    ASSET_IMAGE = Asset(
23        ('https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/'
24         'day23.tar.xz'),
25        'a3ed92450704af244178351afd0e769776e7decb298e95a63abfd9a6e3f6c854')
26
27    def test_sparc64_sun4u(self):
28        self.set_machine('sun4u')
29        kernel_file = self.archive_extract(self.ASSET_IMAGE,
30                                           member='day23/vmlinux')
31        self.vm.set_console()
32        self.vm.add_args('-kernel', kernel_file,
33                         '-append', 'printk.time=0')
34        self.vm.launch()
35        wait_for_console_pattern(self, 'Starting logging: OK')
36
37if __name__ == '__main__':
38    QemuSystemTest.main()
39