summary refs log tree commit diff stats
path: root/tests/functional/qemu_test/asset.py
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2024-10-04 15:02:25 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2024-10-04 18:53:53 +0300
commitdb17daf8c43a321f62f8bc46ea0f4a76e16b386f (patch)
treebb9cd0c2154142efce86661a236b58e88adf1463 /tests/functional/qemu_test/asset.py
parentf2a9c31dbba2976796c0391dc7426238e798c644 (diff)
downloadfocaccia-qemu-db17daf8c43a321f62f8bc46ea0f4a76e16b386f.tar.gz
focaccia-qemu-db17daf8c43a321f62f8bc46ea0f4a76e16b386f.zip
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>
Diffstat (limited to 'tests/functional/qemu_test/asset.py')
-rw-r--r--tests/functional/qemu_test/asset.py2
1 files changed, 1 insertions, 1 deletions
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 @@ 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)