From: Thomas Huth Date: Fri, 4 Oct 2024 13:02:25 +0000 (+0200) Subject: tests/functional: Fix hash validation X-Git-Tag: v9.2.0-rc0~62^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db17daf8c43a321f62f8bc46ea0f4a76e16b386f;p=thirdparty%2Fqemu.git tests/functional: Fix hash validation 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 Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py index 3ec429217e5..e47bfac035a 100644 --- a/tests/functional/qemu_test/asset.py +++ b/tests/functional/qemu_test/asset.py @@ -57,7 +57,7 @@ class Asset: 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)