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 14ADCA0561; Mon, 20 Apr 2020 07:11:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D62D91D127; Mon, 20 Apr 2020 07:11:51 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B95661C226 for ; Mon, 20 Apr 2020 07:11:50 +0200 (CEST) IronPort-SDR: 5G7ntfNtoJILq/OOCQNPzedE7nHDL8FlM7hUN8ieHnW3Z7XTaPUjF5WCwdWIU5RCilEsCjsub8 XvhqHblma20Q== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2020 22:11:49 -0700 IronPort-SDR: FNbxaV0+yHtvBWeatT4rWnok5VyAm8gJwzDQvUbxdhC2Y4MF42OEKY+hyj34LX/+jFTHm1PmM/ Vk0cayCqOVTw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,405,1580803200"; d="scan'208";a="288313351" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga008.jf.intel.com with ESMTP; 19 Apr 2020 22:11:49 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 19 Apr 2020 22:11:49 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 19 Apr 2020 22:11:49 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.146]) with mapi id 14.03.0439.000; Mon, 20 Apr 2020 13:11:41 +0800 From: "Tu, Lijuan" To: "Han, YingyaX" , "dts@dpdk.org" CC: "Han, YingyaX" Thread-Topic: [dts] [PATCH V1]framework: compatible with different versions of scapy Thread-Index: AQHWE9F9P1JawIrKxkGlFEMcvmy/DaiBfLEg Date: Mon, 20 Apr 2020 05:11:41 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC0D1AA@SHSMSX101.ccr.corp.intel.com> References: <20200416092620.31365-1-yingyax.han@intel.com> In-Reply-To: <20200416092620.31365-1-yingyax.han@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-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]framework: compatible with different versions of scapy 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 hanyingya > Sent: Thursday, April 16, 2020 5:26 PM > To: dts@dpdk.org > Cc: Han, YingyaX > Subject: [dts] [PATCH V1]framework: compatible with different versions of > scapy >=20 > some scapy version may have "L" suffix, and the other may not have. >=20 > Signed-off-by: hanyingya > --- > framework/pktgen.py | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/framework/pktgen.py b/framework/pktgen.py index > 889e94a..d00cf3b 100644 > --- a/framework/pktgen.py > +++ b/framework/pktgen.py > @@ -167,7 +167,10 @@ class PacketGeneratorHelper(object): > action =3D config.get('action') or 'default' > range =3D config.get('range') or 64 > # ignore 'L' suffix > - start_vlan =3D int(pcap_fields.get(layer_name)[:-1]) > + if 'L' in pcap_fields.get(layer_name): > + start_vlan =3D int(pcap_fields.get(layer_name)[:-1]) > + else: > + start_vlan =3D int(pcap_fields.get(layer_name)) > end_vlan =3D start_vlan + range - 1 > fields_config[layer_name][name] =3D {} > fields_config[layer_name][name]['start'] =3D start_vlan = @@ -212,4 > +215,4 @@ def getPacketGenerator(tester, pktgen_type=3DPKTGEN_IXIA): > return CLS(tester) > else: > msg =3D "not support <{0}> packet generator".format(pktgen_type) > - raise Exception(msg) > \ No newline at end of file > + raise Exception(msg) > -- > 2.17.1