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 49709A046B for ; Tue, 20 Aug 2019 04:37:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F3CC41BE8F; Tue, 20 Aug 2019 04:37:17 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 0D8BD1B994 for ; Tue, 20 Aug 2019 04:37:15 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Aug 2019 19:37:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,407,1559545200"; d="scan'208";a="185778419" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 19 Aug 2019 19:37:14 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 19 Aug 2019 19:37:14 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 19 Aug 2019 19:37:14 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 19 Aug 2019 19:37:13 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.250]) with mapi id 14.03.0439.000; Tue, 20 Aug 2019 10:37:12 +0800 From: "Wang, Yinan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/pvp_diff_qemu_version: update code to support trex Thread-Index: AQHVUmWxVeSl6fSI70SNL+KlzKE0eKcDW4Nw Date: Tue, 20 Aug 2019 02:37:11 +0000 Message-ID: References: <1565735867-18624-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1565735867-18624-1-git-send-email-lihongx.ma@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzBiZDlkMTYtNGExYy00MTM2LWE4MjktMTI2ODFmZDViZThjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWGtoUWNwaGV1XC9IQTIzbFMxZXRWY29hTVBYRW9lQnIzVUZkU2hWOUp3eEV3WHByZUNIOGJiSnh4bkR2dTZNNDYifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] tests/pvp_diff_qemu_version: 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" Acked-by: Wang, Yinan > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong > Sent: 2019=1B$BG/=1B(B8=1B$B7n=1B(B14=1B$BF|=1B(B 6:38 > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/pvp_diff_qemu_version: update code to sup= port > trex >=20 > Signed-off-by: lihong > --- > tests/TestSuite_pvp_diff_qemu_version.py | 21 +++++++++++++++++---- > 1 file changed, 17 insertions(+), 4 deletions(-) >=20 > diff --git a/tests/TestSuite_pvp_diff_qemu_version.py > b/tests/TestSuite_pvp_diff_qemu_version.py > index d238a90..d1952b5 100644 > --- a/tests/TestSuite_pvp_diff_qemu_version.py > +++ b/tests/TestSuite_pvp_diff_qemu_version.py > @@ -45,6 +45,7 @@ from scapy.utils import wrpcap from test_case import > TestCase from settings import HEADER_SIZE from virt_common import VM > +from pktgen import PacketGeneratorHelper >=20 >=20 > class TestVhostPVPDiffQemuVersion(TestCase): > @@ -74,6 +75,13 @@ class TestVhostPVPDiffQemuVersion(TestCase): > res =3D self.verify_qemu_version_config() > self.verify(res is True, "The path of qemu version in config fil= e not > right") >=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. > @@ -221,14 +229,19 @@ class TestVhostPVPDiffQemuVersion(TestCase): > payload =3D frame_size - HEADER_SIZE['eth'] - HEADER_SIZE['i= p'] > flow =3D > '[Ether(dst=3D"%s")/Dot1Q(vlan=3D%s)/IP(src=3D"%s",dst=3D"%s")/("X"*%d)]'= % ( > self.virtio1_mac, vlan_id1, self.src1, self.dst1, payloa= d) > - > self.tester.scapy_append('wrpcap("pvp_diff_qemu_version.pcap", %s)' % flo= w) > + > self.tester.scapy_append('wrpcap("%s/pvp_diff_qemu_version.pcap", %s)' % = ( > + self.out_path, flow)) > self.tester.scapy_execute() >=20 > tgenInput =3D [] > port =3D self.tester.get_local_port(self.pf) > - tgenInput.append((port, port, "pvp_diff_qemu_version.pcap")) > - _, pps =3D self.tester.traffic_generator_throughput( > - tgenInput, delay=3D30) > + tgenInput.append((port, port, > + "%s/pvp_diff_qemu_version.pcap" % self.out_path)) > + > + self.tester.pktgen.clear_streams() > + streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgenInput, 100, None, > self.tester.pktgen) > + # set traffic option > + traffic_opt =3D {'delay': 5, 'duration': 20} > + _, pps =3D > + self.tester.pktgen.measure_throughput(stream_ids=3Dstreams, > + options=3Dtraffic_opt) > Mpps =3D pps / 1000000.0 > pct =3D Mpps * 100 / float(self.wirespeed(self.nic, frame_si= ze, 1)) > self.verify(Mpps !=3D 0, "can not received data of frame siz= e %d" % > frame_size) > -- > 2.7.4