tests: Fix umockdev version detection

Traceback (most recent call last):
  File "/builds/libfprint/libfprint/tests/umockdev-test.py", line 17, in <module>
    version = tuple(int(_) for _ in umockdev_version.split(b'.'))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builds/libfprint/libfprint/tests/umockdev-test.py", line 17, in <genexpr>
    version = tuple(int(_) for _ in umockdev_version.split(b'.'))
                    ^^^^^^
ValueError: invalid literal for int() with base 10: b'g9049374\n'
This commit is contained in:
Bastien Nocera
2022-08-16 15:31:13 +02:00
parent c3e88f6e46
commit e782de3747

View File

@@ -14,7 +14,7 @@ if len(sys.argv) != 2:
# Check that umockdev is available # Check that umockdev is available
try: try:
umockdev_version = subprocess.check_output(['umockdev-run', '--version']) umockdev_version = subprocess.check_output(['umockdev-run', '--version'])
version = tuple(int(_) for _ in umockdev_version.split(b'.')) version = tuple(int(_) for _ in umockdev_version.split(b'.')[:3])
if version < (0, 13, 2): if version < (0, 13, 2):
print('umockdev is too old for test to be reliable, expect random failures!') print('umockdev is too old for test to be reliable, expect random failures!')
print('Please update umockdev to at least 0.13.2.') print('Please update umockdev to at least 0.13.2.')