From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 7D42D58C3 for ; Thu, 18 Aug 2016 09:53:07 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 18 Aug 2016 00:53:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,538,1464678000"; d="scan'208";a="750317846" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 18 Aug 2016 00:53:04 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 18 Aug 2016 00:53:04 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 18 Aug 2016 00:53:04 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.150]) with mapi id 14.03.0248.002; Thu, 18 Aug 2016 15:53: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: AQHR+ResaZ4pRHnN2kCMCLxmPsIHGaBNzvGAgACJhwA= Date: Thu, 18 Aug 2016 07:53:02 +0000 Message-ID: <0D300480287911409D9FF92C1FA2A3351A7C45A7@SHSMSX103.ccr.corp.intel.com> References: <1471500774-2748-1-git-send-email-xlin15@shecgisg005.sh.intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E22270566@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E22270566@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: Thu, 18 Aug 2016 07:53:08 -0000 Great suggestion, will fix soon. Thanks. > -----Original Message----- > From: Liu, Yong > Sent: Thursday, August 18, 2016 3:39 PM > To: xueqin.lin; dts@dpdk.org > Cc: Lin, Xueqin > Subject: RE: [dts][PATCH] tests ftag: add get_glortid_bymac function for > Boulder Rapid >=20 > Thanks Xueqin, one comment. >=20 > > -----Original Message----- > > From: xueqin.lin [mailto:xlin15@ecsmtp.sh.intel.com] > > Sent: Thursday, August 18, 2016 2:13 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 function test on Boulder Rapid, need to strip port logic va= lue > > from mac table, > > then strip port glort ID from stacking information. > > > > diff --git a/nics/br.py b/nics/br.py > > index 5b6e778..140d367 100644 > > --- a/nics/br.py > > +++ b/nics/br.py > > @@ -28,7 +28,7 @@ > > # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > > # (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 +243,33 @@ 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" >=20 > This is error information, suggest to use "print RED(".")" to emphasize. >=20 > > + 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>%") > > + 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