From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8E272A2EEB for ; Wed, 11 Sep 2019 10:34:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 662431BF0F; Wed, 11 Sep 2019 10:34:29 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 5C9852C08 for ; Wed, 11 Sep 2019 10:34:27 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Sep 2019 01:34:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,492,1559545200"; d="scan'208";a="209600443" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 11 Sep 2019 01:34:26 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Sep 2019 01:34:26 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Sep 2019 01:34:25 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.140]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.23]) with mapi id 14.03.0439.000; Wed, 11 Sep 2019 16:34:23 +0800 From: "Peng, Yuan" To: "Yao, BingX Y" , "dts@dpdk.org" Thread-Topic: [dts][PATCH V2] tests/ip_pipeline:add case pipeline_with_traffic_management Thread-Index: AQHVZ66GRMUgQeFi8UO1y6TCwJdq7KcmJ+ag Date: Wed, 11 Sep 2019 08:34:23 +0000 Message-ID: <67D543A150B29E4CAAE53918F64EDAEA3775CF9D@SHSMSX103.ccr.corp.intel.com> References: <1568102981-57769-1-git-send-email-bingx.y.yao@intel.com> In-Reply-To: <1568102981-57769-1-git-send-email-bingx.y.yao@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 V2] tests/ip_pipeline:add case pipeline_with_traffic_management 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" Acked-by Peng, Yuan -----Original Message----- From: Yao, BingX Y=20 Sent: Tuesday, September 10, 2019 4:10 PM To: dts@dpdk.org Cc: Yao, BingX Y Subject: [dts][PATCH V2] tests/ip_pipeline:add case pipeline_with_traffic_m= anagement V1:add case V2:change copy cli file method and set vm config method Signed-off-by: yaobing --- tests/TestSuite_ip_pipeline.py | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/tests/TestSuite_ip_pipeline.py b/tests/TestSuite_ip_pipeline.p= y index f05b5cd..8893ad2 100644 --- a/tests/TestSuite_ip_pipeline.py +++ b/tests/TestSuite_ip_pipeline.py @@ -61,6 +61,7 @@ from scapy.packet import bind_layers, Raw from scapy.arc= h import get_if_hwaddr from scapy.sendrecv import sniff from scapy.sendre= cv import sendp +from pktgen import PacketGeneratorHelper =20 class TestIPPipeline(TestCase): =20 @@ -224,6 +225,15 @@ class TestIPPipeline(TestCase): self.verify("Error" not in out, "Compilation error") =20 self.param_flow_dir =3D self.get_flow_direction_param_of_tcpdump() + # get dts output path + if self.logger.log_path.startswith(os.sep): + self.output_path =3D self.logger.log_path + else: + cur_path =3D os.path.dirname( + os.path.dirname(os.path.realpath(__file__)= )) + self.output_path =3D os.sep.join([cur_path, self.logger.log_pa= th]) + # create an instance to set stream field setting + self.pktgen_helper =3D PacketGeneratorHelper() =20 def set_up(self): """ @@ -231,6 +241,58 @@ class TestIPPipeline(TestCase): """ pass =20 + def set_fields(self): + """ + set ip protocol field behavior + """ + fields_config =3D { + 'ip': { + 'dst': {'range':1, 'action': 'inc'},}, } + return fields_config + =20 + def copy_cli_files_to_dut(self): + """ + Copy traffic_manager.cli from tester to DUT + """ + tar_file =3D 'ip_pipeline.tar.gz' + src_file =3D r'./dep/%s' % tar_file + dst =3D '/tmp' + self.dut.session.copy_file_to(src_file, dst) + self.dut.send_expect("tar -xvf %s/%s" % (dst,tar_file), "#", 30) + self.dut.send_expect("cp ./ip_pipeline/traffic_manager.cli=20 + ./examples/ip_pipeline/examples/", "#", 30) + + def test_perf_pipeline_with_traffic_management(self): + """ + rss pipeline + """ + self.copy_cli_files_to_dut() + cmd =3D "sed -i -e 's/0000:07:00.0/%s/' ./examples/ip_pipeline/exa= mples/traffic_manager.cli" % self.dut_p0_pci + self.dut.send_expect(cmd, "# ", 20) + IP_PIPELINE =3D "./examples/ip_pipeline/build/ip_pipeline" + DUT_PORTS =3D " -w {0}".format(self.dut_p0_pci) + SCRIPT_FILE =3D "./examples/ip_pipeline/examples/traffic_manager.c= li" + cmd =3D "{0} -c 0x3 -n 4 {1} -- -s {2}".format(IP_PIPELINE, DUT_PO= RTS, SCRIPT_FILE) + out =3D self.dut.send_expect(cmd,"15.255.0.0",60) + self.verify("failed" not in out, "Create rule failed!") + pcap =3D os.sep.join([self.output_path, "test.pcap"]) + dmac =3D self.dut.get_mac_address(self.dut_ports[0]) + pkts =3D 'Ether(dst=3D"%s")/IP(src=3D"192.168.0.2",dst=3D"0.%s.0.0= ")' + strandard_pps =3D14880000 / 4096 + for i in range(0,15): + flow =3D pkts % (dmac, i) + self.tester.scapy_append('wrpcap("%s", [%s])' % (pcap, flow)) + tgenInput =3D [] + port =3D self.tester.get_local_port(self.dut_ports[0]) + vm_config =3D self.set_fields() + tgenInput.append([port, port, pcap]) + self.tester.scapy_execute() + self.tester.pktgen.clear_streams() + streams =3D self.pktgen_helper.prepare_stream_from_tginput(tge= nInput, 100, vm_config, self.tester.pktgen) + _, pps =3D self.tester.pktgen.measure_throughput(stream_ids=3D= streams) + difference_value =3D pps - strandard_pps + self.verify( -100 < difference_value < 100, "throughput valida= tion failure") + self.dut.send_expect("^C","#",20) + def test_routing_pipeline(self): """ routing pipeline -- 2.17.2