[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/14] tests/functional: Convert the riscv_opensbi avocado test in
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 10/14] tests/functional: Convert the riscv_opensbi avocado test into a standalone test |
Date: |
Mon, 29 Jul 2024 17:27:10 +0200 |
From: Thomas Huth <thuth@redhat.com>
The avocado test defined test functions for both, riscv32 and riscv64.
Since we can run the whole file with multiple targets in the new
framework, we can now consolidate the functions so we have to only
define one function per machine now.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240724175248.1389201-16-thuth@redhat.com>
[PMD: Updated MAINTAINERS]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
MAINTAINERS | 1 +
tests/avocado/riscv_opensbi.py | 63 --------------------------
tests/functional/meson.build | 8 ++++
tests/functional/test_riscv_opensbi.py | 36 +++++++++++++++
4 files changed, 45 insertions(+), 63 deletions(-)
delete mode 100644 tests/avocado/riscv_opensbi.py
create mode 100755 tests/functional/test_riscv_opensbi.py
diff --git a/MAINTAINERS b/MAINTAINERS
index a768808a4a..a906218f9d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -337,6 +337,7 @@ F: include/hw/riscv/
F: linux-user/host/riscv32/
F: linux-user/host/riscv64/
F: tests/tcg/riscv64/
+F: tests/functional/test_riscv_opensbi.py
RISC-V XThead* extensions
M: Christoph Muellner <christoph.muellner@vrull.eu>
diff --git a/tests/avocado/riscv_opensbi.py b/tests/avocado/riscv_opensbi.py
deleted file mode 100644
index bfff9cc3c3..0000000000
--- a/tests/avocado/riscv_opensbi.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# OpenSBI boot test for RISC-V machines
-#
-# Copyright (c) 2022, Ventana Micro
-#
-# 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 avocado_qemu import QemuSystemTest
-from avocado_qemu import wait_for_console_pattern
-
-class RiscvOpenSBI(QemuSystemTest):
- """
- :avocado: tags=accel:tcg
- """
- timeout = 5
-
- def boot_opensbi(self):
- self.vm.set_console()
- self.vm.launch()
- wait_for_console_pattern(self, 'Platform Name')
- wait_for_console_pattern(self, 'Boot HART MEDELEG')
-
- def test_riscv32_spike(self):
- """
- :avocado: tags=arch:riscv32
- :avocado: tags=machine:spike
- """
- self.boot_opensbi()
-
- def test_riscv64_spike(self):
- """
- :avocado: tags=arch:riscv64
- :avocado: tags=machine:spike
- """
- self.boot_opensbi()
-
- def test_riscv32_sifive_u(self):
- """
- :avocado: tags=arch:riscv32
- :avocado: tags=machine:sifive_u
- """
- self.boot_opensbi()
-
- def test_riscv64_sifive_u(self):
- """
- :avocado: tags=arch:riscv64
- :avocado: tags=machine:sifive_u
- """
- self.boot_opensbi()
-
- def test_riscv32_virt(self):
- """
- :avocado: tags=arch:riscv32
- :avocado: tags=machine:virt
- """
- self.boot_opensbi()
-
- def test_riscv64_virt(self):
- """
- :avocado: tags=arch:riscv64
- :avocado: tags=machine:virt
- """
- self.boot_opensbi()
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 48a617033e..94ac97ac53 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -23,6 +23,14 @@ tests_ppc_quick = [
'ppc_74xx',
]
+tests_riscv32_quick = [
+ 'riscv_opensbi',
+]
+
+tests_riscv64_quick = [
+ 'riscv_opensbi',
+]
+
tests_x86_64_quick = [
'cpu_queries',
'mem_addr_space',
diff --git a/tests/functional/test_riscv_opensbi.py
b/tests/functional/test_riscv_opensbi.py
new file mode 100755
index 0000000000..d077e40f42
--- /dev/null
+++ b/tests/functional/test_riscv_opensbi.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+#
+# OpenSBI boot test for RISC-V machines
+#
+# Copyright (c) 2022, Ventana Micro
+#
+# 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
+from qemu_test import wait_for_console_pattern
+
+class RiscvOpenSBI(QemuSystemTest):
+
+ timeout = 5
+
+ def boot_opensbi(self):
+ self.vm.set_console()
+ self.vm.launch()
+ wait_for_console_pattern(self, 'Platform Name')
+ wait_for_console_pattern(self, 'Boot HART MEDELEG')
+
+ def test_riscv_spike(self):
+ self.set_machine('spike')
+ self.boot_opensbi()
+
+ def test_riscv_sifive_u(self):
+ self.set_machine('sifive_u')
+ self.boot_opensbi()
+
+ def test_riscv_virt(self):
+ self.set_machine('virt')
+ self.boot_opensbi()
+
+if __name__ == '__main__':
+ QemuSystemTest.main()
--
2.45.2
- [PULL 00/14] Docs / testing patches for 2024-07-29, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 02/14] docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 01/14] docs: add test for firmware.json QAPI, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 03/14] python: Install pycotap in our venv if necessary, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 04/14] tests/functional: Add base classes for the upcoming pytest-based tests, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 05/14] tests/Makefile.include: Increase the level of indentation in the help text, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 06/14] tests/functional: Prepare the meson build system for the functional tests, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 08/14] tests/functional: Convert avocado tests that just need a small adjustment, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 07/14] tests/functional: Convert simple avocado tests into standalone python tests, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 09/14] tests/functional: Convert the x86_cpu_model_versions test, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 10/14] tests/functional: Convert the riscv_opensbi avocado test into a standalone test,
Philippe Mathieu-Daudé <=
- [PULL 11/14] gitlab-ci: Add "check-functional" to the build tests, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 12/14] tests/avocado: mips: fallback to HTTP given certificate expiration, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 13/14] tests/avocado: mips: add hint for fetchasset plugin, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 14/14] tests/avocado: test_arm_emcraft_sf2: handle RW requirements for asset, Philippe Mathieu-Daudé, 2024/07/29
- Re: [PULL 00/14] Docs / testing patches for 2024-07-29, Daniel P . Berrangé, 2024/07/29