xref: /qemu/tests/functional/test_sh4eb_r2d.py (revision ba182a693fe15a4f6f2a04e8ecb865c2630e5a16)
162728ddcSThomas Huth#!/usr/bin/env python3
262728ddcSThomas Huth#
362728ddcSThomas Huth# Boot a Linux kernel on a r2d sh4eb machine and check the console
462728ddcSThomas Huth#
562728ddcSThomas Huth# SPDX-License-Identifier: GPL-2.0-or-later
662728ddcSThomas Huth
762728ddcSThomas Huthfrom qemu_test import LinuxKernelTest, Asset
862728ddcSThomas Huthfrom qemu_test import exec_command_and_wait_for_pattern
9*5831ed84SDaniel P. Berrangé
1062728ddcSThomas Huth
1162728ddcSThomas Huthclass R2dEBTest(LinuxKernelTest):
1262728ddcSThomas Huth
1362728ddcSThomas Huth    ASSET_TGZ = Asset(
1462728ddcSThomas Huth        'https://landley.net/bin/mkroot/0.8.11/sh4eb.tgz',
1562728ddcSThomas Huth        'be8c6cb5aef8406899dc5aa5e22b6aa45840eb886cdd3ced51555c10577ada2c')
1662728ddcSThomas Huth
1762728ddcSThomas Huth    def test_sh4eb_r2d(self):
1862728ddcSThomas Huth        self.set_machine('r2d')
19*5831ed84SDaniel P. Berrangé        self.archive_extract(self.ASSET_TGZ)
2062728ddcSThomas Huth        self.vm.add_args('-append', 'console=ttySC1 noiotrap')
21beaf88c8SDaniel P. Berrangé        self.launch_kernel(self.scratch_file('sh4eb', 'linux-kernel'),
22beaf88c8SDaniel P. Berrangé                           initrd=self.scratch_file('sh4eb',
23beaf88c8SDaniel P. Berrangé                                                    'initramfs.cpio.gz'),
2462728ddcSThomas Huth                           console_index=1, wait_for='Type exit when done')
2562728ddcSThomas Huth        exec_command_and_wait_for_pattern(self, 'exit', 'Restarting system')
2662728ddcSThomas Huth
2762728ddcSThomas Huthif __name__ == '__main__':
2862728ddcSThomas Huth    LinuxKernelTest.main()
29