[{"id":11416,"web_url":"https://patchwork.libcamera.org/comment/11416/","msgid":"<20200716005619.GP6144@pendragon.ideasonboard.com>","date":"2020-07-16T00:56:19","subject":"Re: [libcamera-devel] [PATCH] tests: v4l2_compat: Fix\n\tv4l2-compliance and v4l2-ctl version parsing","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nThank you for the patch.\n\nOn Wed, Jul 15, 2020 at 11:29:57PM +0900, Paul Elder wrote:\n> v4l2-compliance originally printed the SHA before the version, leading\n> to the indexing that was used previously. Now that the version is\n> printed before the SHA, the indexing is incorrect. Fix this.\n> \n> Although v4l2-ctl doesn't suffer the same issue, it is more correct to\n> use the zeroth index like the v4l2-compliance version check now does, so\n> fix that as well.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n>  test/v4l2_compat/v4l2_compat_test.py | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py\n> index b054fe6..9867ece 100755\n> --- a/test/v4l2_compat/v4l2_compat_test.py\n> +++ b/test/v4l2_compat/v4l2_compat_test.py\n> @@ -94,7 +94,7 @@ def main(argv):\n>          return TestSkip\n>  \n>      ret, out = run_with_stdout(v4l2_compliance, '--version')\n> -    if (ret != 0 or version.parse(out[-2].split()[-1]) < MIN_V4L_UTILS_VERSION):\n> +    if (ret != 0 or version.parse(out[0].split()[-1]) < MIN_V4L_UTILS_VERSION):\n\nWe could also grep for the line containing the version, in case the\nv4l2-compliance and v4l2-ctl tool get later extended with more output\nfor --version. Up to you.\n\nBy the way, you don't need the outer parentheses.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>          print('v4l2-compliance version >= 1.21.0 required')\n>          return TestSkip\n>  \n> @@ -104,7 +104,7 @@ def main(argv):\n>          return TestSkip\n>  \n>      ret, out = run_with_stdout(v4l2_ctl, '--version')\n> -    if (ret != 0 or version.parse(out[-2].split()[-1]) < MIN_V4L_UTILS_VERSION):\n> +    if (ret != 0 or version.parse(out[0].split()[-1]) < MIN_V4L_UTILS_VERSION):\n>          print('v4l2-ctl version >= 1.21.0 required')\n>          return TestSkip\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4DC39BD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 16 Jul 2020 00:56:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C3AC060579;\n\tThu, 16 Jul 2020 02:56:30 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F5156054C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Jul 2020 02:56:29 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 81EA7564;\n\tThu, 16 Jul 2020 02:56:27 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"LmyAUlcd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594860987;\n\tbh=fbK3dc6Db0LP1dj0yB3kS8gQ5YuRHLBYYPYSs14MbYM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LmyAUlcdlgg4ybiMbSZXjlOag21BArzLbJjVMipI/SaX/IjDtMtyMoNz/2Kwy/NUf\n\tLiP/Ki0dNCv5MZGmqpPpxWhNryAG6p1QuxSShuNF1vXnMSqdq+IJiwbia8cBawxlFA\n\t8wDixHG8oPwcJe1KrSPiCX9JFvznK9OhUKKdG0pU=","Date":"Thu, 16 Jul 2020 03:56:19 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<20200716005619.GP6144@pendragon.ideasonboard.com>","References":"<20200715142957.24603-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200715142957.24603-1-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] tests: v4l2_compat: Fix\n\tv4l2-compliance and v4l2-ctl version parsing","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]