From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id E855068CA for ; Fri, 19 Aug 2016 03:08:04 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 18 Aug 2016 18:08:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,542,1464678000"; d="scan'208";a="750696826" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 18 Aug 2016 18:08:02 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 18 Aug 2016 18:08:02 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 18 Aug 2016 18:08:02 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by shsmsx102.ccr.corp.intel.com ([169.254.2.147]) with mapi id 14.03.0248.002; Fri, 19 Aug 2016 09:07:59 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" CC: "Xu, HuilongX" Thread-Topic: [dts] [PATCH V2] update dump test case Thread-Index: AQHR+TdTBbHLhuY2rk+6glQDvDeF16BPeYMg Date: Fri, 19 Aug 2016 01:08:00 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E2227115E@SHSMSX103.ccr.corp.intel.com> References: <1471229578-10647-1-git-send-email-huilongx.xu@intel.com> In-Reply-To: <1471229578-10647-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWE2MTFlMDYtMWI1Yy00MTg0LWExYTQtYjk3MDdiMjVhYjhiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlE5TlE4NWhcLzhFOTkyVHVcL0cxTGUzNDcreWJQWWxyZnludlc0K2pVS01Vdz0ifQ== 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 V2] update dump test case 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: Fri, 19 Aug 2016 01:08:06 -0000 Hi Huilong, Dynamic config suite has been merged, please strip it from this patch. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong > Sent: Monday, August 15, 2016 10:53 AM > To: dts@dpdk.org > Cc: Xu, HuilongX > Subject: [dts] [PATCH V2] update dump test case >=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 > info. > because ring struct is a internal struct, only get ring/mempool > name. and check. > 3. update dump_devargs case. update arguments and check info. >=20 > Signed-off-by: xu,huilong > --- > tests/TestSuite_dynamic_config.py | 118 +++++++++++++++----------------= - > ----- > tests/TestSuite_unit_tests_dump.py | 44 +++++--------- > 2 files changed, 62 insertions(+), 100 deletions(-) >=20 > diff --git a/tests/TestSuite_dynamic_config.py > b/tests/TestSuite_dynamic_config.py > index 7df02b7..45beb62 100644 > --- a/tests/TestSuite_dynamic_config.py > +++ b/tests/TestSuite_dynamic_config.py > @@ -64,19 +64,18 @@ class TestDynamicConfig(TestCase): >=20 > # Based on h/w type, choose how many ports to use > self.dut_ports =3D self.dut.get_ports(self.nic) > - print self.dut_ports >=20 > # Verify that enough ports are available > self.verify(len(self.dut_ports) >=3D 2, "Insufficient ports") >=20 > # Prepare cores and ports > cores =3D self.dut.get_core_list('1S/2C/2T') > - coreMask =3D dts.create_mask(cores) > - portMask =3D dts.create_mask(self.dut_ports[:2]) > + self.coreMask =3D dts.create_mask(cores) > + self.portMask =3D dts.create_mask(self.dut_ports[:2]) >=20 > # launch app > cmd =3D "./%s/build/app/test-pmd/testpmd -c %s -n 3 -- -i --rxpt= =3D0 > \ > - --rxht=3D0 --rxwt=3D0 --txpt=3D39 --txht=3D0 --txwt=3D0 --portma= sk=3D%s" % > (self.target, coreMask, portMask) > + --rxht=3D0 --rxwt=3D0 --txpt=3D39 --txht=3D0 --txwt=3D0 --portma= sk=3D%s" % > (self.target, self.coreMask, self.portMask) >=20 > self.dut.send_expect("%s" % cmd, "testpmd> ", 120) >=20 > @@ -93,7 +92,8 @@ class TestDynamicConfig(TestCase): > self.verify(cmp(ret.lower(), self.dest) =3D=3D 0, "MAC address w= rong") > self.verify("Promiscuous mode: enabled" in out, > "wrong default promiscuous value") > - self.dut.send_expect("start", "testpmd> ", 120) > + > + self.dut.kill_all() >=20 > def dynamic_config_send_packet(self, portid, > destMac=3D"00:11:22:33:44:55"): > """ > @@ -112,7 +112,12 @@ class TestDynamicConfig(TestCase): > """ > Run before each test case. > """ > - pass > + cmd =3D "./%s/build/app/test-pmd/testpmd -c %s -n 3 -- -i --rxpt= =3D0 > \ > + --rxht=3D0 --rxwt=3D0 --txpt=3D39 --txht=3D0 --txwt=3D0 --portma= sk=3D%s" % > (self.target, self.coreMask, self.portMask) > + > + self.dut.send_expect("%s" % cmd, "testpmd> ", 120) > + self.dut.send_expect("start", "testpmd> ", 120) > + >=20 > def test_dynamic_config_default_mode(self): > """ > @@ -123,15 +128,15 @@ class TestDynamicConfig(TestCase): >=20 > # get the current rx statistic > out =3D self.dut.send_expect("clear port stats all" , "testpmd> = ") > - out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") > + out =3D self.dut.send_expect("show port stats %d" % > self.dut_ports[1], "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") >=20 > # send one packet with different MAC address than the portid > self.dynamic_config_send_packet(portid) >=20 > pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") > + out =3D self.dut.send_expect("show port stats %d" % > self.dut_ports[1], "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") >=20 > # check the pakcet increasment > self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt) > @@ -141,8 +146,8 @@ class TestDynamicConfig(TestCase): > self.dynamic_config_send_packet(portid, self.dest) >=20 > pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") > + out =3D self.dut.send_expect("show port stats %d" % > self.dut_ports[1], "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") >=20 > # check the pakcet increasment > self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt) > @@ -154,57 +159,26 @@ class TestDynamicConfig(TestCase): > """ >=20 > portid =3D self.dut_ports[0] > - if self.nic in ["fortville_eagle", "fortville_spirit", > "fortville_spirit_single"]: > - self.dut.send_expect("set promisc all off", "testpmd> ") > - out =3D self.dut.send_expect( > - "show port stats %d" % self.dut_ports[1], "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > - > - self.dynamic_config_send_packet(portid) > - pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect( > - "show port stats %d" % self.dut_ports[1], "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > - self.verify(int(cur_rxpkt) =3D=3D int( > - pre_rxpkt), "1st packet increasment error") > - self.dynamic_config_send_packet(portid, self.dest) > - pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect( > - "show port stats %d" % self.dut_ports[1], "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > - self.verify(int(cur_rxpkt) =3D=3D int( > - pre_rxpkt) + 1, "2nd packet increasment error") > - else: > - self.dut.send_expect("set promisc %d off" % portid, "testpmd= > > ") > - > - # get the current rx statistic > - out =3D self.dut.send_expect( > - "show port stats %d" % portid, "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") > - > - # send one packet with different MAC address than the portid > - self.dynamic_config_send_packet(portid) > - > - pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect( > - "show port stats %d" % portid, "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") > - > - # check the pakcet increasment > - self.verify(int(cur_rxpkt) =3D=3D int( > - pre_rxpkt), "1st packet increasment error") > - > - # send one packet with the portid MAC address > - self.dynamic_config_send_packet(portid, self.dest) > - > - pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect( > - "show port stats %d" % portid, "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") > - > - # check the pakcet increasment > - self.verify(int(cur_rxpkt) =3D=3D int( > - pre_rxpkt) + 1, "2nd packet increasment error") > + > + self.dut.send_expect("set promisc all off", "testpmd> ") > + out =3D self.dut.send_expect( > + "show port stats %d" % self.dut_ports[1], "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > + > + self.dynamic_config_send_packet(portid) > + pre_rxpkt =3D cur_rxpkt > + out =3D self.dut.send_expect( > + "show port stats %d" % self.dut_ports[1], "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > + self.verify(int(cur_rxpkt) =3D=3D int( > + pre_rxpkt), "1st packet increasment error") > + self.dynamic_config_send_packet(portid, self.dest) > + pre_rxpkt =3D cur_rxpkt > + out =3D self.dut.send_expect( > + "show port stats %d" % self.dut_ports[1], "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") > + self.verify(int(cur_rxpkt) =3D=3D int( > + pre_rxpkt) + 1, "2nd packet increasment error") >=20 > def test_dynamic_config_broadcast(self): > """ > @@ -269,15 +243,15 @@ class TestDynamicConfig(TestCase): > self.dut.send_expect("set promisc %d on" % portid, "testpmd> ") >=20 > # get the current rx statistic > - out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") > + out =3D self.dut.send_expect("show port stats %d" % > self.dut_ports[1], "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") >=20 > # send one packet with different MAC address than the portid > self.dynamic_config_send_packet(portid) >=20 > pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") > + out =3D self.dut.send_expect("show port stats %d" % > self.dut_ports[1], "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") >=20 > # check the pakcet increasment > self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt) > @@ -287,21 +261,21 @@ class TestDynamicConfig(TestCase): > self.dynamic_config_send_packet(portid, self.dest) >=20 > pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > - cur_rxpkt =3D dts.regexp(out, "RX-packets: ([0-9]+)") > + out =3D self.dut.send_expect("show port stats %d" % > self.dut_ports[1], "testpmd> ") > + cur_rxpkt =3D dts.regexp(out, "TX-packets: ([0-9]+)") >=20 > # check the pakcet increasment > self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt) > + 1, "2nd packet increasment error") >=20 > - self.dut.send_expect("quit", "# ", 30) > + #self.dut.send_expect("quit", "# ", 30) >=20 > def tear_down(self): > """ > Run after each test case. > """ > - pass > - > + self.dut.kill_all() > + > def tear_down_all(self): > """ > Run after each test suite. > diff --git a/tests/TestSuite_unit_tests_dump.py > b/tests/TestSuite_unit_tests_dump.py > index afdc256..730c4c1 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. > """ > @@ -85,41 +85,28 @@ 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) > - out =3D self.dut.send_expect("dump_ring", "RTE>>", > self.run_cmd_time) > + self.dut.send_expect("./%s/app/testpmd -n 1 -c f -- -i" % > (self.target), "testpmd>", self.start_test_time) > + out =3D self.dut.send_expect("dump_ring", "testpmd>", > self.run_cmd_time) > self.dut.send_expect("quit", "# ") > - elements =3D ['ring', 'address', 'flags', 'size', 'ct', 'ch', 'p= t', > '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())) > + result =3D m.findall(out) > + >=20 > - self.verify(ring_info['ring'] =3D=3D 'MP_log_history', "Test fai= led") > + self.verify(result[0][0] =3D=3D 'MP_mbuf_pool_socket_0', "dump r= ing > name failed") >=20 > 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) > - out =3D self.dut.send_expect("dump_mempool", "RTE>>", > self.run_cmd_time * 2) > + self.dut.send_expect("./%s/app/testpmd -n 1 -c f -- -i" % > (self.target), "testpmd>", self.start_test_time) > + out =3D self.dut.send_expect("dump_mempool", "testpmd>", > 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())) > + result =3D m.findall(out) >=20 > - self.verify(mempool_info['mempool'] =3D=3D 'log_history', "Test > failed") > + self.verify(result[0][0] =3D=3D 'mbuf_pool_socket_0', "dump memp= ool > name failed") >=20 > def test_physmem_dump(self): > """ > @@ -185,19 +172,20 @@ 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']; > + self.dut.send_expect("./%s/app/test -n 1 -c ffff -b %s" > + % (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", "# ") > - 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 >=20