[libcamera-devel,v3,7/7] test: v4l2_compat_test: Fix v4l2-compliance version parsing
diff mbox series

Message ID 20210909080902.239533-8-paul.elder@ideasonboard.com
State Accepted
Headers show
Series
  • v4l2-compat fixes
Related show

Commit Message

Paul Elder Sept. 9, 2021, 8:09 a.m. UTC
v4l2-compliance changed their version string:

v4l2-compliance 1.21.0-4618
v4l2-compliance SHA: cc211b76476aca2c072ffa83a9b003957d5f3909, 64 bits, 64-bit time_t

v4l2-compliance 1.21.0-4838, 64 bits, 64-bit time_t

The current parsing takes the last result of split, which works for the
former, but not the latter. Take the second result of split instead, and
strip away any commas.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/v4l2_compat/v4l2_compat_test.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py
index 51bfa952..ae892ced 100755
--- a/test/v4l2_compat/v4l2_compat_test.py
+++ b/test/v4l2_compat/v4l2_compat_test.py
@@ -94,7 +94,7 @@  def main(argv):
         return TestSkip
 
     ret, out = run_with_stdout(v4l2_compliance, '--version')
-    if ret != 0 or version.parse(out[0].split()[-1]) < MIN_V4L_UTILS_VERSION:
+    if ret != 0 or version.parse(out[0].split()[1].replace(',', '')) < MIN_V4L_UTILS_VERSION:
         print('v4l2-compliance version >= 1.21.0 required')
         return TestSkip