qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org,
	"Philippe Mathieu-Daudé " <philmd@linaro.org>,
	"Brian Cain" <bcain@quicinc.com>
Subject: Re: [PATCH] tests/functional: Fix hash validation
Date: Fri, 04 Oct 2024 20:53:39 +0300	[thread overview]
Message-ID: <kuf60.ek3w2mj9njb@linaro.org> (raw)
In-Reply-To: <20241004130225.217441-1-thuth@redhat.com>

On Fri, 04 Oct 2024 16:02, Thomas Huth <thuth@redhat.com> wrote:
>The _check() function is supposed to check whether the hash of the
>downloaded file matches the expected one. Unfortunately, during the
>last rework of this function, the check was accidentally turned into
>returning the hash value itself instead of a True/False value,
>effectively accepting each hash as valid. Let's do a proper check
>again now.
>
>Fixes:05e303210d ("tests/functional/qemu_test: Use Python hashlib ...")
>Signed-off-by: Thomas Huth <thuth@redhat.com>
>---
> tests/functional/qemu_test/asset.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
>index 3ec429217e..e47bfac035 100644
>--- a/tests/functional/qemu_test/asset.py
>+++ b/tests/functional/qemu_test/asset.py
>@@ -57,7 +57,7 @@ def _check(self, cache_file):
>                     break
>                 hl.update(chunk)
> 
>-        return  hl.hexdigest()
>+        return self.hash == hl.hexdigest()
> 
>     def valid(self):
>         return self.cache_file.exists() and self._check(self.cache_file)
>-- 
>2.46.1
>
>

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>


      reply	other threads:[~2024-10-04 17:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 13:02 [PATCH] tests/functional: Fix hash validation Thomas Huth
2024-10-04 17:53 ` Manos Pitsidianakis [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=kuf60.ek3w2mj9njb@linaro.org \
    --to=manos.pitsidianakis@linaro.org \
    --cc=bcain@quicinc.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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).