master
py 28 lines 1020 Bytes
Raw
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
7 from qemu_test import LinuxKernelTest, Asset
8 from qemu_test import exec_command_and_wait_for_pattern
9
10
11 class 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 self.archive_extract(self.ASSET_TGZ)
20 self.vm.add_args('-append', 'console=ttySC1 noiotrap')
21 self.launch_kernel(self.scratch_file('sh4eb', 'linux-kernel'),
22 initrd=self.scratch_file('sh4eb',
23 'initramfs.cpio.gz'),
24 console_index=1, wait_for='Type exit when done')
25 exec_command_and_wait_for_pattern(self, 'exit', 'Restarting system')
26
27 if __name__ == '__main__':
28 LinuxKernelTest.main()