qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Cleber Rosa <crosa@redhat.com>
Cc: qemu-devel@nongnu.org, "Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Radoslaw Biernacki" <rad@semihalf.com>,
	"Paul Durrant" <paul@xen.org>,
	"Akihiko Odaki" <akihiko.odaki@daynix.com>,
	"Leif Lindholm" <quic_llindhol@quicinc.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	kvm@vger.kernel.org, qemu-arm@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Beraldo Leal" <bleal@redhat.com>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Sriram Yagnaraman" <sriram.yagnaraman@est.tech>,
	"Marcin Juszkiewicz" <marcin.juszkiewicz@linaro.org>,
	"David Woodhouse" <dwmw2@infradead.org>
Subject: Re: [PATCH 04/10] tests/avocado: machine aarch64: standardize location and RO/RW access
Date: Mon, 11 Dec 2023 17:47:59 +0000	[thread overview]
Message-ID: <87wmtkeils.fsf@draig.linaro.org> (raw)
In-Reply-To: <20231208190911.102879-5-crosa@redhat.com> (Cleber Rosa's message of "Fri, 8 Dec 2023 14:09:05 -0500")

Cleber Rosa <crosa@redhat.com> writes:

> The tests under machine_aarch64_virt.py do not need read-write access
> to the ISOs.  The ones under machine_aarch64_sbsaref.py, on the other
> hand, will need read-write access, so let's give each test an unique
> file.

I think we are making two separate changes here so probably best split
the patch.

> And while at it, let's use a single code style and hash for the ISO
> url.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>  tests/avocado/machine_aarch64_sbsaref.py |  9 +++++++--
>  tests/avocado/machine_aarch64_virt.py    | 14 +++++++-------
>  2 files changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py
> index 528c7d2934..6ae84d77ac 100644
> --- a/tests/avocado/machine_aarch64_sbsaref.py
> +++ b/tests/avocado/machine_aarch64_sbsaref.py
> @@ -7,6 +7,7 @@
>  # SPDX-License-Identifier: GPL-2.0-or-later
>  
>  import os
> +import shutil
>  
>  from avocado import skipUnless
>  from avocado.utils import archive
> @@ -123,13 +124,15 @@ def boot_alpine_linux(self, cpu):
>  
>          iso_hash = "5a36304ecf039292082d92b48152a9ec21009d3a62f459de623e19c4bd9dc027"
>          iso_path = self.fetch_asset(iso_url, algorithm="sha256", asset_hash=iso_hash)
> +        iso_path_rw = os.path.join(self.workdir, os.path.basename(iso_path))
> +        shutil.copy(iso_path, iso_path_rw)
>  
>          self.vm.set_console()
>          self.vm.add_args(
>              "-cpu",
>              cpu,
>              "-drive",
> -            f"file={iso_path},format=raw",
> +            f"file={iso_path_rw},format=raw",

Instead of copying why not add ",snapshot=on" to preserve the original
image. We don't want to persist data between tests.

>              "-device",
>              "virtio-rng-pci,rng=rng0",
>              "-object",
> @@ -170,13 +173,15 @@ def boot_openbsd73(self, cpu):
>  
>          img_hash = "7fc2c75401d6f01fbfa25f4953f72ad7d7c18650056d30755c44b9c129b707e5"
>          img_path = self.fetch_asset(img_url, algorithm="sha256", asset_hash=img_hash)
> +        img_path_rw = os.path.join(self.workdir, os.path.basename(img_path))
> +        shutil.copy(img_path, img_path_rw)
>  
>          self.vm.set_console()
>          self.vm.add_args(
>              "-cpu",
>              cpu,
>              "-drive",
> -            f"file={img_path},format=raw",
> +            f"file={img_path_rw},format=raw",

ditto.


>              "-device",
>              "virtio-rng-pci,rng=rng0",
>              "-object",
> diff --git a/tests/avocado/machine_aarch64_virt.py b/tests/avocado/machine_aarch64_virt.py
> index a90dc6ff4b..093d68f837 100644
> --- a/tests/avocado/machine_aarch64_virt.py
> +++ b/tests/avocado/machine_aarch64_virt.py
> @@ -37,13 +37,13 @@ def test_alpine_virt_tcg_gic_max(self):
>          :avocado: tags=machine:virt
>          :avocado: tags=accel:tcg
>          """
> -        iso_url = ('https://dl-cdn.alpinelinux.org/'
> -                   'alpine/v3.17/releases/aarch64/'
> -                   'alpine-standard-3.17.2-aarch64.iso')
> +        iso_url = (
> +            "https://dl-cdn.alpinelinux.org/"
> +            "alpine/v3.17/releases/aarch64/alpine-standard-3.17.2-aarch64.iso"
> +        )
>  
> -        # Alpine use sha256 so I recalculated this myself
> -        iso_sha1 = '76284fcd7b41fe899b0c2375ceb8470803eea839'
> -        iso_path = self.fetch_asset(iso_url, asset_hash=iso_sha1)
> +        iso_hash = "5a36304ecf039292082d92b48152a9ec21009d3a62f459de623e19c4bd9dc027"
> +        iso_path = self.fetch_asset(iso_url, algorithm="sha256", asset_hash=iso_hash)
>  
>          self.vm.set_console()
>          kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
> @@ -60,7 +60,7 @@ def test_alpine_virt_tcg_gic_max(self):
>          self.vm.add_args("-smp", "2", "-m", "1024")
>          self.vm.add_args('-bios', os.path.join(BUILD_DIR, 'pc-bios',
>                                                 'edk2-aarch64-code.fd'))
> -        self.vm.add_args("-drive", f"file={iso_path},format=raw")
> +        self.vm.add_args("-drive",
>          f"file={iso_path},readonly=on,format=raw")

Perhaps we can set ",media=cdrom" here.

>          self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
>          self.vm.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom')

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  parent reply	other threads:[~2023-12-11 17:48 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 19:09 [PATCH 00/10] for-8.3 tests/avocado: prep for Avocado 103.0 LTS Cleber Rosa
2023-12-08 19:09 ` [PATCH 01/10] tests/avocado: mips: fallback to HTTP given certificate expiration Cleber Rosa
2023-12-11 16:51   ` Alex Bennée
2023-12-08 19:09 ` [PATCH 02/10] tests/avocado: mips: add hint for fetchasset plugin Cleber Rosa
2023-12-10  4:11   ` Akihiko Odaki
2023-12-13 19:39     ` Cleber Rosa
2023-12-08 19:09 ` [PATCH 03/10] tests/avocado/intel_iommu.py: increase timeout Cleber Rosa
2023-12-11 17:01   ` Alex Bennée
2023-12-12  8:18     ` Akihiko Odaki
2023-12-12 11:27       ` Alex Bennée
2023-12-13 20:08     ` Cleber Rosa
2023-12-14  7:24       ` Eric Auger
2023-12-14  9:41         ` Alex Bennée
2023-12-14 13:26           ` Eric Auger
2023-12-14  9:41         ` Philippe Mathieu-Daudé
2023-12-08 19:09 ` [PATCH 04/10] tests/avocado: machine aarch64: standardize location and RO/RW access Cleber Rosa
2023-12-08 20:03   ` Marcin Juszkiewicz
2023-12-13 21:01     ` Cleber Rosa
2023-12-14 10:30       ` Alex Bennée
2023-12-11 17:47   ` Alex Bennée [this message]
2023-12-13 21:14     ` Cleber Rosa
2023-12-14 10:34       ` Alex Bennée
2023-12-08 19:09 ` [PATCH 05/10] tests/avocado: use more distinct names for assets Cleber Rosa
2023-12-11 16:30   ` Philippe Mathieu-Daudé
2023-12-08 19:09 ` [PATCH 06/10] tests/avocado/kvm_xen_guest.py: cope with asset RW requirements Cleber Rosa
2023-12-11 16:32   ` Philippe Mathieu-Daudé
2024-08-01  3:30     ` Cleber Rosa
2024-08-01 12:57       ` Philippe Mathieu-Daudé
2024-08-01 15:17         ` Cleber Rosa
2024-08-02 13:14           ` Philippe Mathieu-Daudé
2023-12-08 19:09 ` [PATCH 07/10] testa/avocado: test_arm_emcraft_sf2: handle RW requirements for asset Cleber Rosa
2023-12-11 16:36   ` Philippe Mathieu-Daudé
2023-12-12  8:13     ` Akihiko Odaki
2023-12-08 19:09 ` [PATCH 08/10] tests/avocado/boot_xen.py: merge base classes Cleber Rosa
2023-12-08 19:09 ` [PATCH 09/10] tests/avocado/boot_xen.py: unify tags Cleber Rosa
2023-12-11 16:37   ` Philippe Mathieu-Daudé
2023-12-08 19:09 ` [PATCH 10/10] tests/avocado/boot_xen.py: use class attribute Cleber Rosa
2023-12-11 16:38   ` 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=87wmtkeils.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=akihiko.odaki@daynix.com \
    --cc=bleal@redhat.com \
    --cc=crosa@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kvm@vger.kernel.org \
    --cc=marcin.juszkiewicz@linaro.org \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quic_llindhol@quicinc.com \
    --cc=rad@semihalf.com \
    --cc=sriram.yagnaraman@est.tech \
    --cc=wainersm@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).