From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 50081A0471 for ; Tue, 18 Jun 2019 05:22:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D0781C034; Tue, 18 Jun 2019 05:22:59 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 891631C026 for ; Tue, 18 Jun 2019 05:22:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2019 20:22:56 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga006.fm.intel.com with ESMTP; 17 Jun 2019 20:22:56 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 20:22:56 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 20:22:56 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.33]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.89]) with mapi id 14.03.0439.000; Tue, 18 Jun 2019 11:22:54 +0800 From: "Yao, BingX Y" To: "Zhu, WenhuiX" , "dts@dpdk.org" CC: "Zhu, WenhuiX" Thread-Topic: [dts] [PATCH V1] tests/unit_tests_dump:add new cases Thread-Index: AQHVJYQVftZVBUIMNkWuUXTfEosfkKagvxfA Date: Tue, 18 Jun 2019 03:22:53 +0000 Message-ID: <95BCD24840F32441BEA74E0F8A31839E04F4D28E@shsmsx102.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: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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" Tested-by: Yao, BingX Y -----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 Signed-off-by: zhuwenhui --- tests/TestSuite_unit_tests_dump.py | 71 ++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_unit_tests_dump.py b/tests/TestSuite_unit_test= s_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 fa= iled") + self.verify( 'MP_mbuf_pool_socket_0' in results, "dump ring name f= ailed") + for result in results: + self.dut.send_expect("%s" % cmd, "testpmd>", self.start_test_t= ime) + out =3D self.dut.send_expect("dump_ring %s" % result, "testpmd= >", 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 mempo= ol name failed") + for result in results: + self.dut.send_expect("%s" % cmd, "testpmd>", self.start_test_t= ime) + out =3D self.dut.send_expect("dump_mempool %s" % result[0], "t= estpmd>", self.run_cmd_time * 2) + self.dut.send_expect("quit", "# ") + self.verify("internal cache infos:" in out, "dump mempool name= failed") =20 - self.verify(result[0][0] =3D=3D 'mbuf_pool_socket_0', "dump mempoo= l 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, se= lf.coremask), "R.*T.*E.*>.*>", self.start_test_time) + out =3D self.dut.send_expect("dump_malloc_stats", "RTE>>", self.ru= n_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, se= lf.coremask), "R.*T.*E.*>.*>", self.start_test_time) + out =3D self.dut.send_expect("dump_malloc_heaps", "RTE>>", self.ru= n_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, se= lf.coremask), "R.*T.*E.*>.*>", self.start_test_time) + out =3D self.dut.send_expect("dump_log_types", "RTE>>", self.run_c= md_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. --=20 2.17.2