diff options
author | Thomas Huth <thuth@redhat.com> | 2024-10-24 10:27:35 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2024-11-04 14:16:11 +0100 |
commit | 62728ddcbafebf65134e8616356e081564bc8612 (patch) | |
tree | a7d093d3831c305bb66bccd51f7aecd5f09adbd0 /tests | |
parent | 51cdb6806f405062c2bda3f527e98aaf259d6116 (diff) |
tests/functional: Add a test for sh4eb
Now that we are aware of binaries that are available for sh4eb,
we should make sure that there are no regressions with this
target and test it regularly in our CI.
Message-ID: <20241024082735.42324-3-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/meson.build | 3 | ||||
-rwxr-xr-x | tests/functional/test_sh4eb_r2d.py | 33 |
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 84a07970d4..bc7025b6dd 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -162,6 +162,9 @@ tests_sh4_system_thorough = [ 'sh4_tuxrun', ] +tests_sh4eb_system_thorough = [ + 'sh4eb_r2d', +] tests_sparc_system_thorough = [ 'sparc_sun4m', diff --git a/tests/functional/test_sh4eb_r2d.py b/tests/functional/test_sh4eb_r2d.py new file mode 100755 index 0000000000..d9c022c8b8 --- /dev/null +++ b/tests/functional/test_sh4eb_r2d.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# +# Boot a Linux kernel on a r2d sh4eb machine and check the console +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import os +import shutil + +from qemu_test import LinuxKernelTest, Asset +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test.utils import archive_extract +from unittest import skipUnless + +class R2dEBTest(LinuxKernelTest): + + ASSET_TGZ = Asset( + 'https://landley.net/bin/mkroot/0.8.11/sh4eb.tgz', + 'be8c6cb5aef8406899dc5aa5e22b6aa45840eb886cdd3ced51555c10577ada2c') + + def test_sh4eb_r2d(self): + self.set_machine('r2d') + file_path = self.ASSET_TGZ.fetch() + archive_extract(file_path, self.workdir) + self.vm.add_args('-append', 'console=ttySC1 noiotrap') + self.launch_kernel(os.path.join(self.workdir, 'sh4eb/linux-kernel'), + initrd=os.path.join(self.workdir, 'sh4eb/initramfs.cpio.gz'), + console_index=1, wait_for='Type exit when done') + exec_command_and_wait_for_pattern(self, 'exit', 'Restarting system') + shutil.rmtree(os.path.join(self.workdir, 'sh4eb')) + +if __name__ == '__main__': + LinuxKernelTest.main() |