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 7C3132BF5 for ; Tue, 26 Feb 2019 08:14:01 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2019 23:14:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,414,1544515200"; d="scan'208";a="302594382" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 25 Feb 2019 23:14:00 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 25 Feb 2019 23:13:59 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 25 Feb 2019 23:13:59 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.36]) with mapi id 14.03.0415.000; Tue, 26 Feb 2019 15:13:57 +0800 From: "Tu, Lijuan" To: "Yao, Lei A" , "dts@dpdk.org" CC: "Yao, Lei A" Thread-Topic: [dts] [PATCH V1]tests: Add test suite for exception path sample Thread-Index: AQHUxzJ389c074kuzUCakEFjjjDv+qXxtyGg Date: Tue, 26 Feb 2019 07:13:56 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BA27490@SHSMSX101.ccr.corp.intel.com> References: <1550483925-69701-1-git-send-email-lei.a.yao@intel.com> In-Reply-To: <1550483925-69701-1-git-send-email-lei.a.yao@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.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGZmOTY4ZWMtZTRjNS00Y2M0LTgxNmEtMTVhOTIwYjExY2RhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZU1EZms2NDRIcUJnQzlsYXo3OWFXTVdkaTJISmdrXC82dWV1VmZWMVZoaklzNmIxYkFpR1plYVFlY1wvc3RiMCtFIn0= 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: Add test suite for exception path sample 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, 26 Feb 2019 07:14:02 -0000 Hi Lei, Could you kindly please fix these warning? Applying: tests: Add test suite for exception path sample .git/rebase-apply/patch:75: trailing whitespace. self.steps =3D [] warning: 1 line adds whitespace errors. thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lei > Sent: Monday, February 18, 2019 5:59 PM > To: dts@dpdk.org > Cc: Yao, Lei A > Subject: [dts] [PATCH V1]tests: Add test suite for exception path sample >=20 > From: Lei Yao >=20 > Add test suite for exception path sample. The first patch will just inclu= de the > performance test based on Ixia. >=20 > Signed-off-by: Lei Yao > --- > tests/TestSuite_exception_path.py | 185 > ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 185 insertions(+) > create mode 100644 tests/TestSuite_exception_path.py >=20 > diff --git a/tests/TestSuite_exception_path.py > b/tests/TestSuite_exception_path.py > new file mode 100644 > index 0000000..c1cf5a7 > --- /dev/null > +++ b/tests/TestSuite_exception_path.py > @@ -0,0 +1,185 @@ > +# BSD LICENSE > +# > +# Copyright(c) 2010-2019 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 exception path feature. > +""" > + > +import dts > +import time > +import utils > +from test_case import TestCase > + > + > + > +class TestExceptionpath(TestCase): > + > + def set_up_all(self): > + """ > + Run at the start of each test suite. > + > + Exception path prerequisites. > + """ > + > + out =3D self.dut.send_expect("which brctl", "# ") > + self.verify('no brctl' not in out, > + "The linux tool brctl is needed to run this test sui= te") > + self.verify('error' not in out, "Which brctl: %s" % out) > + > + self.dut_ports =3D self.dut.get_ports_performance(self.nic, > force_same_socket=3DFalse, force_different_nic=3DFalse) > + self.verify(len(self.dut_ports) >=3D 2, "Not enough ports availa= ble") > + self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) > + > + out =3D self.dut.build_dpdk_apps('examples/helloworld') > + self.steps =3D [] > + self.steps.append({'cores': '1S/2C/1T', 'ports': 1, 'pps': '', > + 'bps': ''}) > + > + # If have enough core available > + if(len(self.dut.get_core_list('1S/4C/1T')) =3D=3D 4): > + self.steps.append( > + {'cores': '1S/4C/1T', 'ports': 2, 'pps': '', 'bps': > + ''}) > + > + def set_up(self): > + """ > + Run before each test case. > + """ > + pass > + > + def test_perf_exceptionpath_performance(self): > + """ > + Test the exception path performance. > + """ > + > + # We create the pcap files to be sent to the DUT from the traffi= c > + # generator (the second one is only needed in the last two steps= ) > + txPort1 =3D self.tester.get_local_port(self.dut_ports[0]) > + txPort2 =3D self.tester.get_local_port(self.dut_ports[1]) > + > + mac1 =3D self.tester.get_mac(txPort1) > + mac2 =3D self.tester.get_mac(txPort2) > + > + self.tester.scapy_append('dstmac=3D"ff:ff:ff:ff:ff:ff"') > + self.tester.scapy_append('srcmac=3D"%s"' % mac1) > + self.tester.scapy_append( > + 'wrpcap("excpath1.pcap", > [Ether(src=3Dsrcmac,dst=3Ddstmac)/Dot1Q(vlan=3D1)/IP(len=3D46)/UDP()/("X"= *14)])') > + self.tester.scapy_append('dstmac=3D"ff:ff:ff:ff:ff:ff"') > + self.tester.scapy_append('srcmac=3D"%s"' % mac2) > + self.tester.scapy_append( > + 'wrpcap("excpath2.pcap", > [Ether(src=3Dsrcmac,dst=3Ddstmac)/Dot1Q(vlan=3D1)/IP(len=3D46)/UDP()/("X"= *14)])') > + self.tester.scapy_execute() > + for n in range(len(self.steps)): > + coreList =3D self.dut.get_core_list( > + self.steps[n]['cores'], socket=3Dself.ports_socket) > + coreMask =3D utils.create_mask(coreList) > + > + if(self.steps[n]['ports'] =3D=3D 1): > + portMask =3D utils.create_mask([self.dut_ports[0]]) > + > self.dut.send_expect("./examples/exception_path/build/exception_path -n %= d - > c %s -- -p %s -i %s -o %s &" % (self.dut.get_memory_channels(), coreMask, > portMask, utils.create_mask( > + [coreList[1]]), utils.create_mask([coreList[0]])), "= APP: Lcore [0-9]+ is > reading from tap_dpdk_[0-9]+ and writing to port [0-9]+", 120) > + elif(self.steps[n]['ports'] =3D=3D 2): > + portMask =3D utils.create_mask( > + [self.dut_ports[0], self.dut_ports[1]]) > + > self.dut.send_expect("./examples/exception_path/build/exception_path -n %= d - > c %s -- -p %s -i %s -o %s &" % (self.dut.get_memory_channels(), coreMask, > portMask, utils.create_mask( > + [coreList[1], coreList[3]]), > + utils.create_mask([coreList[0], coreList[2]])), "APP: Lcore [0-9]+ is > + reading from tap_dpdk_[0-9]+ and writing to port [0-9]+", 120) > + > + self.dut.send_expect( > + "ifconfig tap_dpdk_%02d up" % int(coreList[0]), "# ") > + self.dut.send_expect( > + "ifconfig tap_dpdk_%02d up" % int(coreList[1]), "# ") > + self.dut.send_expect("brctl addbr \"br_dpdk_00\"", "# ") > + self.dut.send_expect( > + "brctl addif br_dpdk_00 tap_dpdk_%02d" % int(coreList[0]= ), "# ") > + self.dut.send_expect( > + "brctl addif br_dpdk_00 tap_dpdk_%02d" % int(coreList[1]= ), "# ") > + self.dut.send_expect("ifconfig br_dpdk_00 up", "# ") > + > + tgenInput =3D [] > + tgenInput.append((txPort1, txPort1, "excpath1.pcap")) > + > + if(len(coreList) =3D=3D 4): > + self.dut.send_expect( > + "ifconfig tap_dpdk_%02d up" % int(coreList[2]), "# "= ) > + self.dut.send_expect( > + "ifconfig tap_dpdk_%02d up" % int(coreList[3]), "# "= ) > + self.dut.send_expect("brctl addbr \"br_dpdk_01\"", "# ") > + self.dut.send_expect( > + "brctl addif br_dpdk_01 tap_dpdk_%02d" % int(coreLis= t[2]), "# ") > + self.dut.send_expect( > + "brctl addif br_dpdk_01 tap_dpdk_%02d" % int(coreLis= t[3]), "# ") > + self.dut.send_expect("ifconfig br_dpdk_01 up", "# ") > + tgenInput.append((txPort2, txPort2, "excpath2.pcap")) > + > + time.sleep(5) > + bps, pps =3D self.tester.traffic_generator_throughput(tgenIn= put) > + self.steps[n]['pps'] =3D pps / 1E6 > + self.steps[n]['bps'] =3D bps > + > + self.dut.send_expect("ifconfig br_dpdk_00 down", "# ") > + self.dut.send_expect("brctl delbr \"br_dpdk_00\"", "# ") > + > + if(len(coreList) =3D=3D 4): > + self.dut.send_expect("ifconfig br_dpdk_01 down", "# ") > + self.dut.send_expect("brctl delbr \"br_dpdk_01\"", "# > + ") > + > + self.dut.kill_all() > + > + for n in range(len(self.steps)): > + self.verify(self.steps[n]['pps'] !=3D 0, "No traffic > + detected") > + > + # Print results > + header =3D ['Frame Size', 'Ports', 'S/C/T', 'Mpps', > + 'Mbps', '% linerate'] > + self.result_table_create(header) > + > + for step in self.steps: > + self.result_table_add([64, step['ports'], step['cores'], > + step['pps'], > + step['bps'] / 1E6, > + step[ > + 'pps'] * 100 / float(self.wir= espeed(self.nic, > + = 64, 2))] > + ) > + > + self.result_table_print() > + > + def tear_down(self): > + """ > + Run after each test case. > + """ > + pass > + > + def tear_down_all(self): > + """ > + Run after each test suite. > + """ > + pass > -- > 2.7.4