xref: /qemu/tests/functional/test_sparc64_sun4u.py (revision beaf88c895a5eda649777757c80ab4171de777ff)
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
15from qemu_test.utils import archive_extract
16
17
18class Sun4uMachine(QemuSystemTest):
19    """Boots the Linux kernel and checks that the console is operational"""
20
21    timeout = 90
22
23    ASSET_IMAGE = Asset(
24        ('https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/'
25         'day23.tar.xz'),
26        'a3ed92450704af244178351afd0e769776e7decb298e95a63abfd9a6e3f6c854')
27
28    def test_sparc64_sun4u(self):
29        self.set_machine('sun4u')
30        file_path = self.ASSET_IMAGE.fetch()
31        kernel_name = 'day23/vmlinux'
32        archive_extract(file_path, self.workdir, kernel_name)
33        self.vm.set_console()
34        self.vm.add_args('-kernel', self.scratch_file(kernel_name),
35                         '-append', 'printk.time=0')
36        self.vm.launch()
37        wait_for_console_pattern(self, 'Starting logging: OK')
38
39if __name__ == '__main__':
40    QemuSystemTest.main()
41