From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Stefan Hajnoczi" <stefanha@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 01/18] tests/functional: Have microblaze tests inherit common parent class
Date: Wed, 26 Feb 2025 10:57:14 +0100 [thread overview]
Message-ID: <20250226095731.1172375-2-thuth@redhat.com> (raw)
In-Reply-To: <20250226095731.1172375-1-thuth@redhat.com>
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Have the MicroblazeMachine class being common to both
MicroblazeBigEndianMachine and MicroblazeLittleEndianMachine
classes. Move the xmaton and ballerina tests to the parent class.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250212123659.52764-11-philmd@linaro.org>
[thuth: Add missing ASSET statements to the leaf classes]
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
.../functional/test_microblaze_s3adsp1800.py | 27 ++++++++++++++++
.../test_microblazeel_s3adsp1800.py | 31 +++----------------
2 files changed, 32 insertions(+), 26 deletions(-)
diff --git a/tests/functional/test_microblaze_s3adsp1800.py b/tests/functional/test_microblaze_s3adsp1800.py
index c4226f49cf3..c93fa14232b 100755
--- a/tests/functional/test_microblaze_s3adsp1800.py
+++ b/tests/functional/test_microblaze_s3adsp1800.py
@@ -7,6 +7,7 @@
# 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 exec_command_and_wait_for_pattern
from qemu_test import QemuSystemTest, Asset
from qemu_test import wait_for_console_pattern
@@ -20,6 +21,10 @@ class MicroblazeMachine(QemuSystemTest):
'day17.tar.xz'),
'3ba7439dfbea7af4876662c97f8e1f0cdad9231fc166e4861d17042489270057')
+ ASSET_IMAGE_LE = Asset(
+ ('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'),
+ 'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22')
+
def do_ballerina_be_test(self, machine):
self.set_machine(machine)
self.archive_extract(self.ASSET_IMAGE_BE)
@@ -34,8 +39,30 @@ def do_ballerina_be_test(self, machine):
# message, that's why we don't test for a later string here. This
# needs some investigation by a microblaze wizard one day...
+ def do_xmaton_le_test(self, machine):
+ self.require_netdev('user')
+ self.set_machine(machine)
+ self.archive_extract(self.ASSET_IMAGE_LE)
+ self.vm.set_console()
+ self.vm.add_args('-kernel', self.scratch_file('day13', 'xmaton.bin'))
+ tftproot = self.scratch_file('day13')
+ self.vm.add_args('-nic', f'user,tftp={tftproot}')
+ self.vm.launch()
+ wait_for_console_pattern(self, 'QEMU Advent Calendar 2023')
+ wait_for_console_pattern(self, 'buildroot login:')
+ exec_command_and_wait_for_pattern(self, 'root', '#')
+ exec_command_and_wait_for_pattern(self,
+ 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png',
+ '821cd3cab8efd16ad6ee5acc3642a8ea')
+
+
+class MicroblazeBigEndianMachine(MicroblazeMachine):
+
+ ASSET_IMAGE_BE = MicroblazeMachine.ASSET_IMAGE_BE
+
def test_microblaze_s3adsp1800_legacy_be(self):
self.do_ballerina_be_test('petalogix-s3adsp1800')
+
if __name__ == '__main__':
QemuSystemTest.main()
diff --git a/tests/functional/test_microblazeel_s3adsp1800.py b/tests/functional/test_microblazeel_s3adsp1800.py
index 60aab4a45e8..ab59941d57a 100755
--- a/tests/functional/test_microblazeel_s3adsp1800.py
+++ b/tests/functional/test_microblazeel_s3adsp1800.py
@@ -7,37 +7,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 qemu_test import exec_command_and_wait_for_pattern
-from qemu_test import QemuSystemTest, Asset
-from qemu_test import wait_for_console_pattern
+from test_microblaze_s3adsp1800 import MicroblazeMachine
-class MicroblazeelMachine(QemuSystemTest):
+class MicroblazeLittleEndianMachine(MicroblazeMachine):
- timeout = 90
-
- ASSET_IMAGE_LE = Asset(
- ('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'),
- 'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22')
-
- def do_xmaton_le_test(self, machine):
- self.require_netdev('user')
- self.set_machine(machine)
- self.archive_extract(self.ASSET_IMAGE_LE)
- self.vm.set_console()
- self.vm.add_args('-kernel', self.scratch_file('day13', 'xmaton.bin'))
- tftproot = self.scratch_file('day13')
- self.vm.add_args('-nic', f'user,tftp={tftproot}')
- self.vm.launch()
- wait_for_console_pattern(self, 'QEMU Advent Calendar 2023')
- wait_for_console_pattern(self, 'buildroot login:')
- exec_command_and_wait_for_pattern(self, 'root', '#')
- exec_command_and_wait_for_pattern(self,
- 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png',
- '821cd3cab8efd16ad6ee5acc3642a8ea')
+ ASSET_IMAGE_LE = MicroblazeMachine.ASSET_IMAGE_LE
def test_microblaze_s3adsp1800_legacy_le(self):
self.do_xmaton_le_test('petalogix-s3adsp1800')
+
if __name__ == '__main__':
- QemuSystemTest.main()
+ MicroblazeMachine.main()
--
2.48.1
next prev parent reply other threads:[~2025-02-26 9:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 9:57 [PULL 00/18] Functional and other test improvements Thomas Huth
2025-02-26 9:57 ` Thomas Huth [this message]
2025-02-26 9:57 ` [PULL 02/18] tests/qtest/qom-test: Test retrieval of machine class properties Thomas Huth
2025-02-26 9:57 ` [PULL 03/18] tests/functional: Provide a proper name for the VMs in the replay tests Thomas Huth
2025-02-26 9:57 ` [PULL 04/18] tests/functional: Convert the xtensa replay test to the functional framework Thomas Huth
2025-02-26 9:57 ` [PULL 05/18] tests/functional: Convert the sparc replay avocado test Thomas Huth
2025-02-26 9:57 ` [PULL 06/18] tests/functional: Convert the 32-bit ppc replay avocado tests Thomas Huth
2025-02-26 9:57 ` [PULL 07/18] tests/functional: Convert the or1k " Thomas Huth
2025-02-26 9:57 ` [PULL 08/18] tests/functional: Convert the ppc64 " Thomas Huth
2025-02-26 9:57 ` [PULL 09/18] tests/functional: Convert the microblaze " Thomas Huth
2025-02-26 9:57 ` [PULL 10/18] tests/functional: Convert the m68k " Thomas Huth
2025-02-26 9:57 ` [PULL 11/18] tests/functional: Convert the arm " Thomas Huth
2025-03-07 19:08 ` Peter Maydell
2025-02-26 9:57 ` [PULL 12/18] tests/functional: Convert the alpha " Thomas Huth
2025-02-26 9:57 ` [PULL 13/18] tests/functional: Convert the s390x " Thomas Huth
2025-02-26 9:57 ` [PULL 14/18] tests/functional: Convert the aarch64 " Thomas Huth
2025-02-26 9:57 ` [PULL 15/18] tests/functional: Convert the x86_64 " Thomas Huth
2025-02-26 9:57 ` [PULL 16/18] tests/functional: Bump some arm test timeouts Thomas Huth
2025-02-26 9:57 ` [PULL 17/18] gitlab: use --refetch in check-patch/check-dco jobs Thomas Huth
2025-02-26 9:57 ` [PULL 18/18] tests/functional: Replace the ppc64 e500 advent calendar test Thomas Huth
2025-03-03 12:12 ` [PULL 00/18] Functional and other test improvements Stefan Hajnoczi
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=20250226095731.1172375-2-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@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).