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 DC664A0679 for ; Mon, 29 Apr 2019 10:19:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C51B05F17; Mon, 29 Apr 2019 10:19:50 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 181AD2C55 for ; Mon, 29 Apr 2019 10:19:48 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 01:19:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,409,1549958400"; d="scan'208";a="168876527" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 29 Apr 2019 01:19:48 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 29 Apr 2019 01:19:47 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 29 Apr 2019 01:19:47 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.126]) with mapi id 14.03.0415.000; Mon, 29 Apr 2019 16:19:45 +0800 From: "Zhu, ShuaiX" To: "Wu, ChangqingX" , "dts@dpdk.org" CC: "Wu, ChangqingX" , "Zhu, ShuaiX" Thread-Topic: [dts] [PATCH V2] test:add test suite about l2fwd jobstats Thread-Index: AQHU/lzIODtP6L5TJUKqLUV4FrPvAaZSy8VQ Date: Mon, 29 Apr 2019 08:19:45 +0000 Message-ID: <4DC48DF9BDA3E54A836D2D3C057DEC6F0B1768A8@SHSMSX101.ccr.corp.intel.com> References: <1556522965-20199-1-git-send-email-changqingx.wu@intel.com> In-Reply-To: <1556522965-20199-1-git-send-email-changqingx.wu@intel.com> Accept-Language: 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-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] test:add test suite about l2fwd jobstats 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: Zhu, ShuaiX > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of changqingxwu > Sent: Monday, April 29, 2019 3:29 PM > To: dts@dpdk.org > Cc: Wu, ChangqingX > Subject: [dts] [PATCH V2] test:add test suite about l2fwd jobstats >=20 > add this case not support nic >=20 > Signed-off-by: changqingxwu > --- > tests/TestSuite_l2fwd_jobstats.py | 112 ++++++++++++++++++++++++++++++ > 1 file changed, 112 insertions(+) > create mode 100644 tests/TestSuite_l2fwd_jobstats.py >=20 > diff --git a/tests/TestSuite_l2fwd_jobstats.py > b/tests/TestSuite_l2fwd_jobstats.py > new file mode 100644 > index 0000000..d1da777 > --- /dev/null > +++ b/tests/TestSuite_l2fwd_jobstats.py > @@ -0,0 +1,112 @@ > +# BSD LICENSE > +# > +# Copyright(c) 2010-2016 Intel Corporation. All rights reserved. > +# All rights reserved. > +# > +# Redistribution and use in source and binary forms, with or without # > +modification, are permitted provided that the following conditions # > +are met: > +# > +# * Redistributions of source code must retain the above copyright > +# notice, this list of conditions and the following disclaimer. > +# * Redistributions in binary form must reproduce the above copyright > +# notice, this list of conditions and the following disclaimer in > +# the documentation and/or other materials provided with the > +# distribution. > +# * Neither the name of Intel Corporation nor the names of its > +# contributors may be used to endorse or promote products derived > +# from this software without specific prior written permission. > +# > +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND > CONTRIBUTORS # > +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # > +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS > FOR # > +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE > COPYRIGHT # > +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, > INCIDENTAL, # > +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT > # > +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF > USE, # > +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND > ON ANY # > +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > # > +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE > USE # > +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH > DAMAGE. > + > + > +""" > +DPDK Test suite. > +Test L2fwd Jobstats > +""" > + > +import time > +import re > +import utils > +from test_case import TestCase > + > + > +class TestL2fwdJobstats(TestCase): > + def set_up_all(self): > + """ > + Run at the start of each test suite. > + """ > + > + self.verify(self.nic not in ["fortville_eagle", "fortville_spiri= t", > + "fortville_spirit_single", > "fortville_25g", "fortpark_TLV"], > + "NIC Unsupported: " + str(self.nic)) > + self.dut_ports =3D self.dut.get_ports(self.nic) > + self.verify(len(self.dut_ports) >=3D 2, "Insufficient ports") > + self.verify(len(self.dut.cores) >=3D 4, "Insufficient cores for = testing") > + cores =3D self.dut.get_core_list("1S/4C/1T") > + self.coremask =3D utils.create_mask(cores) > + > + dut_port0 =3D self.dut_ports[0] > + dut_port1 =3D self.dut_ports[1] > + self.tx_ports =3D [dut_port0, dut_port1] > + > + # build sample app > + out =3D self.dut.build_dpdk_apps("./examples/l2fwd-jobstats") > + self.verify("Error" not in out, "compilation error 1") > + self.verify("No such file" not in out, "compilation error 2") > + > + def set_up(self): > + """ > + Run before each test case. > + """ > + pass > + > + def test_l2fwd_jobstats_check(self): > + """ > + Verify l2fwd jobstats is correct > + """ > + path =3D "./examples/l2fwd-jobstats/build/l2fwd-jobstats" > + cmd =3D path + " -c %s -n 4 -- -q 2 -p 0x03 -l" % (self.coremask= ) > + self.dut.send_expect(cmd, "Port statistics", 60) > + > + self.scapy_send_packet(100000) > + out =3D self.dut.get_session_output(timeout=3D10) > + > + print out > + send_packets =3D re.findall(r"Total packets sent:\s+?(\d+?)\r", > out)[-1] > + receive_packets =3D re.findall(r"Total packets received:\s+?(\d+= ?)\r", > out)[-1] > + self.verify(send_packets =3D=3D receive_packets =3D=3D > + str(100000*len(self.tx_ports)), "Wrong: can't get <%s> package") > + > + def scapy_send_packet(self, count): > + """ > + Send a packet to port > + """ > + for i in range(len(self.tx_ports)): > + txport =3D self.tester.get_local_port(self.dut_ports[i]) > + mac =3D self.dut.get_mac_address(self.dut_ports[i]) > + txItf =3D self.tester.get_interface(txport) > + self.tester.scapy_append( > + 'sendp([Ether(dst=3D"02:00:00:00:00", > src=3D"%s")/IP()/UDP()/Raw(\'X\'*18)], iface=3D"%s",count=3D%s)' % (mac, = txItf, > count)) > + self.tester.scapy_execute(timeout=3D90) > + > + def tear_down(self): > + """ > + Run after each test case. > + """ > + pass > + > + def tear_down_all(self): > + """ > + Run after each test suite. > + """ > + self.dut.kill_all() > -- > 2.17.2