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 B6EA0A2EEB for ; Tue, 10 Sep 2019 03:25:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 677601ED95; Tue, 10 Sep 2019 03:25:18 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4ED991ED8F for ; Tue, 10 Sep 2019 03:25:17 +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 orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Sep 2019 18:25:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,487,1559545200"; d="scan'208";a="209158543" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga004.fm.intel.com with ESMTP; 09 Sep 2019 18:25:15 -0700 Received: from fmsmsx161.amr.corp.intel.com (10.18.125.9) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 9 Sep 2019 18:25:15 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX161.amr.corp.intel.com (10.18.125.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 9 Sep 2019 18:25:15 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.113]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.195]) with mapi id 14.03.0439.000; Tue, 10 Sep 2019 09:25:13 +0800 From: "Mo, YufengX" To: "Yao, BingX Y" CC: "Yao, BingX Y" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1] tests/ip_pipeline:add case pipeline_with_traffic_management Thread-Index: AQHVZJdXs22T+aE5TUOKyOzZ0PwWb6ckI9ug Date: Tue, 10 Sep 2019 01:25:12 +0000 Message-ID: References: <1567763055-14243-1-git-send-email-bingx.y.yao@intel.com> In-Reply-To: <1567763055-14243-1-git-send-email-bingx.y.yao@intel.com> Accept-Language: zh-CN, 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 V1] 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" Hi, yao,bing *. Your test case will fail when run with below command. It is caused by yo= ur hard code of dpdk directory. mv /root/dpdk /root/dpdk2 ./dts -d /root/dpdk2 -t test_perf_pipeline_with_traffic_management *. Your vm config step value is larger than range, range should be multiple= of step. Your config has no sense. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of yaobing > Sent: Friday, September 6, 2019 5:44 PM > To: dts@dpdk.org > Cc: Yao, BingX Y > Subject: [dts] [PATCH V1] tests/ip_pipeline:add case pipeline_with_traffi= c_management >=20 > add case test_perf_pipeline_with_traffic_management >=20 > Signed-off-by: yaobing > --- > tests/TestSuite_ip_pipeline.py | 60 ++++++++++++++++++++++++++++++++++ > 1 file changed, 60 insertions(+) >=20 > diff --git a/tests/TestSuite_ip_pipeline.py b/tests/TestSuite_ip_pipeline= .py > index f05b5cd..6aa6aed 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.arch import get_if_hwaddr > from scapy.sendrecv import sniff > from scapy.sendrecv 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_= path]) > + # create an instance to set stream field setting > + self.pktgen_helper =3D PacketGeneratorHelper() >=20 > def set_up(self): > """ > @@ -231,6 +241,56 @@ class TestIPPipeline(TestCase): > """ > pass >=20 > + def set_fields(self): > + """ > + set ip protocol field behavior > + """ > + fields_config =3D { > + 'ip': { > + 'dst': {'range':4096, 'step': 65025, 'action': 'inc'}}, = } > + return fields_config > + > + 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 '/root/dpdk/examples/ip_pipeline/examples/' > + 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 %s" %= dst, "#", 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/e= xamples/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= .cli" > + cmd =3D "{0} -c 0x3 -n 4 {1} -- -s {2}".format(IP_PIPELINE, DUT_= PORTS, 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]) > + flow =3D 'Ether(dst=3D"%s")/IP(src=3D"192.168.0.2",dst=3D"0.0.0.= 0")' % (dmac) > + self.tester.scapy_append('wrpcap("%s", [%s])' % (pcap, flow)) > + self.tester.scapy_execute() > + tgenInput =3D [] > + port =3D self.tester.get_local_port(self.dut_ports[0]) > + tgenInput.append([port, port, pcap]) > + vm_config =3D self.set_fields() > + self.tester.pktgen.clear_streams() > + streams =3D self.pktgen_helper.prepare_stream_from_tginput(tgenI= nput, 100, vm_config, self.tester.pktgen) > + _, pps =3D self.tester.pktgen.measure_throughput(stream_ids=3Dst= reams) > + self.dut.send_expect("^C","#",20) > + strandard_pps =3D14880000 / 4096 > + difference_value =3D pps - strandard_pps > + self.verify( -50 < difference_value < 50, "throughput validation= failure") > + > def test_routing_pipeline(self): > """ > routing pipeline > -- > 2.17.2