qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>
Subject: [PULL 11/14] tests/functional: Convert the tcg_plugins test
Date: Thu, 31 Oct 2024 18:48:29 +0100	[thread overview]
Message-ID: <20241031174832.6574-12-thuth@redhat.com> (raw)
In-Reply-To: <20241031174832.6574-1-thuth@redhat.com>

A straight forward conversion, only the usual changes were required
here (i.e. adjustment for asset downloading, machine selection).

Message-ID: <20241023051754.813412-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS                                   |  2 +-
 .../test_aarch64_tcg_plugins.py}              | 37 ++++++++-----------
 2 files changed, 16 insertions(+), 23 deletions(-)
 rename tests/{avocado/tcg_plugins.py => functional/test_aarch64_tcg_plugins.py} (78%)
 mode change 100644 => 100755

diff --git a/MAINTAINERS b/MAINTAINERS
index f48d9142b8..6fa4d89ca1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3717,7 +3717,7 @@ S: Maintained
 F: docs/devel/tcg-plugins.rst
 F: plugins/
 F: tests/tcg/plugins/
-F: tests/avocado/tcg_plugins.py
+F: tests/functional/test_aarch64_tcg_plugins.py
 F: contrib/plugins/
 
 AArch64 TCG target
diff --git a/tests/avocado/tcg_plugins.py b/tests/functional/test_aarch64_tcg_plugins.py
old mode 100644
new mode 100755
similarity index 78%
rename from tests/avocado/tcg_plugins.py
rename to tests/functional/test_aarch64_tcg_plugins.py
index a6ff457e27..01660eb090
--- a/tests/avocado/tcg_plugins.py
+++ b/tests/functional/test_aarch64_tcg_plugins.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+#
 # TCG Plugins tests
 #
 # These are a little more involved than the basic tests run by check-tcg.
@@ -13,7 +15,7 @@
 import mmap
 import re
 
-from boot_linux_console import LinuxKernelTest
+from qemu_test import LinuxKernelTest, Asset
 
 
 class PluginKernelBase(LinuxKernelTest):
@@ -53,22 +55,14 @@ def run_vm(self, kernel_path, kernel_command_line,
 
 class PluginKernelNormal(PluginKernelBase):
 
-    def _grab_aarch64_kernel(self):
-        kernel_url = ('https://storage.tuxboot.com/20230331/arm64/Image')
-        kernel_sha256 = 'ce95a7101a5fecebe0fe630deee6bd97b32ba41bc8754090e9ad8961ea8674c7'
-        kernel_path = self.fetch_asset(kernel_url,
-                                       asset_hash=kernel_sha256,
-                                       algorithm = "sha256")
-        return kernel_path
+    ASSET_KERNEL = Asset(
+        ('https://storage.tuxboot.com/20230331/arm64/Image'),
+        'ce95a7101a5fecebe0fe630deee6bd97b32ba41bc8754090e9ad8961ea8674c7')
 
     def test_aarch64_virt_insn(self):
-        """
-        :avocado: tags=accel:tcg
-        :avocado: tags=arch:aarch64
-        :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
-        """
-        kernel_path = self._grab_aarch64_kernel()
+        self.set_machine('virt')
+        self.cpu='cortex-a53'
+        kernel_path = self.ASSET_KERNEL.fetch()
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
                                'console=ttyAMA0')
         console_pattern = 'Kernel panic - not syncing: VFS:'
@@ -92,13 +86,9 @@ def test_aarch64_virt_insn(self):
 
 
     def test_aarch64_virt_insn_icount(self):
-        """
-        :avocado: tags=accel:tcg
-        :avocado: tags=arch:aarch64
-        :avocado: tags=machine:virt
-        :avocado: tags=cpu:cortex-a53
-        """
-        kernel_path = self._grab_aarch64_kernel()
+        self.set_machine('virt')
+        self.cpu='cortex-a53'
+        kernel_path = self.ASSET_KERNEL.fetch()
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
                                'console=ttyAMA0')
         console_pattern = 'Kernel panic - not syncing: VFS:'
@@ -120,3 +110,6 @@ def test_aarch64_virt_insn_icount(self):
             else:
                 count = int(m.group("count"))
                 self.log.info(f"Counted: {count} instructions")
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
-- 
2.47.0



  parent reply	other threads:[~2024-10-31 17:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-31 17:48 [PULL 00/14] Misc patches (functional tests, next-cube machine, ...) Thomas Huth
2024-10-31 17:48 ` [PULL 01/14] .gitlab-ci.d/cirrus: Remove the macos-15 job Thomas Huth
2024-10-31 17:48 ` [PULL 02/14] tests/functional: make tuxrun disk images writable Thomas Huth
2024-10-31 17:48 ` [PULL 03/14] tests/functional: make cached asset files read-only Thomas Huth
2024-10-31 17:48 ` [PULL 04/14] Revert "Remove the unused sh4eb target" Thomas Huth
2024-10-31 17:48 ` [PULL 05/14] tests/functional: Add a test for sh4eb Thomas Huth
2024-10-31 17:48 ` [PULL 06/14] tests/vm/openbsd: Remove the "Time appears wrong" workaround Thomas Huth
2024-10-31 17:48 ` [PULL 07/14] tests/functional: Fix the s390x and ppc64 tuxrun tests Thomas Huth
2024-10-31 17:48 ` [PULL 08/14] hw/s390x: Re-enable the pci-bridge device on s390x Thomas Huth
2024-10-31 17:48 ` [PULL 09/14] next-cube: fix up compilation when DEBUG_NEXT is enabled Thomas Huth
2024-10-31 17:48 ` [PULL 10/14] next-cube: remove cpu parameter from next_scsi_init() Thomas Huth
2024-10-31 17:48 ` Thomas Huth [this message]
2024-10-31 17:48 ` [PULL 12/14] tests/functional: Convert BananaPi tests to the functional framework Thomas Huth
2024-11-01 19:07   ` Peter Maydell
2024-11-04  8:11     ` Thomas Huth
2024-10-31 17:48 ` [PULL 13/14] tests/functional: Convert the OrangePi " Thomas Huth
2024-10-31 17:48 ` [PULL 14/14] tests/functional: Convert the riscv_opensbi avocado test into a standalone test Thomas Huth
2024-11-04 12:31 ` [PULL 00/14] Misc patches (functional tests, next-cube machine, ...) Peter Maydell
2024-11-04 13:14   ` Thomas Huth

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=20241031174832.6574-12-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).