get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 135229,
    "url": "https://patches.dpdk.org/api/patches/135229/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20231215130656.247582-1-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20231215130656.247582-1-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231215130656.247582-1-bruce.richardson@intel.com",
    "date": "2023-12-15T13:06:56",
    "name": "[RFC] app/test: allow passing a parameter string to autotests",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "feb0022fccdf1d1eae7e5cb0e7c48459b9103654",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20231215130656.247582-1-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 30578,
            "url": "https://patches.dpdk.org/api/series/30578/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=30578",
            "date": "2023-12-15T13:06:56",
            "name": "[RFC] app/test: allow passing a parameter string to autotests",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/30578/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/135229/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/135229/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 13308436FE;\n\tFri, 15 Dec 2023 14:07:11 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 920B94326E;\n\tFri, 15 Dec 2023 14:07:10 +0100 (CET)",
            "from mgamail.intel.com (mgamail.intel.com [134.134.136.126])\n by mails.dpdk.org (Postfix) with ESMTP id 4A1CE40299\n for <dev@dpdk.org>; Fri, 15 Dec 2023 14:07:09 +0100 (CET)",
            "from orviesa001.jf.intel.com ([10.64.159.141])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 Dec 2023 05:07:07 -0800",
            "from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.152])\n by orviesa001.jf.intel.com with ESMTP; 15 Dec 2023 05:07:06 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1702645629; x=1734181629;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=1OgiObRELLhyYm61k7H/bJ6LJUSdQSBNX+FdHMYQnIk=;\n b=m9Um2hpUmWcHWSZKCNIoyc1oxukd55UdwEPvYp2NrwFbQ+gpcAQzs3fa\n N8ur14Aq1LKyZWlHrHjVxDa9SuM04p8207g7ZRHGCA06AKrhdWp+lEeoB\n zAv9P09mTqrDI880iWnAt09ZAwyWxbruOMkjGGIs4dT4dwWPIVboBDjD/\n aWKLM9rydA+DbR/TxagLzJXQ10aupWxGE58hFeMmQiTOuz2+lOosfXBOz\n e3Y3C4RBXo+Vfu2niYvVUC6uuohSNrhQjEshtpjL2NsCHzxxsVLFr5dM5\n hFQhkCZsm2F674cv9EsYynVbQBioagU70I3bCmvimOI8d0CyrIRUjXhaL A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10924\"; a=\"380268495\"",
            "E=Sophos;i=\"6.04,278,1695711600\"; d=\"scan'208\";a=\"380268495\"",
            "E=Sophos;i=\"6.04,278,1695711600\"; d=\"scan'208\";a=\"22833213\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>",
        "Subject": "[RFC PATCH] app/test: allow passing a parameter string to autotests",
        "Date": "Fri, 15 Dec 2023 13:06:56 +0000",
        "Message-Id": "<20231215130656.247582-1-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.40.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Sometimes it can be nice to have autotests which can take a parameter,\nor can be tweaked in some ways, e.g. adjust the number of iterations, or\nthe burst size used in the test. Currently there is no way to do so -\nall test parameters are hardcoded, which makes sense for a generic\nregression test to be run quickly, but is a bit lacking for those\nlooking to use unit tests for investigations.\n\nTo that end, we can all the commandline to accept an additional string\nparameter after each autotest name, and make that available via global\nvariable. Any test which wishes to make use of this can do so, to allow\noverriding test defaults.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n app/test/commands.c                   | 33 ++++++++++++++++++++++++++-\n app/test/test.h                       |  2 ++\n doc/guides/contributing/unit_test.rst | 15 ++++++++++++\n 3 files changed, 49 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/app/test/commands.c b/app/test/commands.c\nindex 497d8e9952..7672e9db6b 100644\n--- a/app/test/commands.c\n+++ b/app/test/commands.c\n@@ -40,6 +40,8 @@\n \n #include \"test.h\"\n \n+char *test_parameter = NULL;\n+\n /****************/\n \n static struct test_commands_list commands_list =\n@@ -55,14 +57,25 @@ struct cmd_autotest_result {\n \tcmdline_fixed_string_t autotest;\n };\n \n+struct cmd_autotest_param_result {\n+\tcmdline_fixed_string_t autotest;\n+\tcmdline_fixed_string_t param;\n+};\n+\n static void cmd_autotest_parsed(void *parsed_result,\n \t\t\t\t__rte_unused struct cmdline *cl,\n-\t\t\t\t__rte_unused void *data)\n+\t\t\t\tvoid *data)\n {\n \tstruct test_command *t;\n \tstruct cmd_autotest_result *res = parsed_result;\n \tint ret = 0;\n \n+\ttest_parameter = NULL;\n+\tif (data == (void *)1) {\n+\t\tstruct cmd_autotest_param_result *pres = parsed_result;\n+\t\ttest_parameter = pres->param;\n+\t}\n+\n \tTAILQ_FOREACH(t, &commands_list, next) {\n \t\tif (!strcmp(res->autotest, t->command))\n \t\t\tret = t->callback();\n@@ -92,6 +105,22 @@ cmdline_parse_inst_t cmd_autotest = {\n \t},\n };\n \n+cmdline_parse_token_string_t cmd_autotest_param_autotest =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_autotest_param_result, autotest, \"\");\n+cmdline_parse_token_string_t cmd_autotest_param_param =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_autotest_param_result, param, NULL);\n+\n+cmdline_parse_inst_t cmd_autotest_with_param = {\n+\t.f = cmd_autotest_parsed,\n+\t.data = (void *)1,\n+\t.help_str = \"launch autotest, providing a string parameter\",\n+\t.tokens = {\n+\t\t\t(void *)&cmd_autotest_param_autotest,\n+\t\t\t(void *)&cmd_autotest_param_param,\n+\t\t\tNULL,\n+\t},\n+};\n+\n /****************/\n \n struct cmd_dump_result {\n@@ -348,6 +377,7 @@ cmdline_parse_inst_t cmd_set_rxtx_sc = {\n \n cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_autotest,\n+\t(cmdline_parse_inst_t *)&cmd_autotest_with_param,\n \t(cmdline_parse_inst_t *)&cmd_dump,\n \t(cmdline_parse_inst_t *)&cmd_dump_one,\n \t(cmdline_parse_inst_t *)&cmd_quit,\n@@ -378,5 +408,6 @@ int commands_init(void)\n \t}\n \n \tcmd_autotest_autotest.string_data.str = commands;\n+\tcmd_autotest_param_autotest.string_data.str = commands;\n \treturn 0;\n }\ndiff --git a/app/test/test.h b/app/test/test.h\nindex 15e23d297f..3910317027 100644\n--- a/app/test/test.h\n+++ b/app/test/test.h\n@@ -27,6 +27,8 @@\n \n #include <rte_test.h>\n \n+extern char *test_parameter;\n+\n #define TEST_ASSERT RTE_TEST_ASSERT\n \n #define TEST_ASSERT_EQUAL RTE_TEST_ASSERT_EQUAL\ndiff --git a/doc/guides/contributing/unit_test.rst b/doc/guides/contributing/unit_test.rst\nindex 063cefa192..2ce64e2db7 100644\n--- a/doc/guides/contributing/unit_test.rst\n+++ b/doc/guides/contributing/unit_test.rst\n@@ -374,6 +374,21 @@ Example::\n    ...\n \n \n+Optional test parameters\n+-------------------------\n+\n+Each unit test suite must be runable without any additional test parameters,\n+since automated testing via ``meson test``, and many DPDK Continuous Integration(CI) frameworks,\n+will just call each test via cmdline-parameter to the ``dpdk-test`` binary\n+or by setting the test name in the ``DPDK_TEST`` environment variable.\n+\n+However, when run interactively via ``dpdk-test`` CLI,\n+an additional parameter may be passed to the autotest command.\n+This parameter will be available to the test in the ``test_parameter`` global variable.\n+This support is intended for developer use only as a convenience.\n+It is up to the each test how to use this parameter and what form it may have.\n+\n+\n Checking code coverage\n ----------------------\n \n",
    "prefixes": [
        "RFC"
    ]
}