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 887542E7B for ; Fri, 7 Aug 2015 06:54:18 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 06 Aug 2015 21:54:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,627,1432623600"; d="scan'208";a="537542455" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by FMSMGA003.fm.intel.com with ESMTP; 06 Aug 2015 21:54:08 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.224.2; Fri, 7 Aug 2015 12:54:07 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.38]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.18]) with mapi id 14.03.0224.002; Fri, 7 Aug 2015 12:54:05 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH 1/4] Support load crbs configuration file Thread-Index: AQHQ0LR/u2gWAN+Uq0a7UymOnUydFZ3/+LGw Date: Fri, 7 Aug 2015 04:54:05 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10EB667F@SHSMSX103.ccr.corp.intel.com> References: <1438864522-3699-1-git-send-email-yong.liu@intel.com> <1438864522-3699-2-git-send-email-yong.liu@intel.com> In-Reply-To: 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 1/4] Support load crbs configuration file 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: Fri, 07 Aug 2015 04:54:19 -0000 Ok, I'll send out v2 patch. > -----Original Message----- > From: Xu, HuilongX > Sent: Friday, August 07, 2015 9:58 AM > To: Liu, Yong; dts@dpdk.org > Subject: RE: [dts] [PATCH 1/4] Support load crbs configuration file >=20 > Hi yong, > In crbs dict could you add key 'os'. > If not os config, maybe can't support freebsd test. >=20 > > -----Original Message----- > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yong Liu > > Sent: Thursday, August 06, 2015 8:35 PM > > To: dts@dpdk.org > > Subject: [dts] [PATCH 1/4] Support load crbs configuration file > > > > From: Marvin Liu > > > > Move CRBs configruations from internal python file to configuration fil= e. > > > > Signed-off-by: Marvin Liu > > > > diff --git a/framework/config.py b/framework/config.py > > index 65cecd4..f099a5d 100644 > > --- a/framework/config.py > > +++ b/framework/config.py > > @@ -36,7 +36,7 @@ Generic port and crbs configuration file load functio= n > > import re > > import ConfigParser # config parse module > > import argparse # prase arguments module > > - > > +from settings import IXIA > > from exception import ConfigParseException, VirtConfigParseException > > > > PORTCONF =3D "conf/ports.cfg" > > @@ -185,6 +185,58 @@ class PortConf(UserConf): > > return False > > > > > > +class CrbsConf(UserConf): > > + DEF_CRB =3D {'IP': '', 'name': 'CrownPassCRB1', 'user': '', > > + 'pass': '', 'tester IP': '', 'tester pass': '', > > + IXIA: None, 'memory channels': 4, > > + 'bypass core0': True} > > + > > + def __init__(self, crbs_conf=3DCRBCONF): > > + self.config_file =3D crbs_conf > > + self.crbs_cfg =3D [] > > + try: > > + self.crbs_conf =3D UserConf(self.config_file) > > + except ConfigParseException: > > + self.crbs_conf =3D None > > + raise ConfigParseException > > + > > + def load_crbs_config(self): > > + sections =3D self.crbs_conf.get_sections() > > + if not sections: > > + return self.crbs_cfg > > + > > + for name in sections: > > + crb =3D self.DEF_CRB.copy() > > + crb_confs =3D self.crbs_conf.load_section(name) > > + if not crb_confs: > > + continue > > + > > + # covert file configuration to dts crbs > > + for conf in crb_confs: > > + key, value =3D conf > > + if key =3D=3D 'dut_ip': > > + crb['IP'] =3D value > > + elif key =3D=3D 'dut_user': > > + crb['user'] =3D value > > + elif key =3D=3D 'dut_passwd': > > + crb['pass'] =3D value > > + elif key =3D=3D 'tester_ip': > > + crb['tester IP'] =3D value > > + elif key =3D=3D 'tester_passwd': > > + crb['tester pass'] =3D value > > + elif key =3D=3D 'ixia_group': > > + crb[IXIA] =3D value > > + elif key =3D=3D 'channels': > > + crb['memory channels'] =3D int(value) > > + elif key =3D=3D 'bypass_core0': > > + if value =3D=3D 'True': > > + crb['bypass core0'] =3D True > > + else: > > + crb['bypass core0'] =3D False > > + > > + self.crbs_cfg.append(crb) > > + return self.crbs_cfg > > + > > if __name__ =3D=3D '__main__': > > parser =3D argparse.ArgumentParser( > > description=3D"Load DTS configuration files") > > @@ -218,3 +270,7 @@ if __name__ =3D=3D '__main__': > > virtconf =3D VirtConf(VIRTCONF) > > virtconf.load_virt_config('LIBVIRT') > > print virtconf.get_virt_config() > > + > > + # example for crbs configuration file > > + crbsconf =3D CrbsConf(CRBCONF) > > + print crbsconf.load_crbs_config() > > -- > > 1.9.3