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 9881AA0471 for ; Mon, 12 Aug 2019 08:52:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6106B1252; Mon, 12 Aug 2019 08:52:47 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id AB8F52C5 for ; Mon, 12 Aug 2019 08:52:45 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Aug 2019 23:52:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,376,1559545200"; d="scan'208";a="178248524" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 11 Aug 2019 23:52:44 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 11 Aug 2019 23:52:44 -0700 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 11 Aug 2019 23:52:43 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.15]) with mapi id 14.03.0439.000; Mon, 12 Aug 2019 14:52:41 +0800 From: "Tu, Lijuan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] tests/pvp_vhost_user_reconnect: update code to support trex Thread-Index: AQHVTk2T0R+W0N4/jU+AIS+z7AG+VKb3GGtA Date: Mon, 12 Aug 2019 06:52:41 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB0181E@SHSMSX101.ccr.corp.intel.com> References: <1565285713-20031-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1565285713-20031-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWE2OWRhYTgtZDg1OS00NWE1LWE2NmQtOGY0ZDNiMGMxMDUxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSFdyc093bjZKbVNSXC9pTVRmcnUrMUwrelJoWkFzbVU0U1l6RE5KUFdqSE40QXdvUG91aFpQYVMrTndMcnczakYifQ== 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_vhost_user_reconnect: 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: Friday, August 9, 2019 1:35 AM > To: dts@dpdk.org > Cc: Ma, LihongX > Subject: [dts] [PATCH V1] tests/pvp_vhost_user_reconnect: update code to > support trex >=20 > Signed-off-by: lihong > --- > tests/TestSuite_pvp_vhost_user_reconnect.py | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) >=20 > diff --git a/tests/TestSuite_pvp_vhost_user_reconnect.py > b/tests/TestSuite_pvp_vhost_user_reconnect.py > index 5568376..69c4bed 100644 > --- a/tests/TestSuite_pvp_vhost_user_reconnect.py > +++ b/tests/TestSuite_pvp_vhost_user_reconnect.py > @@ -40,8 +40,8 @@ import re > import utils > import time > from test_case import TestCase > -from settings import HEADER_SIZE > from virt_common import VM > +from packet import Packet, save_packets > from pktgen import PacketGeneratorHelper >=20 >=20 > @@ -76,8 +76,11 @@ class TestPVPVhostUserReconnect(TestCase): > self.src1 =3D "192.168.4.1" > self.dst1 =3D "192.168.3.1" > self.checked_vm =3D False > - self.header_size =3D HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + > HEADER_SIZE['udp'] >=20 > + self.out_path =3D '/tmp/%s' % self.suite_name > + 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() >=20 > @@ -266,15 +269,14 @@ class TestPVPVhostUserReconnect(TestCase): >=20 > def send_and_verify(self, cycle=3D0, tinfo=3D""): > for frame_size in self.frame_sizes: > - payload =3D frame_size - self.header_size > - flow =3D '[Ether(dst=3D"%s")/IP(src=3D"%s",dst=3D"%s")/UDP()= /("X"*%d)]' % ( > - self.dst_mac, self.src1, self.dst1, payload) > - self.tester.scapy_append('wrpcap("reconnect.pcap", %s)' % fl= ow) > - self.tester.scapy_execute() > + pkt =3D Packet(pkt_type =3D 'UDP', pkt_len =3D frame_size) > + pkt.config_layers([('ether', {'dst': '%s' % self.dst_mac}), > + ('ipv4', {'dst': '%s' % self.dst1, 'src': '%= s' % self.src1})]) > + save_packets([pkt], "%s/reconnect.pcap" % self.out_path) >=20 > tgenInput =3D [] > port =3D self.tester.get_local_port(self.pf) > - tgenInput.append((port, port, "reconnect.pcap")) > + tgenInput.append((port, port, "%s/reconnect.pcap" % self.out= _path)) >=20 > self.tester.pktgen.clear_streams() > streams =3D > self.pktgen_helper.prepare_stream_from_tginput(tgenInput, 100, > -- > 2.7.4