From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 066FE5A79 for ; Tue, 16 Aug 2016 07:11:05 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 15 Aug 2016 22:11:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,528,1464678000"; d="scan'208";a="1015015467" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 15 Aug 2016 22:11:04 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 15 Aug 2016 22:11:04 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 15 Aug 2016 22:11:03 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by shsmsx102.ccr.corp.intel.com ([169.254.2.147]) with mapi id 14.03.0248.002; Tue, 16 Aug 2016 13:11:02 +0800 From: "Lin, Xueqin" To: "Liu, Yong" , xueqin.lin , "dts@dpdk.org" Thread-Topic: [dts][PATCH] tests ftag: add get_glortid_bymac function for Boulder Rapid Thread-Index: AQHR9tDoioGH4aF7XEKeE/1cWnUu3KBKQXCAgADIx/A= Date: Tue, 16 Aug 2016 05:11:01 +0000 Message-ID: <0D300480287911409D9FF92C1FA2A3351A7C3BAC@SHSMSX103.ccr.corp.intel.com> References: <1471250498-20380-1-git-send-email-xlin15@shecgisg005.sh.intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E2226ED94@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E2226ED94@SHSMSX103.ccr.corp.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] tests ftag: add get_glortid_bymac function for Boulder Rapid 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: , X-List-Received-Date: Tue, 16 Aug 2016 05:11:06 -0000 OK, thanks. Will fix and send patch again. > -----Original Message----- > From: Liu, Yong > Sent: Tuesday, August 16, 2016 9:08 AM > To: xueqin.lin; dts@dpdk.org > Cc: Lin, Xueqin > Subject: RE: [dts][PATCH] tests ftag: add get_glortid_bymac function for > Boulder Rapid >=20 > Hi Xueqin, one comment. >=20 > > -----Original Message----- > > From: xueqin.lin [mailto:xlin15@ecsmtp.sh.intel.com] > > Sent: Monday, August 15, 2016 4:42 PM > > To: Liu, Yong; dts@dpdk.org > > Cc: Lin, Xueqin > > Subject: [dts][PATCH] tests ftag: add get_glortid_bymac function for > > Boulder Rapid > > > > From: Xueqin Lin > > > > Enable ftag funtion test on Boulder Rapid, need to strip port logic val= ue > > from mac table > > then strip port glort ID from stacking information. > > > > diff --git a/nics/br.py b/nics/br.py > > index 5b6e778..0151fbb 100644 > > --- a/nics/br.py > > +++ b/nics/br.py > > @@ -29,6 +29,7 @@ > > # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF > THE USE > > # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH > DAMAGE. > > > > +import re > > from crb import Crb > > from config import PortConf, PORTCONF > > from exception import PortConfigParseException > > @@ -243,3 +244,32 @@ class BoulderRapid(NetDevice): > > self.ctrl_crb.send_expect("set port config 1 > > max_frame_size %d" % framesize, "<0>%") > > else: > > self.ctrl_crb.send_expect("set port config 5 > > max_frame_size %d" % framesize, "<0>%") > > + > > + def get_glortid_bymac(self, dmac): > > + out =3D self.ctrl_crb.send_expect("show mac table all", "<0>%"= ) > > + pattern =3D r"([0-9a-f]{2}:){5}([0-9a-f]{2})" > > + s =3D re.compile(pattern) > > + res =3D s.search(dmac) > > + if res is None: > > + print "search none mac filter" > > + return None > > + else: > > + mac_filter =3D res.group(2) > > + pattern =3D r"(?<=3D%s)+([\sA-Za-z0-9/])+([0-9]{4})" %mac_filt= er > > + s =3D re.compile(pattern) > > + res =3D s.search(out) > > + if res is None: > > + print "search none port value" > > + return None > > + else: > > + port_value =3D res.group(2) > > + out =3D self.ctrl_crb.send_expect("show stacking logical-port = all", > > "<0>%",10000) > It's impossible to wait some long for expected output. Most of times, we = will > leave it to default value. >=20 > > + pattern =3D r"([0-9a-z]{6})+(\s)+(%s)+" %port_value > > + s =3D re.compile(pattern) > > + res =3D s.search(out) > > + if res is None: > > + print "search none port glort id" > > + return None > > + else: > > + port_glortid =3D res.group(1) > > + return port_glortid > > -- > > 2.5.5