summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-05-24 13:36:21 +0200
committerTom Rini <trini@konsulko.com>2022-05-26 10:32:27 -0400
commitd051a91c8dcb27a2f5377cee044d5376e91c372b (patch)
tree341b208be12c3fb680896d92a2417564f9886281 /test
parentd9402bd49b9b2013ac48b5f4d82217d1628da797 (diff)
downloadu-boot-d051a91c8dcb27a2f5377cee044d5376e91c372b.tar.gz
u-boot-d051a91c8dcb27a2f5377cee044d5376e91c372b.tar.bz2
u-boot-d051a91c8dcb27a2f5377cee044d5376e91c372b.zip
test: fix parsing the mksquashfs version number
Testing with mksquasshfs 4.5.1 results in an error ValueError: could not convert string to float: '4.5.1' Version 4.10 would be considered to be lower than 4.4. Fixes: 04c9813e951f ("test/py: rewrite common tools for SquashFS tests") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_fs/test_squashfs/sqfs_common.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/py/tests/test_fs/test_squashfs/sqfs_common.py b/test/py/tests/test_fs/test_squashfs/sqfs_common.py
index 8b84c2cdca..d1621dcce3 100644
--- a/test/py/tests/test_fs/test_squashfs/sqfs_common.py
+++ b/test/py/tests/test_fs/test_squashfs/sqfs_common.py
@@ -146,15 +146,14 @@ def get_mksquashfs_version():
out = subprocess.run(['mksquashfs -version'], shell=True, check=True,
capture_output=True, text=True)
# 'out' is: mksquashfs version X (yyyy/mm/dd) ...
- return float(out.stdout.split()[2].split('-')[0])
+ return out.stdout.split()[2].split('.')[0:2]
def check_mksquashfs_version():
""" Checks if mksquashfs meets the required version. """
- required_version = 4.4
- if get_mksquashfs_version() < required_version:
- print('Error: mksquashfs is too old.')
- print('Required version: {}'.format(required_version))
+ version = get_mksquashfs_version();
+ if int(version[0]) < 4 or int(version[0]) == 4 and int(version[1]) < 4 :
+ print('Error: mksquashfs is too old, required version: 4.4')
raise AssertionError
def make_all_images(build_dir):