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