get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78057,
    "url": "https://patches.dpdk.org/api/patches/78057/?format=api",
    "web_url": "https://patches.dpdk.org/project/dts/patch/20200918111926.96466-1-weix.ling@intel.com/",
    "project": {
        "id": 3,
        "url": "https://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": "<20200918111926.96466-1-weix.ling@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dts/20200918111926.96466-1-weix.ling@intel.com",
    "date": "2020-09-18T11:19:26",
    "name": "[V3] tests/TestSuite_ptpclient:support meson build and restore systime form RTC time",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "64a8fc950168ab07d3cf70bd71daf6d7d49cd677",
    "submitter": {
        "id": 1828,
        "url": "https://patches.dpdk.org/api/people/1828/?format=api",
        "name": "Ling, WeiX",
        "email": "weix.ling@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dts/patch/20200918111926.96466-1-weix.ling@intel.com/mbox/",
    "series": [
        {
            "id": 12329,
            "url": "https://patches.dpdk.org/api/series/12329/?format=api",
            "web_url": "https://patches.dpdk.org/project/dts/list/?series=12329",
            "date": "2020-09-18T11:19:26",
            "name": "[V3] tests/TestSuite_ptpclient:support meson build and restore systime form RTC time",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/12329/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/78057/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/78057/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B321AA04B7;\n\tFri, 18 Sep 2020 05:24:02 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8A9681D6D6;\n\tFri, 18 Sep 2020 05:24:02 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id 18C0B1D6C8\n for <dts@dpdk.org>; Fri, 18 Sep 2020 05:24:00 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 17 Sep 2020 20:23:57 -0700",
            "from unknown (HELO localhost.localdomain) ([10.240.183.222])\n by orsmga002.jf.intel.com with ESMTP; 17 Sep 2020 20:23:55 -0700"
        ],
        "IronPort-SDR": [
            "\n MmkyG8XSLGxOfrUWproPfwOTIGECJhe9ga/LqbG8bGJhKuvboM9mBdc/E4vLCfiXd8oWjoXQTW\n +Pd6vIc0+FPg==",
            "\n zI0LS/oZMbKWZSm8T/2xvT4VY7PjB0bKtV+oY6+JLOZq04No7RZyRhvbVszq/d2jPBo/yLWWkg\n 9VdxzLudew1w=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9747\"; a=\"147595754\"",
            "E=Sophos;i=\"5.77,273,1596524400\"; d=\"scan'208\";a=\"147595754\"",
            "E=Sophos;i=\"5.77,273,1596524400\"; d=\"scan'208\";a=\"320465156\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "lingwei <weix.ling@intel.com>",
        "To": "dts@dpdk.org",
        "Cc": "lingwei <weix.ling@intel.com>",
        "Date": "Fri, 18 Sep 2020 11:19:26 +0000",
        "Message-Id": "<20200918111926.96466-1-weix.ling@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "Subject": "[dts] [PATCH V3] tests/TestSuite_ptpclient:support meson build and\n\trestore systime form RTC time",
        "X-BeenThere": "dts@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "v1:\n1.use app name to support meson build.\n2.restore systime form RTC time in tear_down_all.\nv2:\n1.use re to get the right RTC time when kill app.\nv3:\n1.use killall self.app_name to kill app avoid when other suite exception\ncan't get the pid by re.\n\nSigned-off-by: lingwei <weix.ling@intel.com>\n---\n tests/TestSuite_ptpclient.py | 27 ++++++++++++++-------------\n 1 file changed, 14 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/tests/TestSuite_ptpclient.py b/tests/TestSuite_ptpclient.py\nindex 5a524b9..07bfde6 100644\n--- a/tests/TestSuite_ptpclient.py\n+++ b/tests/TestSuite_ptpclient.py\n@@ -50,19 +50,18 @@ class TestPtpClient(TestCase):\n         self.verify(\"command not found\" not in out, \"ptp4l not install\")\n         dutPorts = self.dut.get_ports()\n         self.verify(len(dutPorts) > 0, \"No ports found for \" + self.nic)\n-        global default\n-        default = self.dut.send_expect(\"cat config/common_base |grep IEEE1588=\", \"# \") \n \n         # Change the config file to support IEEE1588 and recompile the package.\n-        self.dut.send_expect(\"sed -i -e 's/%s$/CONFIG_RTE_LIBRTE_IEEE1588=y/' config/common_base\" % default, \"# \", 30)\n+        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'y'})\n         self.dut.skip_setup = False\n         self.dut.build_install_dpdk(self.target)\n \n         # build sample app\n         out = self.dut.build_dpdk_apps(\"examples/ptpclient\")\n+        self.app_ptpclient_path = self.dut.apps_name['ptpclient']\n         self.verify(\"Error\" not in out, \"compilation error 1\")\n         self.verify(\"No such file\" not in out, \"compilation error 2\")\n-\n+        self.app_name = self.app_ptpclient_path[self.app_ptpclient_path.rfind('/')+1:]\n         port = self.tester.get_local_port(dutPorts[0])\n         self.itf0 = self.tester.get_interface(port)\n \n@@ -87,11 +86,7 @@ class TestPtpClient(TestCase):\n         self.result_table_print()\n \n     def kill_ptpclient(self):\n-        out_ps = self.dut.send_expect(\"ps -C ptpclient -L -opid,args\", \"# \")\n-        utils.regexp(out_ps, r'(\\d+) ./examples/ptpclient')\n-        pid = re.compile(r'(\\d+) ./examples/ptpclient')\n-        pid_num = list(set(pid.findall(out_ps)))\n-        out_ps = self.dut.send_expect(\"kill %s\" % pid_num[0], \"# \")\n+        self.dut.send_expect(\"killall %s\" % self.app_name, \"# \")\n \n     def test_ptpclient(self):\n         \"\"\"\n@@ -104,7 +99,8 @@ class TestPtpClient(TestCase):\n             self.tester.send_expect(\"ptp4l -i %s -2 -m -S &\" % self.itf0, \"ptp4l\")\n \n         # run ptpclient on the background\n-        self.dut.send_expect(\"./examples/ptpclient/build/ptpclient -c f -n 3 -- -T 0 -p 0x1 \" + \"&\", \"Delta between master and slave\", 60)\n+        self.dut.send_expect(\"./%s -c f -n 3 -- -T 0 -p 0x1 \" % self.app_ptpclient_path + \"&\",\n+                             \"Delta between master and slave\", 60)\n         time.sleep(3)\n         out = self.dut.get_session_output()\n         self.kill_ptpclient()\n@@ -134,7 +130,8 @@ class TestPtpClient(TestCase):\n             self.tester.send_expect(\"ptp4l -i %s -2 -m -S &\" % self.itf0, \"ptp4l\")\n \n         # run ptpclient on the background\n-        self.dut.send_expect(\"./examples/ptpclient/build/ptpclient -c f -n 3 -- -T 1 -p 0x1\" + \"&\", \"Delta between master and slave\", 60)\n+        self.dut.send_expect(\"./%s -c f -n 3 -- -T 1 -p 0x1\" % self.app_ptpclient_path + \"&\",\n+                             \"Delta between master and slave\", 60)\n         time.sleep(3)\n         out = self.dut.get_session_output()\n \n@@ -158,7 +155,7 @@ class TestPtpClient(TestCase):\n         # the output will include kill process info, at that time need get system time again.\n         if len(dut_out) != len(tester_out):\n             dut_out = self.dut.send_expect(\"date -u '+%Y-%m-%d %H:%M'\", \"# \")\n-        ## In rare cases minute may change while getting time. So get time again\n+        # In rare cases minute may change while getting time. So get time again\n         if dut_out != tester_out:\n             tester_out = self.tester.send_expect(\"date -u '+%Y-%m-%d %H:%M'\", \"# \")\n             dut_out = self.dut.send_expect(\"date -u '+%Y-%m-%d %H:%M'\", \"# \")\n@@ -175,6 +172,10 @@ class TestPtpClient(TestCase):\n         \"\"\"\n         Run after each test suite.\n         \"\"\"\n+        # Restore the systime from RTC time.\n+        out = self.dut.send_expect(\"hwclock\", \"# \")\n+        rtc_time = re.findall(r\"(\\d{4}-\\d{2}-\\d{2}\\s\\d{2}:\\d{2}:\\d{2})\", out)[0]\n+        self.dut.send_command('date -s \"%s\"' % rtc_time, \"# \")\n         # Restore the config file and recompile the package.\n-        self.dut.send_expect(\"sed -i -e 's/CONFIG_RTE_LIBRTE_IEEE1588=y$/%s/' config/common_base\" % default, \"# \", 30)\n+        self.dut.set_build_options({'RTE_LIBRTE_IEEE1588': 'n'})\n         self.dut.build_install_dpdk(self.target)\n",
    "prefixes": [
        "V3"
    ]
}