From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C6A45DE4 for ; Wed, 4 Feb 2015 04:57:49 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 03 Feb 2015 19:57:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="449502488" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by FMSMGA003.fm.intel.com with ESMTP; 03 Feb 2015 19:43:36 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 4 Feb 2015 11:57:45 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.253]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.91]) with mapi id 14.03.0195.001; Wed, 4 Feb 2015 11:57:45 +0800 From: "Qiu, Michael" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH 2/4] framework: execuction file support port config nic_type Thread-Index: AQHQNuZuBzH4tXxKskiHlnCbm9Zpqw== Date: Wed, 4 Feb 2015 03:57:44 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CD432E@SHSMSX101.ccr.corp.intel.com> References: <1422001619-27112-1-git-send-email-yong.liu@intel.com> <1422001619-27112-3-git-send-email-yong.liu@intel.com> Accept-Language: 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 2/4] framework: execuction file support port config nic_type 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: Wed, 04 Feb 2015 03:57:50 -0000 On 1/23/2015 4:27 PM, Marvin Liu wrote:=0A= > From: Yong Liu =0A= >=0A= > DTS support new function that get linux driver with pci device id.=0A= > DTS sample execution configuration support configured DUT port.=0A= > One execution section support only one DUT.=0A= >=0A= > Signed-off-by: Marvinliu =0A= > ---=0A= > execution.cfg | 2 +-=0A= > framework/dts.py | 62 +++++++++++++++++++++++++++++++++-----------------= ------=0A= > 2 files changed, 38 insertions(+), 26 deletions(-)=0A= >=0A= > diff --git a/execution.cfg b/execution.cfg=0A= > index 18781ee..a67d7b3 100644=0A= > --- a/execution.cfg=0A= > +++ b/execution.cfg=0A= > @@ -19,7 +19,7 @@ test_suites=3D=0A= > pmd_bonded=0A= > targets=3D=0A= > x86_64-native-linuxapp-gcc=0A= > -parameters=3Dnic_type=3Dniantic:func=3Dtrue=0A= > +parameters=3Dnic_type=3Dcfg:func=3Dtrue=0A= > =0A= > [Execution2]=0A= > crbs=3D=0A= > diff --git a/framework/dts.py b/framework/dts.py=0A= > index 712ed54..9ba23fe 100644=0A= > --- a/framework/dts.py=0A= > +++ b/framework/dts.py=0A= > @@ -42,7 +42,7 @@ import rst # rst file support=0A= > from crbs import crbs=0A= > from tester import Tester=0A= > from dut import Dut=0A= > -from settings import NICS=0A= > +from settings import NICS, DRIVERS=0A= > from serializer import Serializer=0A= > from exception import VerifyFailure=0A= > from test_case import TestCase=0A= > @@ -131,6 +131,18 @@ def close_crb_sessions():=0A= > log_handler.info("DTF ended")=0A= > =0A= > =0A= > +def get_nic_driver(pci_id):=0A= > + """=0A= > + Return linux driver for specified pci device=0A= > + """=0A= > + driverlist =3D dict(zip(NICS.values(), DRIVERS.keys()))=0A= > + try:=0A= > + driver =3D DRIVERS[driverlist[pci_id]]=0A= > + except Exception as e:=0A= > + driver =3D None=0A= > + return driver=0A= > +=0A= > +=0A= > def accepted_nic(pci_id):=0A= > """=0A= > Return True if the pci_id is a known NIC card in the settings file a= nd if=0A= > @@ -201,7 +213,7 @@ def dts_parse_config(section):=0A= > =0A= > nics =3D [_.strip() for _ in paramDict['nic_type'].split(',')]=0A= > =0A= > - return duts, targets, test_suites, nics=0A= > + return duts[0], targets, test_suites, nics=0A= > =0A= > =0A= > def get_project_obj(project_name, super_class, crbInst, serializer):=0A= > @@ -255,7 +267,7 @@ def dts_log_execution(log_handler):=0A= > pass=0A= > =0A= > =0A= > -def dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir):= =0A= > +def dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir, ni= cs):=0A= > """=0A= > Create dts dut/tester instance and initialize them.=0A= > """=0A= > @@ -270,6 +282,7 @@ def dts_crbs_init(crbInst, skip_setup, read_cache, pr= oject, base_dir):=0A= > tester.dut =3D dut=0A= > dut.set_speedup_options(read_cache, skip_setup)=0A= > dut.set_directory(base_dir)=0A= > + dut.set_nic_types(nics)=0A= > tester.set_speedup_options(read_cache, skip_setup)=0A= > show_speedup_options_messages(read_cache, skip_setup)=0A= > dut.set_test_types(func_tests=3Dfunctional_only, perf_tests=3Dperfor= mance_only)=0A= > @@ -426,36 +439,35 @@ def run_all(config_file, pkgName, git, patch, skip_= setup,=0A= > dts_parse_param(section)=0A= > =0A= > # verify if the delimiter is good if the lists are vertical=0A= > - duts, targets, test_suites, nics =3D dts_parse_config(section)= =0A= > + dutIP, targets, test_suites, nics =3D dts_parse_config(section)= =0A= > =0A= > - for dutIP in duts:=0A= > - log_handler.info("\nDUT " + dutIP)=0A= > + log_handler.info("\nDUT " + dutIP)=0A= > =0A= > - # look up in crbs - to find the matching IP=0A= > - crbInst =3D None=0A= > - for crb in crbs:=0A= > - if crb['IP'] =3D=3D dutIP:=0A= > - crbInst =3D crb=0A= > - break=0A= > + # look up in crbs - to find the matching IP=0A= > + crbInst =3D None=0A= > + for crb in crbs:=0A= > + if crb['IP'] =3D=3D dutIP:=0A= > + crbInst =3D crb=0A= > + break=0A= > =0A= > - # only run on the dut in known crbs=0A= > - if crbInst is None:=0A= > - log_handler.error(" SKIP UNKNOWN CRB")=0A= > - continue=0A= > + # only run on the dut in known crbs=0A= > + if crbInst is None:=0A= > + log_handler.error(" SKIP UNKNOWN CRB")=0A= > + continue=0A= > =0A= > - result.dut =3D dutIP=0A= > + result.dut =3D dutIP=0A= > =0A= > - # init dut, tester crb=0A= > - dts_crbs_init(crbInst, skip_setup, read_cache, project, base= _dir)=0A= > + # init dut, tester crb=0A= > + dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir= , nics)=0A= > =0A= > - # Run DUT prerequisites=0A= > - if dts_run_prerequisties(pkgName, patch) is False:=0A= > - dts_crbs_exit()=0A= > - continue=0A= > + # Run DUT prerequisites=0A= > + if dts_run_prerequisties(pkgName, patch) is False:=0A= > + dts_crbs_exit()=0A= > + continue=0A= > =0A= > - dts_run_target(crbInst, targets, test_suites, nics)=0A= > + dts_run_target(crbInst, targets, test_suites, nics)=0A= > =0A= > - dts_crbs_exit()=0A= > + dts_crbs_exit()=0A= > =0A= > save_all_results()=0A= > =0A= Acked-by: Michael Qiu =0A=