From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3BB2A00E6 for ; Thu, 11 Jul 2019 03:22:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ABE5F2E81; Thu, 11 Jul 2019 03:22:58 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 09ABF2C60 for ; Thu, 11 Jul 2019 03:22:56 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2019 18:22:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,476,1557212400"; d="scan'208";a="168487699" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 10 Jul 2019 18:22:55 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jul 2019 18:22:55 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jul 2019 18:22:54 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.232]) with mapi id 14.03.0439.000; Thu, 11 Jul 2019 09:22:53 +0800 From: "Tu, Lijuan" To: "Zhu, WenhuiX" , "dts@dpdk.org" CC: "Zhu, WenhuiX" Thread-Topic: [dts] [PATCH V1] tests/unit_tests_dump:add new cases Thread-Index: AQHVJYQVpDC33TvvEEi/mS8Hgww5cabEwzvA Date: Thu, 11 Jul 2019 01:22:52 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BADF429@SHSMSX101.ccr.corp.intel.com> References: <1560827988-6625-1-git-send-email-wenhuix.zhu@intel.com> In-Reply-To: <1560827988-6625-1-git-send-email-wenhuix.zhu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzY4YjY5ODUtNTlhMC00NjUwLWFiMzQtMWRkZmJlNjY3Mzg4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOEM4ZHd3NTJ0OTZnK0FLV1BQTWRTODV4NUJqcTNqdUQyXC9HQVl1bTZERWdrM0tMdFVqMit6bHlIR2RhdFcrTlAifQ== x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] tests/unit_tests_dump:add new cases X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Applied last week, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhuwenhui > Sent: Tuesday, June 18, 2019 11:20 AM > To: dts@dpdk.org > Cc: Zhu, WenhuiX > Subject: [dts] [PATCH V1] tests/unit_tests_dump:add new cases >=20 > Signed-off-by: zhuwenhui > --- > tests/TestSuite_unit_tests_dump.py | 71 ++++++++++++++++++++++++++++-- > 1 file changed, 67 insertions(+), 4 deletions(-) >=20 > diff --git a/tests/TestSuite_unit_tests_dump.py > b/tests/TestSuite_unit_tests_dump.py > index 74dac56..b519714 100644 > --- a/tests/TestSuite_unit_tests_dump.py > +++ b/tests/TestSuite_unit_tests_dump.py > @@ -95,11 +95,16 @@ class TestUnitTestsDump(TestCase): > self.dut.send_expect("quit", "# ") > match_regex =3D "ring <(.*?)>" > m =3D re.compile(r"%s" % match_regex, re.S) > - result =3D m.findall(out) > + results =3D m.findall(out) >=20 > # Nic driver will create multiple rings. > # Only check the last one to make sure ring_dump function work. > - self.verify( 'MP_mbuf_pool_socket_0' in result, "dump ring name > failed") > + self.verify( 'MP_mbuf_pool_socket_0' in results, "dump ring name > failed") > + for result in results: > + self.dut.send_expect("%s" % cmd, "testpmd>", self.start_test= _time) > + out =3D self.dut.send_expect("dump_ring %s" % result, "testp= md>", > self.run_cmd_time) > + self.dut.send_expect("quit", "# ") > + self.verify( 'capacity' in out, "dump ring name failed") >=20 > def test_mempool_dump(self): > """ > @@ -112,9 +117,15 @@ class TestUnitTestsDump(TestCase): > self.dut.send_expect("quit", "# ") > match_regex =3D "mempool <(.*?)>@0x(.*?)\r\n" > m =3D re.compile(r"%s" % match_regex, re.S) > - result =3D m.findall(out) > + results =3D m.findall(out) > + > + self.verify(results[0][0] =3D=3D 'mbuf_pool_socket_0', "dump mem= pool > name failed") > + for result in results: > + self.dut.send_expect("%s" % cmd, "testpmd>", self.start_test= _time) > + out =3D self.dut.send_expect("dump_mempool %s" % result[0], > "testpmd>", self.run_cmd_time * 2) > + self.dut.send_expect("quit", "# ") > + self.verify("internal cache infos:" in out, "dump mempool na= me > failed") >=20 > - self.verify(result[0][0] =3D=3D 'mbuf_pool_socket_0', "dump memp= ool name > failed") >=20 > def test_physmem_dump(self): > """ > @@ -198,6 +209,58 @@ class TestUnitTestsDump(TestCase): > white_str =3D "[pci]: %s" % pci_address > self.verify(white_str in out, "Dump white list failed") >=20 > + def test_dump_malloc_stats(self): > + """ > + Run dump malloc dump test case. > + """ > + self.dut.send_expect("./%s/app/test -n 1 -c %s" % (self.target, > self.coremask), "R.*T.*E.*>.*>", self.start_test_time) > + out =3D self.dut.send_expect("dump_malloc_stats", "RTE>>", > self.run_cmd_time * 2) > + self.dut.send_expect("quit", "# ") > + match_regex =3D "Heap id:(\d*)" > + m =3D re.compile(r"%s" % match_regex, re.DOTALL) > + results =3D m.findall(out) > + memzone_info =3D [] > + for result in results: > + memzone_info.append(result) > + self.verify(len(memzone_info) > 0, "Dump malloc stats failed") > + > + def test_dump_malloc_heaps(self): > + """ > + Run malloc heaps dump test case. > + """ > + self.dut.send_expect("./%s/app/test -n 1 -c %s" % (self.target, > self.coremask), "R.*T.*E.*>.*>", self.start_test_time) > + out =3D self.dut.send_expect("dump_malloc_heaps", "RTE>>", > self.run_cmd_time * 2) > + self.dut.send_expect("quit", "# ") > + > + elements =3D ['Heap id', 'Heap size', 'Heap alloc count'] > + match_regex =3D "" > + for element in elements: > + match_regex +=3D "%s:(.*?)\r\n" % element > + m =3D re.compile(r"%s" % match_regex, re.DOTALL) > + results =3D m.findall(out) > + memzone_info =3D [] > + for result in results: > + memzone_info.append(dict(zip(elements, result))) > + self.verify(len(memzone_info) > 0, "Dump malloc heaps failed") > + > + def test_dump_log_types(self): > + """ > + Run log types dump test case. > + """ > + self.dut.send_expect("./%s/app/test -n 1 -c %s" % (self.target, > self.coremask), "R.*T.*E.*>.*>", self.start_test_time) > + out =3D self.dut.send_expect("dump_log_types", "RTE>>", > self.run_cmd_time * 2) > + self.dut.send_expect("quit", "# ") > + > + elements =3D ['id'] > + match_regex =3D "id (\d):" > + match_regex +=3D "(.*?)," > + m =3D re.compile(r"%s" % match_regex, re.DOTALL) > + results =3D m.findall(out) > + memzone_info =3D [] > + for result in results: > + memzone_info.append(dict(zip(elements, result))) > + self.verify(len(memzone_info) > 0, "Dump log types failed") > + > def tear_down(self): > """ > Run after each test case. > -- > 2.17.2