From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D2F422C28 for ; Tue, 9 Aug 2016 07:14:22 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 08 Aug 2016 22:14:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,493,1464678000"; d="scan'208";a="1037679617" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 08 Aug 2016 22:14:21 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 8 Aug 2016 22:14:21 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 8 Aug 2016 22:14:21 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.8]) with mapi id 14.03.0248.002; Tue, 9 Aug 2016 13:14:19 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" CC: "Xu, HuilongX" Thread-Topic: [dts] [PATCH V1] update dump test suite Thread-Index: AQHR8U0em2QSWn+d5EqTTFGokJAbO6BAE10Q Date: Tue, 9 Aug 2016 05:14:20 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E2226B626@SHSMSX103.ccr.corp.intel.com> References: <1470643881-3347-1-git-send-email-huilongx.xu@intel.com> In-Reply-To: <1470643881-3347-1-git-send-email-huilongx.xu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODczYzc3YTAtYjFmNy00YjZkLWJkMWQtNGZmMzA5ZDk4Y2Q3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImU3NWU3WEszZEUwcDdWYUkzWFdIXC91dVBqWXJQa2U2b1hxNHlTbUQ5ZkZJPSJ9 x-ctpclassification: CTP_IC 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] update dump test suite 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: , X-List-Received-Date: Tue, 09 Aug 2016 05:14:23 -0000 Huilong, two comments below. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong > Sent: Monday, August 08, 2016 4:11 PM > To: dts@dpdk.org > Cc: Xu, HuilongX > Subject: [dts] [PATCH V1] update dump test suite >=20 > update list: > 1. discard test_log_dump, because this function remove in dpdk.org > 2. update ring_dump/mempool_dump case, ignore get ring/mempool struct inf= o. > because ring struct is a internal struct, only get ring/mempool name. > and check. > 3. update dump_devargs case. update get pci address from portsInfo >=20 > Signed-off-by: xu,huilong > --- > tests/TestSuite_unit_tests_dump.py | 38 ++++++++++++++++----------------= - > ----- > 1 file changed, 16 insertions(+), 22 deletions(-) >=20 > diff --git a/tests/TestSuite_unit_tests_dump.py > b/tests/TestSuite_unit_tests_dump.py > index afdc256..26299f0 100644 > --- a/tests/TestSuite_unit_tests_dump.py > +++ b/tests/TestSuite_unit_tests_dump.py > @@ -72,7 +72,7 @@ class TestUnitTestsDump(TestCase): > """ > pass >=20 > - def test_log_dump(self): > + def discard_test_log_dump(self): > """ > Run history log dump test case. > """ > @@ -86,40 +86,31 @@ class TestUnitTestsDump(TestCase): > Run history log dump test case. > """ > self.dut.send_expect("./%s/app/test -n 1 -c ffff" % (self.target= ), > "R.*T.*E.*>.*>", self.start_test_time) > + self.dut.send_expect("mempool_autotest", "RTE>>", > self.run_cmd_time * 2) > out =3D self.dut.send_expect("dump_ring", "RTE>>", > self.run_cmd_time) > self.dut.send_expect("quit", "# ") > - elements =3D ['ring', 'address', 'flags', 'size', 'ct', 'ch', 'p= t', > 'ph', 'used', 'avail', 'watermark'] > + elements =3D ['ring', 'flags', 'size', 'ct', 'ch', 'pt', 'ph', > 'used', 'avail', 'watermark'] > match_regex =3D "ring <(.*?)>@0x(.*)\r\n" > - for element in elements[2:]: > - match_regex +=3D " %s=3D(\d*)\r\n" % element > m =3D re.compile(r"%s" % match_regex, re.S) > result =3D m.search(out) > - ring_info =3D dict(zip(elements, result.groups())) > + ring_info =3D result.groups() >=20 > - self.verify(ring_info['ring'] =3D=3D 'MP_log_history', "Test fai= led") > + self.verify(len(ring_info) =3D=3D 2, "dump ring name failed") >=20 Only check ring number is not enough, we'd better also check expected ring = name. > def test_mempool_dump(self): > """ > Run mempool dump test case. > """ > self.dut.send_expect("./%s/app/test -n 1 -c ffff" % (self.target= ), > "R.*T.*E.*>.*>", self.start_test_time) > + self.dut.send_expect("mempool_autotest", "RTE>>", > self.run_cmd_time * 2) > out =3D self.dut.send_expect("dump_mempool", "RTE>>", > self.run_cmd_time * 2) > self.dut.send_expect("quit", "# ") > - elements =3D ['mempool', 'flags', 'ring', 'phys_addr', > 'nb_mem_chunks', 'size', 'populated_size', 'header_size', 'elt_size', > - 'trailer_size', 'total_obj_size', 'private_data_size= ', > 'avg bytes/object', 'cache infos','cache_size', 'common_pool_count'] > match_regex =3D "mempool <(.*?)>@0x(.*?)\r\n" > - for element in elements[1:]: > - if element =3D=3D 'cache_size': > - match_regex +=3D " %s=3D(.*?)\r\n" % element > - elif element =3D=3D 'cache infos': > - match_regex +=3D " %s:\r\n" % element > - else: > - match_regex +=3D " %s=3D(.*?)\r\n" % element > m =3D re.compile(r"%s" % match_regex, re.S) > result =3D m.search(out) > - mempool_info =3D dict(zip(elements, result.groups())) > + mempool_info =3D result.groups() >=20 > - self.verify(mempool_info['mempool'] =3D=3D 'log_history', "Test > failed") > + self.verify(len(mempool_info) =3D=3D 2, "dump mempool name faile= d") >=20 > def test_physmem_dump(self): > """ > @@ -185,19 +176,22 @@ class TestUnitTestsDump(TestCase): > Run devargs dump test case. > """ > test_port =3D self.dut_ports[0] > - self.dut.send_expect("./%s/app/test -n 1 -c ffff -b %s" > - % (self.target, > self.dut.ports_info[test_port]['pci']), "R.*T.*E.*>.*>", > self.start_test_time) > + pci_address =3D self.dut.ports_info[test_port]['pci']; > + if not pci_address.startswith('0000:'): > + pci_address =3D '0000:' + pci_address > + self.dut.send_expect("./%s/app/test -n 1 -c ffff -b %s" > + % (self.target, pci_address), pci_address should be correct, framework has been added domain id into pci = address. > "R.*T.*E.*>.*>", self.start_test_time) > out =3D self.dut.send_expect("dump_devargs", "RTE>>", > self.run_cmd_time * 2) > self.dut.send_expect("quit", "# ") > - black_str =3D "PCI blacklist %s" % > self.dut.ports_info[test_port]['pci'] > + black_str =3D "PCI blacklist %s" % pci_address > self.verify(black_str in out, "Dump black list failed") >=20 > self.dut.send_expect("./%s/app/test -n 1 -c ffff -w %s" > - % (self.target, > self.dut.ports_info[test_port]['pci']), "R.*T.*E.*>.*>", > self.start_test_time) > + % (self.target, pci_address), > "R.*T.*E.*>.*>", self.start_test_time) > out =3D self.dut.send_expect("dump_devargs", "RTE>>", > self.run_cmd_time * 2) > self.dut.send_expect("quit", "# ") >=20 > - white_str =3D "PCI whitelist %s" % > self.dut.ports_info[test_port]['pci'] > + white_str =3D "PCI whitelist %s" % pci_address > self.verify(white_str in out, "Dump white list failed") >=20 > def tear_down(self): > -- > 1.9.3