get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 102148,
    "url": "http://patches.dpdk.org/api/patches/102148/?format=api",
    "web_url": "http://patches.dpdk.org/project/dts/patch/1634633396-186116-1-git-send-email-songx.jiale@intel.com/",
    "project": {
        "id": 3,
        "url": "http://patches.dpdk.org/api/projects/3/?format=api",
        "name": "DTS",
        "link_name": "dts",
        "list_id": "dts.dpdk.org",
        "list_email": "dts@dpdk.org",
        "web_url": "",
        "scm_url": "git://dpdk.org/tools/dts",
        "webscm_url": "http://git.dpdk.org/tools/dts/",
        "list_archive_url": "https://inbox.dpdk.org/dts",
        "list_archive_url_format": "https://inbox.dpdk.org/dts/{}",
        "commit_url_format": ""
    },
    "msgid": "<1634633396-186116-1-git-send-email-songx.jiale@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dts/1634633396-186116-1-git-send-email-songx.jiale@intel.com",
    "date": "2021-10-19T08:49:56",
    "name": "[V2] tests/dcf_lifecycle: add a method to create and check acl rule",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d9b9b16a7e49e884d62c33feeb680010aac9d615",
    "submitter": {
        "id": 2352,
        "url": "http://patches.dpdk.org/api/people/2352/?format=api",
        "name": "Jiale, SongX",
        "email": "songx.jiale@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dts/patch/1634633396-186116-1-git-send-email-songx.jiale@intel.com/mbox/",
    "series": [
        {
            "id": 19772,
            "url": "http://patches.dpdk.org/api/series/19772/?format=api",
            "web_url": "http://patches.dpdk.org/project/dts/list/?series=19772",
            "date": "2021-10-19T08:49:56",
            "name": "[V2] tests/dcf_lifecycle: add a method to create and check acl rule",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/19772/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/102148/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/102148/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dts-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 0A058A0C43;\n\tTue, 19 Oct 2021 10:36:08 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CB3D240142;\n\tTue, 19 Oct 2021 10:36:08 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id 648044003E\n for <dts@dpdk.org>; Tue, 19 Oct 2021 10:36:07 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Oct 2021 01:36:04 -0700",
            "from unknown (HELO dpdk-zhaohy-t.sh.intel.com) ([10.240.183.68])\n by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Oct 2021 01:36:02 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10141\"; a=\"251926522\"",
            "E=Sophos;i=\"5.85,383,1624345200\"; d=\"scan'208\";a=\"251926522\"",
            "E=Sophos;i=\"5.85,383,1624345200\"; d=\"scan'208\";a=\"493997400\""
        ],
        "From": "Jiale Song <songx.jiale@intel.com>",
        "To": "dts@dpdk.org",
        "Cc": "Jiale Song <songx.jiale@intel.com>",
        "Date": "Tue, 19 Oct 2021 16:49:56 +0800",
        "Message-Id": "<1634633396-186116-1-git-send-email-songx.jiale@intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "Subject": "[dts] [PATCH V2] tests/dcf_lifecycle: add a method to create and\n check acl rule",
        "X-BeenThere": "dts@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "test suite reviews and discussions <dts.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dts>,\n <mailto:dts-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dts/>",
        "List-Post": "<mailto:dts@dpdk.org>",
        "List-Help": "<mailto:dts-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dts>,\n <mailto:dts-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dts-bounces@dpdk.org",
        "Sender": "\"dts\" <dts-bounces@dpdk.org>"
    },
    "content": "as the priority of switch rule becomes higher, some rules that support switch cannot be \ndownloaded directly to acl. add a method to create and check acl rule.\n\nSigned-off-by: Jiale Song <songx.jiale@intel.com>\n---\n tests/TestSuite_dcf_lifecycle.py | 58 +++++++++++++++++++++++++++++++-\n 1 file changed, 57 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/tests/TestSuite_dcf_lifecycle.py b/tests/TestSuite_dcf_lifecycle.py\nindex d47ef2b..ce51ea1 100755\n--- a/tests/TestSuite_dcf_lifecycle.py\n+++ b/tests/TestSuite_dcf_lifecycle.py\n@@ -315,6 +315,7 @@ class TestDcfLifeCycle(TestCase):\n             \"-c {core_mask} \"\n             \"-n {mem_channel} \"\n             \"{allowlist} \"\n+            \"--log-level=ice,7 \"\n             \"--file-prefix={prefix} \"\n             \"-- -i \").format(**{\n                 'bin': ''.join(['./',self.vf_dcf_testpmd]),\n@@ -374,6 +375,7 @@ class TestDcfLifeCycle(TestCase):\n             \"-c {core_mask} \"\n             \"-n {mem_channel} \"\n             \"{allowlist} \"\n+            \"--log-level=ice,7 \"\n             \"--file-prefix={prefix} \"\n             \"-- -i \").format(**{\n                 'bin': ''.join(['./',self.vf_testpmd2]),\n@@ -1020,6 +1022,59 @@ class TestDcfLifeCycle(TestCase):\n         self.preset_pmd_res()\n         self.vf_create()\n \n+    def create_acl_filter_rule(self, rules, session_name=\"\", check_stats=True):\n+        \"\"\"\n+        create acl filter rules\n+        \"\"\"\n+        if session_name == \"\":\n+            session_name = self.dut\n+        p = re.compile(r\"Flow rule #(\\d+) created\")\n+        rule_list = []\n+        switch_rule = \"Succeeded to create (2) flow\"\n+        switch_id = ''\n+        acl_rule = \"Succeeded to create (4) flow\"\n+        if isinstance(rules, list):\n+            for rule in rules:\n+                if 'sctp' not in rule:\n+                    # create switch rule\n+                    switch_out = session_name.send_expect(rule, \"testpmd> \")\n+                    self.verify(switch_rule in switch_out, 'switch rule create failed')\n+                    switch_id = p.findall(switch_out)[0]\n+                # create acl rule\n+                acl_out = session_name.send_expect(rule, \"testpmd> \")\n+                # destory switch rule\n+                if switch_id != '':\n+                    session_name.send_expect(\"flow destroy %s rule %s\" % (0, switch_id), \"testpmd> \")\n+                if acl_rule in acl_out:\n+                    m = p.search(acl_out)\n+                    if m:\n+                        rule_list.append(m.group(1))\n+                    else:\n+                        rule_list.append(False)\n+        else:\n+            if 'sctp' not in rules:\n+                # create switch rule\n+                switch_out = session_name.send_expect(rule, \"testpmd> \")\n+                self.verify(switch_rule in switch_out, 'switch rule create failed')\n+                switch_id = p.findall(switch_out)[0]\n+            # create acl rule\n+            acl_out = session_name.send_expect(rules, \"testpmd> \")\n+            # destory switch rule\n+            if switch_id != ''\n+                session_name.send_expect(\"flow destroy %s rule %s\" % (0, switch_id), \"testpmd> \")\n+            if acl_rule in acl_out:\n+                m = p.search(acl_out)\n+                if m:\n+                    rule_list.append(m.group(1))\n+                else:\n+                    rule_list.append(False)\n+\n+        if check_stats:\n+            self.verify(all(rule_list), \"some rules not created successfully, result %s, rule %s\" % (rule_list, rules))\n+        else:\n+            self.verify(not any(rule_list), \"all rules should create failed, result %s\" % rule_list)\n+        return rule_list\n+\n     def destroy_resource(self):\n         try:\n             self.vf_destroy()\n@@ -1232,7 +1287,8 @@ class TestDcfLifeCycle(TestCase):\n     def pretest_handle_acl_filter(self):\n         # Create an ACL rule, and send packet with dst mac of VF1, then it will dropped by VF1.\n         rule = 'flow create 0 priority 0 ingress pattern eth / ipv4 / tcp src spec 8010 src mask 65520 / end actions drop / end'\n-        self.d_con([rule, \"testpmd> \", 15])\n+        # acl rule\n+        self.create_acl_filter_rule(rule, check_stats=True)\n         self.check_rule_list()\n         self.send_pkt_to_vf1_first(self.dmac)\n         out = self.vf_pmd2_con(['stop', \"testpmd> \", 15])\n",
    "prefixes": [
        "V2"
    ]
}