Show a patch.

GET /api/1.1/patches/10012/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 10012,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10012/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10012/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20201007112544.3169293-2-kieran.bingham@ideasonboard.com>",
    "date": "2020-10-07T11:25:44",
    "name": "[libcamera-devel,RFC,1/1] test: cam tool testing with valgrind",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0f0246ebd547fbb52c256de23d246b939bcfbd90",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": {
        "id": 11,
        "url": "https://patchwork.libcamera.org/api/1.1/users/11/?format=api",
        "username": "kbingham",
        "first_name": "Kieran",
        "last_name": "Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/10012/mbox/",
    "series": [
        {
            "id": 1363,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1363/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1363",
            "date": "2020-10-07T11:25:43",
            "name": "test: Capture tests under valgrind (+RFC:TAP)",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1363/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10012/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10012/checks/",
    "tags": {},
    "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 679FEBEEDF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Oct 2020 11:25:50 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A25AC605AB;\n\tWed,  7 Oct 2020 13:25:49 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E89EE60562\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Oct 2020 13:25:47 +0200 (CEST)",
            "from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net\n\t[86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 71A53BBE;\n\tWed,  7 Oct 2020 13:25:47 +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=\"gFBHBtoK\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1602069947;\n\tbh=qfE3PsO0CDYHLxmO4vrhAHIzSfej8fdPY8Pi0ErdQZw=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=gFBHBtoKM+eiN+qnWH4kWKDPtWi6616qzn6lXq2uDNVDjN7S7/UMk5X8qNoDWDHTI\n\thmRbGcGdCOPTJHVCI5Ul+DXf8289+3fndRmZiv82zQUrmwagPAODUT/m753nx3alHS\n\tY9G/IQ4Y8M6CdbsRTsMdV3uYFfWcW5hVFBtsWB3E=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Wed,  7 Oct 2020 12:25:44 +0100",
        "Message-Id": "<20201007112544.3169293-2-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20201007112544.3169293-1-kieran.bingham@ideasonboard.com>",
        "References": "<20201007112544.3169293-1-kieran.bingham@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [RFC PATCH 1/1] test: cam tool testing with\n\tvalgrind",
        "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>",
        "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>"
    },
    "content": "Implement a test which runs cam to capture 10 frames,\nand validates there are no memory leaks with valgrind.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n\nA few points to consider here:\n\nDuration\n--------\nUnfortuantely this test adds an extra 13 seconds to the test run on my\nsystem. We could reduce the duration of course, but it will still be a\nreasonably substantial addition.\n\nTAP\n---\nThis runs a test for mulitiple cameras, and meson now supports 'tap'\nformat tests (multiple tests in one execution). In this patch - the\n'protocol : \"tap\" is disabled, because meson doesn't like the output of\nthe rest of the test being mixed with the tap output. I'm not sure of a\ngood way to handle that. The output is useful, so we want it somewhere,\nand ideally in the test log - but we also want the tap parsing to work\nin that case too.\nAnyway, with the tap protocol disabled, it just falls back to the return\nstatus which is also handled here. Still, this is a good opportunity to\nsee how 'tap' could help our tests, and might revive my old patches to\nuse common test helpers across the rest of test/\n\nValgrind\n--------\nParsing valgrind is a real pain. This test *only* checks to see if there\nare any memory leaks, and does not report on any of the other topics\nvalgirind might highlight. (They could be added later of course).\nIdeally we would want a machine parsable output from valgrind. It can\noutput an xml report ... but ... that's a lot more parsing too ;-)\n\nThoughts/Suggestions?\n\nhttps://github.com/adobe/chromium/blob/master/tools/valgrind/memcheck_analyze.py\nseems to show an existing tool that parses the valgrind output as one\npossible path - but I'm happy to hear of any better ideas too.\n\n\n\n test/cam/capture-test.sh | 71 ++++++++++++++++++++++++++++++++++++++++\n test/cam/meson.build     | 10 ++++++\n test/meson.build         |  1 +\n 3 files changed, 82 insertions(+)\n create mode 100755 test/cam/capture-test.sh\n create mode 100644 test/cam/meson.build",
    "diff": "diff --git a/test/cam/capture-test.sh b/test/cam/capture-test.sh\nnew file mode 100755\nindex 000000000000..ab808976be72\n--- /dev/null\n+++ b/test/cam/capture-test.sh\n@@ -0,0 +1,71 @@\n+#!/bin/sh\n+\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+\n+TestPass=0\n+TestFail=255\n+TestSkip=77\n+\n+# Initialise success, set for failure.\n+ret=$TestPass\n+\n+ok() {\n+\techo \"ok $*\"\n+}\n+\n+nok() {\n+\techo \"not ok $*\"\n+\tret=$TestFail\n+}\n+\n+valgrind=$(command -v valgrind)\n+\n+if [ x\"\" = x\"$valgrind\" ] ; then\n+\techo \"skip 1 - Valgrind unavailable ...\"\n+\texit $TestSkip\n+fi\n+\n+# Tests expect to be run from the meson.project_build_root()\n+cam=${1:-src/cam/cam}\n+\n+if [ ! -e \"$cam\" ] ; then\n+\tnok \"1 - failed to find cam utility.\"\n+\texit $TestFail\n+fi\n+\n+# Unfortunately, we don't have a 'machine interface', so we rely on parsing the\n+# output of cam...\n+num_cameras=$(\"$cam\" -l | grep -v \"Available\" | wc -l)\n+\n+# Enter TAP plan\n+echo \"1..$num_cameras\"\n+\n+for i in $(seq 1 1 \"$num_cameras\");\n+do\n+\t\"$cam\" -c \"$i\" -C10\n+\tret=$?\n+\tif [ $ret != 0 ] ; then\n+\t\tnok \"$i - $cam returned $ret\"\n+\t\tcontinue\n+\tfi\n+\n+\tlog_file=\"valgrind-cam-$i.log\"\n+\t\"$valgrind\" \"$cam\" -c \"$i\" -C10 > \"$log_file\" 2>&1\n+\tret=$?\n+\tif [ $ret != 0 ] ; then\n+\t\tnok \"$i - $valgrind returned $ret\"\n+\t\tcontinue\n+\tfi\n+\n+\t# I'd prefer a better way of checking there are no leaks, as well as reporting\n+\t# the different categories from valgrind as distinct tests.\n+\tif ! grep \"no leaks are possible\" \"$log_file\" > /dev/null; then\n+\t\tnok \"$i - Valgrind Errors detected\"\n+\t\tcat $log_file > /dev/stderr\n+\t\tcontinue\n+\tfi\n+\n+\tok \"$i - Camera $i reports no leaks\"\n+done;\n+\n+exit $ret\ndiff --git a/test/cam/meson.build b/test/cam/meson.build\nnew file mode 100644\nindex 000000000000..834c9bcf6b86\n--- /dev/null\n+++ b/test/cam/meson.build\n@@ -0,0 +1,10 @@\n+# SPDX-License-Identifier: CC0-1.0\n+\n+cam_capture = files('capture-test.sh')\n+\n+test('cam-capture-test', cam_capture,\n+    args : cam,\n+    suite : 'integration',\n+    is_parallel : false,\n+    #protocol : 'tap',\n+    timeout : 60)\ndiff --git a/test/meson.build b/test/meson.build\nindex 0a1d434e3996..d1b24220dc7c 100644\n--- a/test/meson.build\n+++ b/test/meson.build\n@@ -2,6 +2,7 @@\n \n subdir('libtest')\n \n+subdir('cam')\n subdir('camera')\n subdir('controls')\n subdir('ipa')\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "1/1"
    ]
}