From patchwork Sat Jul 11 05:45:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 8744 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C509FBD790 for ; Sat, 11 Jul 2020 05:46:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8E55860553; Sat, 11 Jul 2020 07:46:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="aFhINSe8"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BDE806054E for ; Sat, 11 Jul 2020 07:46:10 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0507D2FD; Sat, 11 Jul 2020 07:46:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594446370; bh=M9FDyUefJPqH2kTAEvEuIO46D+x5nddX4WcUn43ZHJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aFhINSe8hsYMGbtU0iwBlHu0K2Ps/rXQGmszFMX4FHAnV8hR57ZmmrdDaEtxkCtrJ GaU1tYFRPgzvXTLz0Sx1vobAuwMNdT1si2XiY1in3O91Cyu31xT02JNH0Lo5j0rLAr k2f9nIAfRF+3+qJEI/b0dUKorRLPtqg9BnrEqnzE= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Sat, 11 Jul 2020 14:45:55 +0900 Message-Id: <20200711054555.495244-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200711054555.495244-1-paul.elder@ideasonboard.com> References: <20200711054555.495244-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/2] tests: v4l2_compat: Check v4l2-compliance and v4l2-ctl versions X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" v4l2-compliance and v4l2-ctl with version 1.20 and before will fail with v4l2-compat. Check the versions of v4l2-compliance and v4l2-ctl before continuing. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- Changes in v2: - actually check the version number --- test/v4l2_compat/v4l2_compat_test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py index 8aca222..b054fe6 100755 --- a/test/v4l2_compat/v4l2_compat_test.py +++ b/test/v4l2_compat/v4l2_compat_test.py @@ -9,12 +9,15 @@ import argparse import glob import os +from packaging import version import re import shutil import signal import subprocess import sys +MIN_V4L_UTILS_VERSION = version.parse("1.21.0") + TestPass = 0 TestFail = -1 TestSkip = 77 @@ -90,11 +93,21 @@ def main(argv): print('v4l2-compliance is not available') return TestSkip + ret, out = run_with_stdout(v4l2_compliance, '--version') + if (ret != 0 or version.parse(out[-2].split()[-1]) < MIN_V4L_UTILS_VERSION): + print('v4l2-compliance version >= 1.21.0 required') + return TestSkip + v4l2_ctl = shutil.which('v4l2-ctl') if v4l2_ctl is None: print('v4l2-ctl is not available') return TestSkip + ret, out = run_with_stdout(v4l2_ctl, '--version') + if (ret != 0 or version.parse(out[-2].split()[-1]) < MIN_V4L_UTILS_VERSION): + print('v4l2-ctl version >= 1.21.0 required') + return TestSkip + dev_nodes = glob.glob('/dev/video*') if len(dev_nodes) == 0: print('no video nodes available to test with')