From bbb43ea3be12f09c284954b7b51ae8fea85ebe33 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 19 Aug 2025 13:23:55 +0200 Subject: tests/functional: Move rx test into target-specific folders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the architecture specific test into an architecture specific subdirectory. Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Message-ID: <20250819112403.432587-19-thuth@redhat.com> --- MAINTAINERS | 2 +- tests/functional/meson.build | 5 +-- tests/functional/rx/meson.build | 5 +++ tests/functional/rx/test_gdbsim.py | 76 ++++++++++++++++++++++++++++++++++++++ tests/functional/test_rx_gdbsim.py | 76 -------------------------------------- 5 files changed, 83 insertions(+), 81 deletions(-) create mode 100644 tests/functional/rx/meson.build create mode 100755 tests/functional/rx/test_gdbsim.py delete mode 100755 tests/functional/test_rx_gdbsim.py diff --git a/MAINTAINERS b/MAINTAINERS index 8126254..c6410a5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1721,7 +1721,7 @@ R: Yoshinori Sato S: Orphan F: docs/system/target-rx.rst F: hw/rx/rx-gdbsim.c -F: tests/functional/test_rx_gdbsim.py +F: tests/functional/rx/test_gdbsim.py SH4 Machines ------------ diff --git a/tests/functional/meson.build b/tests/functional/meson.build index 2d8f67f..7e7a6aa 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -28,6 +28,7 @@ subdir('ppc') subdir('ppc64') subdir('riscv32') subdir('riscv64') +subdir('rx') test_s390x_timeouts = { 's390x_ccw_virtio' : 420, @@ -58,10 +59,6 @@ tests_generic_linuxuser = [ tests_generic_bsduser = [ ] -tests_rx_system_thorough = [ - 'rx_gdbsim', -] - tests_s390x_system_thorough = [ 's390x_ccw_virtio', 's390x_pxelinux', diff --git a/tests/functional/rx/meson.build b/tests/functional/rx/meson.build new file mode 100644 index 0000000..6af83a9 --- /dev/null +++ b/tests/functional/rx/meson.build @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +tests_rx_system_thorough = [ + 'gdbsim', +] diff --git a/tests/functional/rx/test_gdbsim.py b/tests/functional/rx/test_gdbsim.py new file mode 100755 index 0000000..4924579 --- /dev/null +++ b/tests/functional/rx/test_gdbsim.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 +# +# Functional test that boots a Linux kernel and checks the console +# +# Copyright (c) 2018 Red Hat, Inc. +# +# Author: +# Cleber Rosa +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +from qemu_test import QemuSystemTest, Asset +from qemu_test import exec_command_and_wait_for_pattern +from qemu_test import wait_for_console_pattern, skipFlakyTest + + +class RxGdbSimMachine(QemuSystemTest): + + timeout = 30 + KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' + + ASSET_UBOOT = Asset( + ('https://github.com/philmd/qemu-testing-blob/raw/rx-gdbsim/rx/gdbsim/' + 'u-boot.bin'), + 'dd7dd4220cccf7aeb32227b26233bf39600db05c3f8e26005bcc2bf6c927207d') + ASSET_DTB = Asset( + ('https://github.com/philmd/qemu-testing-blob/raw/rx-gdbsim/rx/gdbsim/' + 'rx-gdbsim.dtb'), + 'aa278d9c1907a4501741d7ee57e7f65c02dd1b3e0323b33c6d4247f1b32cf29a') + ASSET_KERNEL = Asset( + ('https://github.com/philmd/qemu-testing-blob/raw/rx-gdbsim/rx/gdbsim/' + 'zImage'), + 'baa43205e74a7220ed8482188c5e9ce497226712abb7f4e7e4f825ce19ff9656') + + def test_uboot(self): + """ + U-Boot and checks that the console is operational. + """ + self.set_machine('gdbsim-r5f562n8') + + uboot_path = self.ASSET_UBOOT.fetch() + + self.vm.set_console() + self.vm.add_args('-bios', uboot_path, + '-no-reboot') + self.vm.launch() + uboot_version = 'U-Boot 2016.05-rc3-23705-ga1ef3c71cb-dirty' + wait_for_console_pattern(self, uboot_version) + gcc_version = 'rx-unknown-linux-gcc (GCC) 9.0.0 20181105 (experimental)' + # FIXME limit baudrate on chardev, else we type too fast + # https://gitlab.com/qemu-project/qemu/-/issues/2691 + #exec_command_and_wait_for_pattern(self, 'version', gcc_version) + + @skipFlakyTest(bug_url="https://gitlab.com/qemu-project/qemu/-/issues/2691") + def test_linux_sash(self): + """ + Boots a Linux kernel and checks that the console is operational. + """ + self.set_machine('gdbsim-r5f562n7') + + dtb_path = self.ASSET_DTB.fetch() + kernel_path = self.ASSET_KERNEL.fetch() + + self.vm.set_console() + kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'earlycon' + self.vm.add_args('-kernel', kernel_path, + '-dtb', dtb_path, + '-no-reboot') + self.vm.launch() + wait_for_console_pattern(self, 'Sash command shell (version 1.1.1)', + failure_message='Kernel panic - not syncing') + exec_command_and_wait_for_pattern(self, 'printenv', 'TERM=linux') + +if __name__ == '__main__': + QemuSystemTest.main() diff --git a/tests/functional/test_rx_gdbsim.py b/tests/functional/test_rx_gdbsim.py deleted file mode 100755 index 4924579..0000000 --- a/tests/functional/test_rx_gdbsim.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python3 -# -# Functional test that boots a Linux kernel and checks the console -# -# Copyright (c) 2018 Red Hat, Inc. -# -# Author: -# Cleber Rosa -# -# This work is licensed under the terms of the GNU GPL, version 2 or -# later. See the COPYING file in the top-level directory. - -from qemu_test import QemuSystemTest, Asset -from qemu_test import exec_command_and_wait_for_pattern -from qemu_test import wait_for_console_pattern, skipFlakyTest - - -class RxGdbSimMachine(QemuSystemTest): - - timeout = 30 - KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' - - ASSET_UBOOT = Asset( - ('https://github.com/philmd/qemu-testing-blob/raw/rx-gdbsim/rx/gdbsim/' - 'u-boot.bin'), - 'dd7dd4220cccf7aeb32227b26233bf39600db05c3f8e26005bcc2bf6c927207d') - ASSET_DTB = Asset( - ('https://github.com/philmd/qemu-testing-blob/raw/rx-gdbsim/rx/gdbsim/' - 'rx-gdbsim.dtb'), - 'aa278d9c1907a4501741d7ee57e7f65c02dd1b3e0323b33c6d4247f1b32cf29a') - ASSET_KERNEL = Asset( - ('https://github.com/philmd/qemu-testing-blob/raw/rx-gdbsim/rx/gdbsim/' - 'zImage'), - 'baa43205e74a7220ed8482188c5e9ce497226712abb7f4e7e4f825ce19ff9656') - - def test_uboot(self): - """ - U-Boot and checks that the console is operational. - """ - self.set_machine('gdbsim-r5f562n8') - - uboot_path = self.ASSET_UBOOT.fetch() - - self.vm.set_console() - self.vm.add_args('-bios', uboot_path, - '-no-reboot') - self.vm.launch() - uboot_version = 'U-Boot 2016.05-rc3-23705-ga1ef3c71cb-dirty' - wait_for_console_pattern(self, uboot_version) - gcc_version = 'rx-unknown-linux-gcc (GCC) 9.0.0 20181105 (experimental)' - # FIXME limit baudrate on chardev, else we type too fast - # https://gitlab.com/qemu-project/qemu/-/issues/2691 - #exec_command_and_wait_for_pattern(self, 'version', gcc_version) - - @skipFlakyTest(bug_url="https://gitlab.com/qemu-project/qemu/-/issues/2691") - def test_linux_sash(self): - """ - Boots a Linux kernel and checks that the console is operational. - """ - self.set_machine('gdbsim-r5f562n7') - - dtb_path = self.ASSET_DTB.fetch() - kernel_path = self.ASSET_KERNEL.fetch() - - self.vm.set_console() - kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'earlycon' - self.vm.add_args('-kernel', kernel_path, - '-dtb', dtb_path, - '-no-reboot') - self.vm.launch() - wait_for_console_pattern(self, 'Sash command shell (version 1.1.1)', - failure_message='Kernel panic - not syncing') - exec_command_and_wait_for_pattern(self, 'printenv', 'TERM=linux') - -if __name__ == '__main__': - QemuSystemTest.main() -- cgit v1.1