summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2021-07-22 23:52:05 +0300
committerTom Rini <trini@konsulko.com>2021-07-29 03:46:34 +0300
commit89795ef3b6b2d12cffb840a98ee374d2e806aa64 (patch)
treeee50f6d86aea7c9e3f76ca901be42ca925d46261 /test
parentff7852d5442ab48c71cce69e19bac3d6a5183496 (diff)
downloadu-boot-89795ef3b6b2d12cffb840a98ee374d2e806aa64.tar.xz
test/py: Improve check for mksquashfs version
Some builds of squashfs-tools append version string with "-git" or similar. The float() conversion will fail in this case. Improve the code to only convert to float() the string before the '-' character. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_fs/test_squashfs/sqfs_common.py2
1 files changed, 1 insertions, 1 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 267c4b57d1..8b84c2cdca 100644
--- a/test/py/tests/test_fs/test_squashfs/sqfs_common.py
+++ b/test/py/tests/test_fs/test_squashfs/sqfs_common.py
@@ -146,7 +146,7 @@ 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])
+ return float(out.stdout.split()[2].split('-')[0])
def check_mksquashfs_version():
""" Checks if mksquashfs meets the required version. """