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 12719A0613 for ; Wed, 28 Aug 2019 07:56:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BCFD81C1EE; Wed, 28 Aug 2019 07:56:07 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id EB5C71C1CC for ; Wed, 28 Aug 2019 07:56:05 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2019 22:56:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,440,1559545200"; d="scan'208";a="174801455" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga008.jf.intel.com with ESMTP; 27 Aug 2019 22:56:04 -0700 Received: from fmsmsx162.amr.corp.intel.com (10.18.125.71) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 27 Aug 2019 22:56:04 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx162.amr.corp.intel.com (10.18.125.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 27 Aug 2019 22:56:03 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.250]) with mapi id 14.03.0439.000; Wed, 28 Aug 2019 13:56:02 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/pvp_qemu_multi_paths_port_restart: update code to support trex Thread-Index: AQHVUbMlH4O20z5hpkSStNIpC4GOJ6cQJxng Date: Wed, 28 Aug 2019 05:56:01 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB06717@SHSMSX101.ccr.corp.intel.com> References: <1565658955-2063-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1565658955-2063-1-git-send-email-lihongx.ma@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.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjJhOTA0ZjQtZDQyOC00N2JkLWFlY2EtMjY5N2M0ZmY4NDBlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUFdNaE1xcTdxSitJTFwvV2tDU1Bvbkw5ODFuWWo2YXNxRnExQTc3WFkxSlptQU5CZjdNeTNFN2ErOEs2OTE2YnUifQ== 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/pvp_qemu_multi_paths_port_restart: update code to support trex 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" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: Tuesday, August 13, 2019 9:16 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/pvp_qemu_multi_paths_port_restart: update > code to support trex >=20 > Signed-off-by: lihong > --- > .../TestSuite_pvp_qemu_multi_paths_port_restart.py | 26 > +++++++++++++++------- > 1 file changed, 18 insertions(+), 8 deletions(-) >=20 > diff --git a/tests/TestSuite_pvp_qemu_multi_paths_port_restart.py > b/tests/TestSuite_pvp_qemu_multi_paths_port_restart.py > index 81328e0..429628c 100644 > --- a/tests/TestSuite_pvp_qemu_multi_paths_port_restart.py > +++ b/tests/TestSuite_pvp_qemu_multi_paths_port_restart.py > @@ -41,9 +41,10 @@ port restart test with each path import utils import > time import re -from settings import HEADER_SIZE from virt_common > import VM from test_case import TestCase > +from packet import Packet, save_packets from pktgen import > +PacketGeneratorHelper >=20 >=20 > class TestPVPQemuMultiPathPortRestart(TestCase): > @@ -65,6 +66,13 @@ class TestPVPQemuMultiPathPortRestart(TestCase): > self.vm_dut =3D None > self.virtio1_mac =3D "52:54:00:00:00:01" >=20 > + self.out_path =3D '/tmp' > + out =3D self.tester.send_expect('ls -d %s' % self.out_path, '# '= ) > + if 'No such file or directory' in out: > + self.tester.send_expect('mkdir -p %s' % self.out_path, '# ') > + # create an instance to set stream field setting > + self.pktgen_helper =3D PacketGeneratorHelper() > + > def set_up(self): > """ > Run before each test case. > @@ -195,16 +203,18 @@ class TestPVPQemuMultiPathPortRestart(TestCase): > """ > start to send packet and get the throughput > """ > - payload =3D frame_size - HEADER_SIZE['eth'] - HEADER_SIZE['ip'] > - flow =3D > '[Ether(dst=3D"%s")/IP(src=3D"192.168.4.1",dst=3D"192.168.3.1")/("X"*%d)]= ' % ( > - self.dst_mac, payload) > - self.tester.scapy_append('wrpcap("pvp_multipath.pcap", %s)' % fl= ow) > - self.tester.scapy_execute() > + pkt =3D Packet(pkt_type=3D'IP_RAW', pkt_len=3Dframe_size) > + pkt.config_layer('ether', {'dst': '%s' % self.dst_mac}) > + save_packets([pkt], "%s/pvp_multipath.pcap" % (self.out_path)) >=20 > tgenInput =3D [] > port =3D self.tester.get_local_port(self.dut_ports[0]) > - tgenInput.append((port, port, "pvp_multipath.pcap")) > - _, pps =3D self.tester.traffic_generator_throughput(tgenInput, d= elay=3D30) > + tgenInput.append((port, port, "%s/pvp_multipath.pcap" % > self.out_path)) > + self.tester.pktgen.clear_streams() > + streams =3D self.pktgen_helper.prepare_stream_from_tginput(tgenI= nput, > 100, None, self.tester.pktgen) > + # set traffic option > + traffic_opt =3D {'delay': 5} > + _, pps =3D > + self.tester.pktgen.measure_throughput(stream_ids=3Dstreams, > + options=3Dtraffic_opt) > Mpps =3D pps / 1000000.0 > self.verify(Mpps > 0, "can not receive packets of frame size %d"= % > (frame_size)) > throughput =3D Mpps * 100 / \ > -- > 2.7.4