mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-29 05:13:54 -06:00
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 <thuth@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
f2a9c31dbb
commit
db17daf8c4
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ class Asset:
|
||||||
break
|
break
|
||||||
hl.update(chunk)
|
hl.update(chunk)
|
||||||
|
|
||||||
return hl.hexdigest()
|
return self.hash == hl.hexdigest()
|
||||||
|
|
||||||
def valid(self):
|
def valid(self):
|
||||||
return self.cache_file.exists() and self._check(self.cache_file)
|
return self.cache_file.exists() and self._check(self.cache_file)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue