From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B6AEA5A63 for ; Tue, 16 Aug 2016 03:07:46 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 15 Aug 2016 18:07:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,527,1464678000"; d="scan'208";a="749166501" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 15 Aug 2016 18:07:45 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 15 Aug 2016 18:07:45 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.116]) with mapi id 14.03.0248.002; Tue, 16 Aug 2016 09:07:43 +0800 From: "Liu, Yong" To: xueqin.lin , "dts@dpdk.org" CC: "Lin, Xueqin" Thread-Topic: [dts][PATCH] tests ftag: add get_glortid_bymac function for Boulder Rapid Thread-Index: AQHR9tDohLbZhGUPIUeOG7xxeh2m3KBKx0RQ Date: Tue, 16 Aug 2016 01:07:43 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E2226ED94@SHSMSX103.ccr.corp.intel.com> References: <1471250498-20380-1-git-send-email-xlin15@shecgisg005.sh.intel.com> In-Reply-To: <1471250498-20380-1-git-send-email-xlin15@shecgisg005.sh.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWQ3ZGY2MjEtYWQ5ZS00YTNjLTg1NzUtMWQ1YTlhMzQ0MDU4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InJqZEVGTGxqT3VPTWh5OHhBWVg3bExzUEpodVNjajdjckNEbzlQNHdqc2s9In0= x-ctpclassification: CTP_IC 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 01:07:47 -0000 Hi Xueqin, one comment. > -----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 >=20 > From: Xueqin Lin >=20 > Enable ftag funtion test on Boulder Rapid, need to strip port logic value > from mac table > then strip port glort ID from stacking information. >=20 > 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. >=20 > +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_filter > + 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 al= l", > "<0>%",10000) It's impossible to wait some long for expected output. Most of times, we wi= ll leave it to default value. > + 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