From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fabiano Rosas" <farosas@suse.de>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"John Snow" <jsnow@redhat.com>,
qemu-ppc@nongnu.org,
"Richard Henderson" <richard.henderson@linaro.org>,
"Ani Sinha" <anisinha@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>
Subject: [PATCH v3 07/24] tests/functional: Convert avocado tests that just need a small adjustment
Date: Tue, 30 Jul 2024 18:03:27 +0100 [thread overview]
Message-ID: <20240730170347.4103919-8-berrange@redhat.com> (raw)
In-Reply-To: <20240730170347.4103919-1-berrange@redhat.com>
From: Thomas Huth <thuth@redhat.com>
These simple tests can be converted to stand-alone tests quite easily,
e.g. by just setting the machine to 'none' now manually or by adding
"-cpu" command line parameters, since we don't support the corresponding
avocado tags in the new python test framework.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/functional/meson.build | 6 ++
.../test_info_usernet.py} | 11 ++-
.../test_ppc_74xx.py} | 74 ++++++++-----------
.../version.py => functional/test_version.py} | 13 ++--
4 files changed, 53 insertions(+), 51 deletions(-)
rename tests/{avocado/info_usernet.py => functional/test_info_usernet.py} (87%)
mode change 100644 => 100755
rename tests/{avocado/ppc_74xx.py => functional/test_ppc_74xx.py} (74%)
mode change 100644 => 100755
rename tests/{avocado/version.py => functional/test_version.py} (78%)
mode change 100644 => 100755
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index a8cc0e6330..8a8fa0ab99 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -15,6 +15,12 @@ test_timeouts = {
tests_generic = [
'empty_cpu_model',
+ 'info_usernet',
+ 'version',
+]
+
+tests_ppc_quick = [
+ 'ppc_74xx',
]
tests_x86_64_quick = [
diff --git a/tests/avocado/info_usernet.py b/tests/functional/test_info_usernet.py
old mode 100644
new mode 100755
similarity index 87%
rename from tests/avocado/info_usernet.py
rename to tests/functional/test_info_usernet.py
index e1aa7a6e0a..ded973253a
--- a/tests/avocado/info_usernet.py
+++ b/tests/functional/test_info_usernet.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+#
# Test for the hmp command "info usernet"
#
# Copyright (c) 2021 Red Hat, Inc.
@@ -8,18 +10,16 @@
# 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 qemu_test import QemuSystemTest
from qemu.utils import get_info_usernet_hostfwd_port
class InfoUsernet(QemuSystemTest):
- """
- :avocado: tags=machine:none
- """
def test_hostfwd(self):
self.require_netdev('user')
+ self.machine = 'none'
self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22')
self.vm.launch()
res = self.vm.cmd('human-monitor-command',
@@ -31,3 +31,6 @@ def test_hostfwd(self):
self.assertGreater(port, 0,
('Found a redirected port that is not greater than'
' zero'))
+
+if __name__ == '__main__':
+ QemuSystemTest.main()
diff --git a/tests/avocado/ppc_74xx.py b/tests/functional/test_ppc_74xx.py
old mode 100644
new mode 100755
similarity index 74%
rename from tests/avocado/ppc_74xx.py
rename to tests/functional/test_ppc_74xx.py
index f54757c243..5386016f26
--- a/tests/avocado/ppc_74xx.py
+++ b/tests/functional/test_ppc_74xx.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+#
# Smoke tests for 74xx cpus (aka G4).
#
# Copyright (c) 2021, IBM Corp.
@@ -5,132 +7,120 @@
# 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
+from qemu_test import QemuSystemTest
+from qemu_test import wait_for_console_pattern
class ppc74xxCpu(QemuSystemTest):
- """
- :avocado: tags=arch:ppc
- :avocado: tags=accel:tcg
- """
+
timeout = 5
def test_ppc_7400(self):
- """
- :avocado: tags=cpu:7400
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7400')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,G4')
def test_ppc_7410(self):
- """
- :avocado: tags=cpu:7410
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7410')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,74xx')
def test_ppc_7441(self):
- """
- :avocado: tags=cpu:7441
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7441')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,G4')
def test_ppc_7445(self):
- """
- :avocado: tags=cpu:7445
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7445')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,G4')
def test_ppc_7447(self):
- """
- :avocado: tags=cpu:7447
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7447')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,G4')
def test_ppc_7447a(self):
- """
- :avocado: tags=cpu:7447a
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7447a')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,G4')
def test_ppc_7448(self):
- """
- :avocado: tags=cpu:7448
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7448')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,MPC86xx')
def test_ppc_7450(self):
- """
- :avocado: tags=cpu:7450
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7450')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,G4')
def test_ppc_7451(self):
- """
- :avocado: tags=cpu:7451
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7451')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,G4')
def test_ppc_7455(self):
- """
- :avocado: tags=cpu:7455
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7455')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,G4')
def test_ppc_7457(self):
- """
- :avocado: tags=cpu:7457
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7457')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,G4')
def test_ppc_7457a(self):
- """
- :avocado: tags=cpu:7457a
- """
self.require_accelerator("tcg")
+ self.set_machine('g3beige')
self.vm.set_console()
+ self.vm.add_args('-cpu', '7457a')
self.vm.launch()
wait_for_console_pattern(self, '>> OpenBIOS')
wait_for_console_pattern(self, '>> CPU type PowerPC,G4')
+
+if __name__ == '__main__':
+ QemuSystemTest.main()
diff --git a/tests/avocado/version.py b/tests/functional/test_version.py
old mode 100644
new mode 100755
similarity index 78%
rename from tests/avocado/version.py
rename to tests/functional/test_version.py
index c6139568a1..5e566d76b1
--- a/tests/avocado/version.py
+++ b/tests/functional/test_version.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+#
# Version check example test
#
# Copyright (c) 2018 Red Hat, Inc.
@@ -9,17 +11,18 @@
# later. See the COPYING file in the top-level directory.
-from avocado_qemu import QemuSystemTest
+from qemu_test import QemuSystemTest
class Version(QemuSystemTest):
- """
- :avocado: tags=quick
- :avocado: tags=machine:none
- """
+
def test_qmp_human_info_version(self):
+ self.machine = 'none'
self.vm.add_args('-nodefaults')
self.vm.launch()
res = self.vm.cmd('human-monitor-command',
command_line='info version')
self.assertRegex(res, r'^(\d+\.\d+\.\d)')
+
+if __name__ == '__main__':
+ QemuSystemTest.main()
--
2.45.2
next prev parent reply other threads:[~2024-07-30 17:08 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 17:03 [PATCH v3 00/24] Convert avocado tests to normal Python unittests Daniel P. Berrangé
2024-07-30 17:03 ` [PATCH v3 01/24] python: Install pycotap in our venv if necessary Daniel P. Berrangé
2024-07-31 12:49 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 02/24] tests/functional: Add base classes for the upcoming pytest-based tests Daniel P. Berrangé
2024-07-31 12:53 ` Philippe Mathieu-Daudé
2024-07-31 14:24 ` Alex Bennée
2024-08-01 10:07 ` Daniel P. Berrangé
2024-08-01 16:11 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 03/24] tests/functional: Set up logging Daniel P. Berrangé
2024-08-01 10:10 ` Alex Bennée
2024-08-13 9:34 ` Thomas Huth
2024-07-30 17:03 ` [PATCH v3 04/24] tests/Makefile.include: Increase the level of indentation in the help text Daniel P. Berrangé
2024-07-31 12:49 ` Philippe Mathieu-Daudé
2024-08-01 10:00 ` Alex Bennée
2024-07-30 17:03 ` [PATCH v3 05/24] tests/functional: Prepare the meson build system for the functional tests Daniel P. Berrangé
2024-08-01 16:12 ` Philippe Mathieu-Daudé
2024-08-13 12:00 ` Thomas Huth
2024-07-30 17:03 ` [PATCH v3 06/24] tests/functional: Convert simple avocado tests into standalone python tests Daniel P. Berrangé
2024-07-31 12:52 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` Daniel P. Berrangé [this message]
2024-07-31 12:55 ` [PATCH v3 07/24] tests/functional: Convert avocado tests that just need a small adjustment Philippe Mathieu-Daudé
2024-08-01 16:13 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 08/24] tests/functional: add a module for handling asset download & caching Daniel P. Berrangé
2024-08-01 16:20 ` Philippe Mathieu-Daudé
2024-08-01 17:00 ` Daniel P. Berrangé
2024-08-01 17:02 ` Daniel P. Berrangé
2024-08-02 13:24 ` Philippe Mathieu-Daudé
2024-08-01 21:51 ` Richard Henderson
2024-08-02 8:32 ` Daniel P. Berrangé
2024-07-30 17:03 ` [PATCH v3 09/24] tests/functional: enable pre-emptive caching of assets Daniel P. Berrangé
2024-07-31 5:01 ` Richard Henderson
2024-08-01 16:01 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 10/24] tests/functional: Convert some tests that download files via fetch_asset() Daniel P. Berrangé
2024-07-30 17:03 ` [PATCH v3 11/24] tests/functional: Add a function for extracting files from an archive Daniel P. Berrangé
2024-08-01 16:22 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 12/24] tests/functional: Convert some avocado tests that needed avocado.utils.archive Daniel P. Berrangé
2024-08-01 16:27 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 13/24] tests/functional: Convert the s390x avocado tests into standalone tests Daniel P. Berrangé
2024-08-01 17:11 ` Philippe Mathieu-Daudé
2024-08-01 17:38 ` Daniel P. Berrangé
2024-08-02 13:25 ` Philippe Mathieu-Daudé
2024-08-13 12:04 ` Thomas Huth
2024-08-13 12:08 ` Thomas Huth
2024-07-30 17:03 ` [PATCH v3 14/24] tests/functional: Convert the x86_cpu_model_versions test Daniel P. Berrangé
2024-08-01 16:43 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 15/24] tests/functional: Convert the microblaze avocado tests into standalone tests Daniel P. Berrangé
2024-08-02 16:16 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 16/24] tests/functional: Convert the riscv_opensbi avocado test into a standalone test Daniel P. Berrangé
2024-07-31 12:56 ` Philippe Mathieu-Daudé
2024-07-31 23:00 ` Richard Henderson
2024-08-01 10:09 ` Daniel P. Berrangé
2024-08-01 15:11 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 17/24] tests/functional: Convert the virtio_gpu " Daniel P. Berrangé
2024-08-02 16:35 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 18/24] tests/functional: Convert most ppc avocado tests into standalone tests Daniel P. Berrangé
2024-07-30 17:03 ` [PATCH v3 19/24] tests/functional: Convert the ppc_amiga avocado test into a standalone test Daniel P. Berrangé
2024-08-02 16:19 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 20/24] tests/functional: Convert the ppc_hv " Daniel P. Berrangé
2024-08-05 22:58 ` Nicholas Piggin
2024-07-30 17:03 ` [PATCH v3 21/24] tests/functional: Convert the m68k nextcube test with tesseract Daniel P. Berrangé
2024-08-01 16:33 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 22/24] tests/functional: Convert the acpi-bits test into a standalone test Daniel P. Berrangé
2024-08-02 16:10 ` Philippe Mathieu-Daudé
2024-08-02 16:12 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 23/24] tests/functional: Convert the rx_gdbsim avocado " Daniel P. Berrangé
2024-08-01 16:40 ` Philippe Mathieu-Daudé
2024-07-30 17:03 ` [PATCH v3 24/24] gitlab-ci: Add "check-functional" to the build tests Daniel P. Berrangé
2024-08-01 16:40 ` Philippe Mathieu-Daudé
2024-07-30 18:38 ` [PATCH v3 00/24] Convert avocado tests to normal Python unittests Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240730170347.4103919-8-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=anisinha@redhat.com \
--cc=farosas@suse.de \
--cc=jsnow@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).