[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/23] tests/functional: Fix hash validation
From: |
Michael Tokarev |
Subject: |
[PULL 21/23] tests/functional: Fix hash validation |
Date: |
Fri, 4 Oct 2024 19:03:29 +0300 |
From: Thomas Huth <thuth@redhat.com>
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>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
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.39.5
- [PULL 11/23] hw: Remove unused fw_cfg_init_io, (continued)
- [PULL 11/23] hw: Remove unused fw_cfg_init_io, Michael Tokarev, 2024/10/04
- [PULL 12/23] ui/cursor: remove cursor_get_mono_image, Michael Tokarev, 2024/10/04
- [PULL 13/23] vhost: Remove unused vhost_dev_{load|save}_inflight, Michael Tokarev, 2024/10/04
- [PULL 14/23] remote: Remove unused remote_iohub_finalize, Michael Tokarev, 2024/10/04
- [PULL 15/23] replay: Remove unused replay_disable_events, Michael Tokarev, 2024/10/04
- [PULL 16/23] hw/pci: Remove unused pcie_chassis_find_slot, Michael Tokarev, 2024/10/04
- [PULL 17/23] hw/net/rocker: Remove unused rocker_fp_ports, Michael Tokarev, 2024/10/04
- [PULL 18/23] block-backend: Remove deadcode, Michael Tokarev, 2024/10/04
- [PULL 19/23] tests/tcg/plugins: Remove remainder of the cris target, Michael Tokarev, 2024/10/04
- [PULL 20/23] hw/mips: Build fw_cfg.c once, Michael Tokarev, 2024/10/04
- [PULL 21/23] tests/functional: Fix hash validation,
Michael Tokarev <=
- [PULL 23/23] MAINTAINERS: Add myself as maintainer of e500 machines, Michael Tokarev, 2024/10/04
- [PULL 22/23] docs/devel: Mention post_load hook restrictions where we document the hook, Michael Tokarev, 2024/10/04
- Re: [PULL 00/23] Trivial patches for 2024-10-04, Peter Maydell, 2024/10/04