Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/111911/?format=api
http://patches.dpdk.org/api/patches/111911/?format=api", "web_url": "http://patches.dpdk.org/project/dts/patch/20220526091937.1276-1-weiyuanx.li@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": "<20220526091937.1276-1-weiyuanx.li@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/20220526091937.1276-1-weiyuanx.li@intel.com", "date": "2022-05-26T09:19:35", "name": "[V3,1/2] tests/meson_tests: add new testsuite for meson tests", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d88853043a0a8855f7e1b34f111c89b50dd90f92", "submitter": { "id": 2477, "url": "http://patches.dpdk.org/api/people/2477/?format=api", "name": "Weiyuan Li", "email": "weiyuanx.li@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dts/patch/20220526091937.1276-1-weiyuanx.li@intel.com/mbox/", "series": [ { "id": 23184, "url": "http://patches.dpdk.org/api/series/23184/?format=api", "web_url": "http://patches.dpdk.org/project/dts/list/?series=23184", "date": "2022-05-26T09:19:35", "name": "[V3,1/2] tests/meson_tests: add new testsuite for meson tests", "version": 3, "mbox": "http://patches.dpdk.org/series/23184/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/111911/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/111911/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 CCA67A0555;\n\tThu, 26 May 2022 11:19:49 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C594440E64;\n\tThu, 26 May 2022 11:19:49 +0200 (CEST)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 73F0940DF7\n for <dts@dpdk.org>; Thu, 26 May 2022 11:19:47 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 May 2022 02:19:46 -0700", "from shwdenpg560.ccr.corp.intel.com ([10.253.109.11])\n by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 May 2022 02:19:45 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1653556787; x=1685092787;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=4tIZrx9HmLZzII4/Zj+TYJuhT/SxFBSf4E3ZcecSODc=;\n b=G7M9CM8x/1470cPLni0viT83mlpdqZ/i+nyYOLrkmnORKqKlHTyc+dk2\n dxzfzhHMPvEVyrKRgbkf7Anuxk6k3UXMoZGNWWeA6bS8/+mif15xmtV4Z\n rAG9Q1grFcKwDERUuBZ3eY5m1J1hDtMruvTKyyvSZ1UNGNBuiySSC995v\n Ybo6dR9mEplNXBqB6+LMmEBwm43jZzuDcmygJOdb4JWrD2QFssxhOJ1ZQ\n lVzKFC4kBdPhXFz8e9YfdFIDZbsx5AbKQ9FsQv4sX/z+CwYDIDPxXZvaL\n 2XczS3Hy3EzfWJ58nG7D6gheUVZX12dRkcyU/xY4Rnb5o7MwbgvmvAcUN w==;", "X-IronPort-AV": [ "E=McAfee;i=\"6400,9594,10358\"; a=\"360483832\"", "E=Sophos;i=\"5.91,252,1647327600\"; d=\"scan'208\";a=\"360483832\"", "E=Sophos;i=\"5.91,252,1647327600\"; d=\"scan'208\";a=\"677384555\"" ], "From": "\"Li, WeiyuanX\" <weiyuanx.li@intel.com>", "To": "dts@dpdk.org,\n\tlijuan.tu@intel.com", "Cc": "Weiyuan Li <weiyuanx.li@intel.com>", "Subject": "[dts][PATCH V3 1/2] tests/meson_tests: add new testsuite for meson\n tests", "Date": "Thu, 26 May 2022 17:19:35 +0800", "Message-Id": "<20220526091937.1276-1-weiyuanx.li@intel.com>", "X-Mailer": "git-send-email 2.34.1.windows.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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" }, "content": "From: Weiyuan Li <weiyuanx.li@intel.com>\n\nAdd new testsuite for meson tests.\n\nSigned-off-by: Weiyuan Li <weiyuanx.li@intel.com>\n---\n\nv2:\n-fix format issue.\nv3:\n-add verification that the test result is empty\n\n tests/TestSuite_meson_tests.py | 233 +++++++++++++++++++++++++++++++++\n 1 file changed, 233 insertions(+)\n create mode 100644 tests/TestSuite_meson_tests.py", "diff": "diff --git a/tests/TestSuite_meson_tests.py b/tests/TestSuite_meson_tests.py\nnew file mode 100644\nindex 00000000..4b1f7df2\n--- /dev/null\n+++ b/tests/TestSuite_meson_tests.py\n@@ -0,0 +1,233 @@\n+# BSD LICENSE\n+#\n+# Copyright(c) 2022 Intel Corporation. All rights reserved.\n+# All rights reserved.\n+#\n+# Redistribution and use in source and binary forms, with or without\n+# modification, are permitted provided that the following conditions\n+# are met:\n+#\n+# * Redistributions of source code must retain the above copyright\n+# notice, this list of conditions and the following disclaimer.\n+# * Redistributions in binary form must reproduce the above copyright\n+# notice, this list of conditions and the following disclaimer in\n+# the documentation and/or other materials provided with the\n+# distribution.\n+# * Neither the name of Intel Corporation nor the names of its\n+# contributors may be used to endorse or promote products derived\n+# from this software without specific prior written permission.\n+#\n+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+\"\"\"\n+DPDK Test Suite.\n+\n+meson autotest\n+\"\"\"\n+import os\n+import re\n+from mimetypes import init\n+from sre_constants import SUCCESS\n+\n+import framework.utils as utils\n+from framework.test_case import TestCase\n+\n+\n+class TestMesonTests(TestCase):\n+ def set_up_all(self):\n+ \"\"\"\n+ Run at the start of each test suite.\n+ \"\"\"\n+ # icc compilation cost long long time.\n+ self.cores = self.dut.get_core_list(\"all\")\n+ self.dut_ip = self.dut.get_ip_address()\n+ self.timeout = 600\n+ # -t 2\n+ self.ratio = 6\n+ self.dut_pathlog = \"fast-test.log\"\n+ self.execute_wait_time = self.ratio * self.timeout * 10\n+ # skip scope\n+ self.SKIP_SCOPE = \"\"\n+ # Test log storage directory\n+ self.base_output = os.path.join(\n+ os.path.dirname(os.path.dirname(os.path.realpath(__file__))), \"output\"\n+ )\n+\n+ def set_up(self):\n+ \"\"\"\n+ Run before each test case.\n+ \"\"\"\n+ self.meson_auto_test = {}\n+\n+ def delete_exists_files(self):\n+ out = self.tester.send_command(\n+ f\"ls -l {self.base_output}/{self.dut_pathlog}\", \"# \"\n+ )\n+ if self.dut_pathlog in out:\n+ self.tester.send_command(f\"rm -rf {self.base_output}/{self.dut_pathlog}\")\n+\n+ def find_text(self, res):\n+ pattern = r\"(DPDK:fast-tests|DPDK:perf-tests|DPDK:debug-tests|DPDK:extra-tests|DPDK:driver-tests) / (\\w+)\\s+(\\w+)\\s+\"\n+ regex = re.compile(pattern)\n+ mo = regex.search(res)\n+\n+ if mo is None:\n+ return 0\n+ case_name = mo.group(2)\n+ test_result = mo.group(3)\n+\n+ self.meson_auto_test[case_name] = test_result\n+\n+ def check_sub_case(self):\n+ success = []\n+ skip = []\n+ timeout = []\n+ failed = []\n+\n+ self.verify(\n+ bool(self.meson_auto_test),\n+ f\"Test failed the meson no test results were obtained.\",\n+ )\n+\n+ for k, v in self.meson_auto_test.items():\n+ if v == \"FAIL\" and k not in self.SKIP_SCOPE:\n+ failed.append(k)\n+ elif v == \"OK\":\n+ success.append(k)\n+ elif v == \"SKIP\":\n+ skip.append(k)\n+ elif v == \"TIMEOUT\":\n+ timeout.append(k)\n+ else:\n+ failed.append(k)\n+\n+ for item in skip:\n+ self.logger.debug(utils.RED(f\"Skip sub case:{item}\"))\n+\n+ for item in timeout:\n+ self.logger.debug(utils.RED(f\"TimeOut sub case:{item}\"))\n+\n+ if (len(failed) + len(timeout)) > 0:\n+ sub_fail = \"\"\n+ sub_timeout = \"\"\n+ if len(failed) > 0:\n+ sub_fail = \"[\" + \",\".join(failed) + \"] sub case failed. \"\n+ if len(timeout) > 0:\n+ sub_timeout = \"[\" + \",\".join(timeout) + \"] sub case time out. \"\n+ self.verify(False, f\"Test failed. {sub_fail}{sub_timeout}\")\n+\n+ def check_scp_file_valid_between_dut(self):\n+ out = self.tester.send_command(\n+ f\"scp root@{self.dut_ip}:/root/{self.dut_pathlog} {self.base_output}\",\n+ timeout=15,\n+ )\n+ if \"Are you sure you want to continue connecting\" in out:\n+ out = self.tester.send_command(\"yes\", timeout=20)\n+ for item in range(30):\n+ if \"password\" in out:\n+ self.tester.send_command(self.dut.get_password(), timeout=20)\n+ break\n+\n+ out = self.tester.send_command(\n+ f\"ls -l {self.base_output}/{self.dut_pathlog}\", \"# \"\n+ )\n+ self.verify(\n+ \"No such file or directory\" not in out, \"No test result log was obtained!\"\n+ )\n+\n+ def insmod_kni(self):\n+ out = self.dut.send_expect(\"lsmod | grep rte_kni\", \"# \")\n+\n+ if \"rte_kni\" in out:\n+ self.dut.send_expect(\"rmmod rte_kni.ko\", \"# \")\n+\n+ out = self.dut.send_expect(\n+ \"insmod ./%s/kmod/rte_kni.ko lo_mode=lo_mode_fifo\" % (self.target), \"# \"\n+ )\n+ self.verify(\"Error\" not in out, \"Error loading KNI module: \" + out)\n+\n+ def check_meson_test_result(self, res=None):\n+ if not os.path.exists(f\"{self.base_output}/{self.dut_pathlog}\"):\n+ self.verify(False, \"meson tests log file is not exists!!\")\n+ if res is None:\n+ with open(f\"{self.base_output}/{self.dut_pathlog}\", \"r\") as file_obj:\n+ for files in file_obj:\n+ self.find_text(files)\n+ else:\n+ self.find_text(res)\n+ self.check_sub_case()\n+\n+ def test_fasts(self):\n+ # init file name\n+ self.dut_pathlog = \"fast-test.log\"\n+ self.delete_exists_files()\n+ self.insmod_kni()\n+ cmds = f'meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:fast-tests -t {self.ratio} --test-args=\"-c 0xff\" |tee /root/{self.dut_pathlog}'\n+ out = self.dut.send_expect(cmds, \"# \", self.execute_wait_time)\n+ self.logger.info(out)\n+ self.check_scp_file_valid_between_dut()\n+ self.check_meson_test_result()\n+\n+ def test_driver(self):\n+ # init file name\n+ self.dut_pathlog = \"driver-test.log\"\n+ self.delete_exists_files()\n+ cmds = f'meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:driver-tests -t {self.ratio} --test-args=\"-c 0xff\" |tee /root/{self.dut_pathlog}'\n+ out = self.dut.send_expect(cmds, \"# \", self.execute_wait_time)\n+ self.logger.info(out)\n+ self.check_scp_file_valid_between_dut()\n+ self.check_meson_test_result()\n+\n+ def test_debug(self):\n+ self.logger.warning(\n+ \"Debug-tests all case failed commands are not registered, there is a bug https://bugs.dpdk.org/show_bug.cgi?id=1002\"\n+ )\n+\n+ def test_extra(self):\n+ self.dut_pathlog = \"extra-test.log\"\n+ # delete exists files\n+ self.delete_exists_files()\n+ cmds = f'meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:extra-tests -t {self.ratio} --test-args=\"-c 0xff\" |tee /root/{self.dut_pathlog}'\n+ out = self.dut.send_expect(cmds, \"# \", self.execute_wait_time)\n+ self.logger.info(out)\n+ self.check_scp_file_valid_between_dut()\n+ self.check_meson_test_result()\n+ self.logger.warning(\n+ \"Extra-tests are know issues which are recorded in DPDK commit and meson.build (detail see test plan)\"\n+ )\n+\n+ def test_perf(self):\n+ # init file name\n+ self.dut_pathlog = \"perf-test.log\"\n+ # delete exists files\n+ self.delete_exists_files()\n+ cmds = f'meson test -C x86_64-native-linuxapp-gcc/ --suite DPDK:perf-tests -t {self.ratio} --test-args=\"-c 0xff\" |tee /root/{self.dut_pathlog}'\n+ out = self.dut.send_expect(cmds, \"# \", self.execute_wait_time)\n+ self.logger.info(out)\n+ self.check_scp_file_valid_between_dut()\n+ self.check_meson_test_result()\n+\n+ def tear_down(self):\n+ \"\"\"\n+ Run after each test case.\n+ \"\"\"\n+ out = self.dut.send_expect(\"lsmod | grep rte_kni\", \"# \")\n+\n+ if \"rte_kni\" in out:\n+ self.dut.send_expect(\"rmmod rte_kni.ko\", \"# \")\n+\n+ def tear_down_all(self):\n+ \"\"\"\n+ Run after each test suite.\n+ \"\"\"\n+ pass\n", "prefixes": [ "V3", "1/2" ] }{ "id": 111911, "url": "