qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Cleber Rosa" <crosa@redhat.com>,
	"Akihiko Odaki" <akihiko.odaki@daynix.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 13/14] tests/avocado: mips: add hint for fetchasset plugin
Date: Mon, 29 Jul 2024 17:27:13 +0200	[thread overview]
Message-ID: <20240729152714.10225-14-philmd@linaro.org> (raw)
In-Reply-To: <20240729152714.10225-1-philmd@linaro.org>

From: Cleber Rosa <crosa@redhat.com>

Avocado's fetchasset plugin runs before the actual Avocado job (and
any test).  It analyses the test's code looking for occurrences of
"self.fetch_asset()" in the either the actual test or setUp() method.
It's not able to fully analyze all code, though.

The way these tests are written, make the fetchasset plugin blind to
the assets.  This adds some more code duplication, true, but it will
aid the fetchasset plugin to download or verify the existence of these
assets in advance.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240726134438.14720-3-crosa@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/avocado/boot_linux_console.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 450d67be6a..b8b0a4df10 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -274,8 +274,7 @@ def test_mips64el_malta_5KEc_cpio(self):
         # Wait for VM to shut down gracefully
         self.vm.wait()
 
-    def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash):
-        kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+    def do_test_mips_malta32el_nanomips(self, kernel_path_xz):
         kernel_path = self.workdir + "kernel"
         with lzma.open(kernel_path_xz, 'rb') as f_in:
             with open(kernel_path, 'wb') as f_out:
@@ -303,7 +302,8 @@ def test_mips_malta32el_nanomips_4k(self):
                       'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
                       'generic_nano32r6el_page4k.xz')
         kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6'
-        self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
+        kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+        self.do_test_mips_malta32el_nanomips(kernel_path_xz)
 
     def test_mips_malta32el_nanomips_16k_up(self):
         """
@@ -316,7 +316,8 @@ def test_mips_malta32el_nanomips_16k_up(self):
                       'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
                       'generic_nano32r6el_page16k_up.xz')
         kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc'
-        self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
+        kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+        self.do_test_mips_malta32el_nanomips(kernel_path_xz)
 
     def test_mips_malta32el_nanomips_64k_dbg(self):
         """
@@ -329,7 +330,8 @@ def test_mips_malta32el_nanomips_64k_dbg(self):
                       'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
                       'generic_nano32r6el_page64k_dbg.xz')
         kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180'
-        self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
+        kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
+        self.do_test_mips_malta32el_nanomips(kernel_path_xz)
 
     def test_aarch64_xlnx_versal_virt(self):
         """
-- 
2.45.2



  parent reply	other threads:[~2024-07-29 15:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 15:27 [PULL 00/14] Docs / testing patches for 2024-07-29 Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 01/14] docs: add test for firmware.json QAPI Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 02/14] docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 03/14] python: Install pycotap in our venv if necessary Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 04/14] tests/functional: Add base classes for the upcoming pytest-based tests Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 05/14] tests/Makefile.include: Increase the level of indentation in the help text Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 06/14] tests/functional: Prepare the meson build system for the functional tests Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 07/14] tests/functional: Convert simple avocado tests into standalone python tests Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 08/14] tests/functional: Convert avocado tests that just need a small adjustment Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 09/14] tests/functional: Convert the x86_cpu_model_versions test Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 10/14] tests/functional: Convert the riscv_opensbi avocado test into a standalone test Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 11/14] gitlab-ci: Add "check-functional" to the build tests Philippe Mathieu-Daudé
2024-07-29 15:27 ` [PULL 12/14] tests/avocado: mips: fallback to HTTP given certificate expiration Philippe Mathieu-Daudé
2024-07-29 15:27 ` Philippe Mathieu-Daudé [this message]
2024-07-29 15:27 ` [PULL 14/14] tests/avocado: test_arm_emcraft_sf2: handle RW requirements for asset Philippe Mathieu-Daudé
2024-07-29 15:36 ` [PULL 00/14] Docs / testing patches for 2024-07-29 Daniel P. Berrangé
2024-07-30 10:04   ` Philippe Mathieu-Daudé
2024-07-30 10:14     ` Peter Maydell
2024-07-30 18:31       ` 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=20240729152714.10225-14-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=akihiko.odaki@daynix.com \
    --cc=crosa@redhat.com \
    --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).