qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org
Subject: Re: [PATCH for-10.1] tests/functional: Convert the SMMU test to the functional framework
Date: Tue, 11 Mar 2025 17:30:06 +0100	[thread overview]
Message-ID: <baf96cd3-2434-444a-8a16-87abd6e14bcd@redhat.com> (raw)
In-Reply-To: <39ad1fef-f5cc-44f6-be4d-84a597b3f9f6@redhat.com>

Hi Thomas,


On 3/11/25 4:24 PM, Thomas Huth wrote:
> On 11/03/2025 15.00, Eric Auger wrote:
>> Hi Thomas,
>>
>>
>> On 3/11/25 11:49 AM, Thomas Huth wrote:
>>> This test was using cloudinit and a "dnf install" command in the guest
>>> to exercise the NIC with SMMU enabled. Since we don't have the
>>> cloudinit
>>> stuff in the functional framework and we should not rely on having
>>> access
>>> to external networks (once our ASSETs have been cached), we rather boot
>>> into the initrd first, manually mount the root disk and then use the
>>> check_http_download() function from the functional framework here
>>> instead
>>> for testing whether the network works as expected.
>>>
>>> Unfortunately, there seems to be a small race when using the files
>>> from Fedora 33: To enter the initrd shell, we have to send a "return"
>>> once. But it does not seem to work if we send it too early. Using a
>>> sleep(0.2) makes it work reliably for me, but to make it even more
>>> unlikely to trigger this situation, let's better limit the Fedora 33
>>> tests to only run with KVM.
>>>
>>> Finally, while we're at it, we also add some lines for testing writes
>>> to the hard disk, as we already do it in the test_intel_iommu test.
>>
>> for your info it does not apply anymore on mainline after latest appied
>> functional test additions.
> ...
>>> +    ASSET_KERNEL_F31 = Asset(
>>> +       
>>> ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
>>> +         'releases/31/Server/aarch64/os/images/pxeboot/vmlinuz'),
>>> +       
>>> '413c7f95e7f40cfa3e73290ffae855c88fae54cccc46123a4b4ed2db7d5c2120')
>> the hash seems wrong for the vmlinuz. I get
>> Exception: Hash of
>> https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/31/Server/aarch64/os/images/pxeboot/vmlinuz
>>
>> does not match
>> 413c7f95e7f40cfa3e73290ffae855c88fae54cccc46123a4b4ed2db7d5c2120
>
> D'oh, I got tricked by "wget". I used wget to download the asset to
> manually calculate the sha256sum, then manually copied the asset into
> my cache to avoid a second download.
> But wget apparently unzips the kernel:
>
> $ wget
> https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/31/Server/aarch64/os/images/pxeboot/vmlinuz
> $ sha256sum vmlinuz
> 413c7f95e7f40cfa3e73290ffae855c88fae54cccc46123a4b4ed2db7d5c2120  vmlinuz
> $ ls -l vmlinuz
> -rw-r--r--. 1 thuth thuth 25885184 Oct 21  2019 vmlinuz
>
> While curl gives the correct results:
>
> $ curl -O
> https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/31/Server/aarch64/os/images/pxeboot/vmlinuz
> $ sha256sum vmlinuz
> 3ae07fcafbfc8e4abeb693035a74fe10698faae15e9ccd48882a9167800c1527  vmlinuz
> $ ls -l vmlinuz
> -rw-r--r--. 1 thuth thuth  9027813 Mar 11 16:13 vmlinuz
>
> This should fix the issue:
>
> diff --git a/tests/functional/test_aarch64_smmu.py
> b/tests/functional/test_aarch64_smmu.py
> index bba8599401c..4f0492ca50d 100755
> --- a/tests/functional/test_aarch64_smmu.py
> +++ b/tests/functional/test_aarch64_smmu.py
> @@ -123,7 +123,7 @@ def run_and_check(self, filename, hashsum):
>      ASSET_KERNEL_F31 = Asset(
>          ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
>           'releases/31/Server/aarch64/os/images/pxeboot/vmlinuz'),
> -       
> '413c7f95e7f40cfa3e73290ffae855c88fae54cccc46123a4b4ed2db7d5c2120')
> +       
> '3ae07fcafbfc8e4abeb693035a74fe10698faae15e9ccd48882a9167800c1527')
>
>      ASSET_INITRD_F31 = Asset(
>          ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
> @@ -165,7 +165,7 @@ def test_smmu_noril_nostrict(self):
>      ASSET_KERNEL_F33 = Asset(
>          ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
>           'releases/33/Server/aarch64/os/images/pxeboot/vmlinuz'),
> -       
> '0ef9e34f80b49fa2ac098899b27075e95c11d5b646f6ca4df2e89237a40f9e4f')
> +       
> 'd8b1e6f7241f339d8e7609c456cf0461ffa4583ed07e0b55c7d1d8a0c154aa89')
>
>      ASSET_INITRD_F33 = Asset(
>          ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'

yep it fixes the issue

python3.9 ../tests/functional/test_aarch64_smmu.py
TAP version 13
ok 1 test_aarch64_smmu.SMMU.test_smmu_noril
ok 2 test_aarch64_smmu.SMMU.test_smmu_noril_nostrict
ok 3 test_aarch64_smmu.SMMU.test_smmu_noril_passthrough
ok 4 test_aarch64_smmu.SMMU.test_smmu_ril
ok 5 test_aarch64_smmu.SMMU.test_smmu_ril_nostrict
ok 6 test_aarch64_smmu.SMMU.test_smmu_ril_passthrough
1..6

The conversion looks good to me. thank you for doing it!

With above fix and straightforward rebase on top of mainline, feel free
to add

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>

Eric

>
> Sorry for the confusion.
>
>  Thomas
>



      reply	other threads:[~2025-03-11 16:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-11 10:49 [PATCH for-10.1] tests/functional: Convert the SMMU test to the functional framework Thomas Huth
2025-03-11 14:00 ` Eric Auger
2025-03-11 15:24   ` Thomas Huth
2025-03-11 16:30     ` Eric Auger [this message]

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=baf96cd3-2434-444a-8a16-87abd6e14bcd@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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).