From patchwork Fri Jul 10 14:15:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 8741 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 169AABD792 for ; Fri, 10 Jul 2020 14:15:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9A8A76048B; Fri, 10 Jul 2020 16:15:32 +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="PAljE+52"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 180BD6048A for ; Fri, 10 Jul 2020 16:15:31 +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 7502924A; Fri, 10 Jul 2020 16:15:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594390530; bh=pu7Y9MxN2gTKVDBey7sxu6mu7whTzq2FyzcyUFtoUqY=; h=From:To:Cc:Subject:Date:From; b=PAljE+52Jb+PW5i2FZvJW968iwt8cx4uIzwwnv+KxC+cA5RncxTfbbJSlnkXU8P1J nueXywuF4n8Y14SHfUv/5EVVtK6R+e5s8ui6MOHM+6QdsnS61rztoUE5VsPUGHDMVU 9oakllNyVicrBgmR56aGXYvnMII983yEUv0bsCmo= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 10 Jul 2020 23:15:07 +0900 Message-Id: <20200710141508.468834-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] tests: v4l2_compat: Prettify failure output 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" When a test is being run on a video device, there is output like so: Testing /dev/video0 with uvcvideo driver... and when it succeeds, "success" is appended: Testing /dev/video0 with uvcvideo driver... success On failure, however, the output of v4l2-compliance is printed before "failure" is printed, resulting in the first line of the v4l2-compliance output to be printed on the same line as the message: Testing /dev/video2 with uvcvideo driver... v4l2-compliance SHA: not available, 64 bits failure Move printing of "failure" to the print_output_arr(), where the failed test output is printed, to prettify the output upon failure. Signed-off-by: Paul Elder --- test/v4l2_compat/v4l2_compat_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py index 99b3d5a..8a8e59e 100755 --- a/test/v4l2_compat/v4l2_compat_test.py +++ b/test/v4l2_compat/v4l2_compat_test.py @@ -55,6 +55,7 @@ def extract_result(result): def print_output_arr(output_arr): + print('failed') print('\n'.join(output_arr)) @@ -135,7 +136,6 @@ def main(argv): ret = test_v4l2_compliance(v4l2_compliance, v4l2_compat, device, driver) if ret == TestFail: failed.append(device) - print('failed') else: print('success') drivers_tested[driver] = True From patchwork Fri Jul 10 14:15:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 8742 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 4BEC8BD792 for ; Fri, 10 Jul 2020 14:15:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ED51560491; Fri, 10 Jul 2020 16:15:33 +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="ix397TAf"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DB9866048E for ; Fri, 10 Jul 2020 16:15:32 +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 6334624A; Fri, 10 Jul 2020 16:15:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594390532; bh=an8UnZLBpD9vilkwcygVHV2cfqGUdiDBWT7hrUlc9+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ix397TAfaZutSgeUZYRozuuJGdKWp3VckqYxUdBVFB8DTh919K230JSeOOw5pwWT0 VVSVGN7NeH4T4c99bgHv3tJixjG3xv3MdSicC36GG8HP2kkkD2h3etl4CnwF9mhMA3 J9CA8f74XTHGMrXbpgPT7HbRMkk3+iiiqZ9YDzL4= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 10 Jul 2020 23:15:08 +0900 Message-Id: <20200710141508.468834-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200710141508.468834-1-paul.elder@ideasonboard.com> References: <20200710141508.468834-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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, though since neither of them currently are able to print their version, simply checking if they can do so is sufficient. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- Obviously this depends on v4l2-compliance and v4l2-ctl having --version, so that needs to be accepted first before this can be merged. --- test/v4l2_compat/v4l2_compat_test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/v4l2_compat/v4l2_compat_test.py b/test/v4l2_compat/v4l2_compat_test.py index 8a8e59e..c97ae79 100755 --- a/test/v4l2_compat/v4l2_compat_test.py +++ b/test/v4l2_compat/v4l2_compat_test.py @@ -98,11 +98,21 @@ def main(argv): print('v4l2-compliance is not available') return TestSkip + ret, _ = run_with_stdout(v4l2_compliance, '--version') + if (ret != 0): + 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, _ = run_with_stdout(v4l2_ctl, '--version') + if (ret != 0): + 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')