xref: /qemu/tests/functional/test_sh4_r2d.py (revision beaf88c895a5eda649777757c80ab4171de777ff)
1#!/usr/bin/env python3
2#
3# Boot a Linux kernel on a r2d sh4 machine and check the console
4#
5# SPDX-License-Identifier: GPL-2.0-or-later
6
7from qemu_test import LinuxKernelTest, Asset, skipFlakyTest
8from qemu_test.utils import archive_extract
9
10class R2dTest(LinuxKernelTest):
11
12    ASSET_DAY09 = Asset(
13        'https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/day09.tar.xz',
14        'a61b44d2630a739d1380cc4ff4b80981d47ccfd5992f1484ccf48322c35f09ac')
15
16    # This test has a 6-10% failure rate on various hosts that look
17    # like issues with a buggy kernel.
18    # XXX file tracking bug
19    @skipFlakyTest(bug_url=None)
20    def test_r2d(self):
21        self.set_machine('r2d')
22        file_path = self.ASSET_DAY09.fetch()
23        archive_extract(file_path, self.workdir)
24        self.vm.add_args('-append', 'console=ttySC1')
25        self.launch_kernel(self.scratch_file('day09', 'zImage'),
26                           console_index=1,
27                           wait_for='QEMU advent calendar')
28
29if __name__ == '__main__':
30    LinuxKernelTest.main()
31