[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 23/44] tests/functional: Convert the riscv_opensbi avocado tes
|
From: |
Thomas Huth |
|
Subject: |
[PATCH v5 23/44] tests/functional: Convert the riscv_opensbi avocado test into a standalone test |
|
Date: |
Fri, 30 Aug 2024 15:38:17 +0200 |
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.
However, we have to mark the "spike" test as flaky now since it sometimes
fails when running the tests in parallel (the failure happens also with the
Avocado test when the host is under load, so the problem is not related
to this conversion to the functional framework).
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 1 +
tests/avocado/riscv_opensbi.py | 63 --------------------------
tests/functional/meson.build | 8 ++++
tests/functional/test_riscv_opensbi.py | 40 ++++++++++++++++
4 files changed, 49 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 91f5a0545f..11cefa015e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -337,6 +337,7 @@ F: hw/intc/riscv*
F: include/hw/riscv/
F: linux-user/host/riscv32/
F: linux-user/host/riscv64/
+F: tests/functional/test_riscv*
F: tests/tcg/riscv64/
RISC-V XThead* extensions
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 f32afed30f..700deed24a 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -61,6 +61,14 @@ tests_ppc_system_thorough = [
'ppc_bamboo',
]
+tests_riscv32_system_quick = [
+ 'riscv_opensbi',
+]
+
+tests_riscv64_system_quick = [
+ 'riscv_opensbi',
+]
+
tests_s390x_system_thorough = [
's390x_ccw_virtio',
's390x_topology',
diff --git a/tests/functional/test_riscv_opensbi.py
b/tests/functional/test_riscv_opensbi.py
new file mode 100755
index 0000000000..de632d05cc
--- /dev/null
+++ b/tests/functional/test_riscv_opensbi.py
@@ -0,0 +1,40 @@
+#!/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.
+
+import os
+from unittest import skipUnless
+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')
+
+ @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'),
+ 'Test is unstable when system is under load')
+ 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.46.0
- [PATCH v5 13/44] tests/functional: Convert avocado tests that just need a small adjustment, (continued)
- [PATCH v5 13/44] tests/functional: Convert avocado tests that just need a small adjustment, Thomas Huth, 2024/08/30
- [PATCH v5 15/44] tests/functional: enable pre-emptive caching of assets, Thomas Huth, 2024/08/30
- [PATCH v5 16/44] tests/functional: Allow asset downloading with concurrent threads, Thomas Huth, 2024/08/30
- [PATCH v5 17/44] tests/functional: Convert some tests that download files via fetch_asset(), Thomas Huth, 2024/08/30
- [PATCH v5 18/44] tests/functional: Add a function for extracting files from an archive, Thomas Huth, 2024/08/30
- [PATCH v5 19/44] tests/functional: Convert some avocado tests that needed avocado.utils.archive, Thomas Huth, 2024/08/30
- [PATCH v5 21/44] tests/functional: Convert the x86_cpu_model_versions test, Thomas Huth, 2024/08/30
- [PATCH v5 22/44] tests/functional: Convert the microblaze avocado tests into standalone tests, Thomas Huth, 2024/08/30
- [PATCH v5 20/44] tests/functional: Convert the s390x avocado tests into standalone tests, Thomas Huth, 2024/08/30
- [PATCH v5 24/44] tests/functional: Convert the virtio_gpu avocado test into a standalone test, Thomas Huth, 2024/08/30
- [PATCH v5 23/44] tests/functional: Convert the riscv_opensbi avocado test into a standalone test,
Thomas Huth <=
- [PATCH v5 25/44] tests/functional: Convert most ppc avocado tests into standalone tests, Thomas Huth, 2024/08/30
- [PATCH v5 26/44] tests/functional: Convert the ppc_amiga avocado test into a standalone test, Thomas Huth, 2024/08/30
- [PATCH v5 27/44] tests/functional: Convert the ppc_hv avocado test into a standalone test, Thomas Huth, 2024/08/30
- [PATCH v5 28/44] tests/functional: Convert the m68k nextcube test with tesseract, Thomas Huth, 2024/08/30
- [PATCH v5 29/44] tests/functional: Convert the acpi-bits test into a standalone test, Thomas Huth, 2024/08/30
- [PATCH v5 30/44] tests/functional: Convert the rx_gdbsim avocado test into a standalone test, Thomas Huth, 2024/08/30
- [PATCH v5 31/44] tests/functional: Convert the linux_initrd avocado test into a standalone test, Thomas Huth, 2024/08/30
- [PATCH v5 32/44] tests/functional: Convert the vnc test, Thomas Huth, 2024/08/30
- [PATCH v5 33/44] tests/functional: Convert ARM Integrator/CP avocado tests, Thomas Huth, 2024/08/30
- [PATCH v5 35/44] tests/functional: Convert Aarch64 Virt machine avocado tests, Thomas Huth, 2024/08/30