xref: /qemu/tests/functional/test_sh4eb_r2d.py (revision cfcb4484fc78cbbd835e2880add561e1fbef6796) !
1#!/usr/bin/env python3
2#
3# Boot a Linux kernel on a r2d sh4eb machine and check the console
4#
5# SPDX-License-Identifier: GPL-2.0-or-later
6
7from qemu_test import LinuxKernelTest, Asset
8from qemu_test import exec_command_and_wait_for_pattern
9from qemu_test.utils import archive_extract
10
11class R2dEBTest(LinuxKernelTest):
12
13    ASSET_TGZ = Asset(
14        'https://landley.net/bin/mkroot/0.8.11/sh4eb.tgz',
15        'be8c6cb5aef8406899dc5aa5e22b6aa45840eb886cdd3ced51555c10577ada2c')
16
17    def test_sh4eb_r2d(self):
18        self.set_machine('r2d')
19        file_path = self.ASSET_TGZ.fetch()
20        archive_extract(file_path, self.workdir)
21        self.vm.add_args('-append', 'console=ttySC1 noiotrap')
22        self.launch_kernel(self.scratch_file('sh4eb', 'linux-kernel'),
23                           initrd=self.scratch_file('sh4eb',
24                                                    'initramfs.cpio.gz'),
25                           console_index=1, wait_for='Type exit when done')
26        exec_command_and_wait_for_pattern(self, 'exit', 'Restarting system')
27
28if __name__ == '__main__':
29    LinuxKernelTest.main()
30