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 ACE1658EF for ; Tue, 10 Mar 2015 02:47:20 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 09 Mar 2015 18:47:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,371,1422950400"; d="scan'208";a="689501374" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by fmsmga002.fm.intel.com with ESMTP; 09 Mar 2015 18:47:18 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 10 Mar 2015 09:47:17 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.45]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.111]) with mapi id 14.03.0224.002; Tue, 10 Mar 2015 09:47:15 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] framework: test case nic code name strip from pci type Thread-Index: AQHQWkqox/V6TBMNvEa7M3hvB+xgSA== Date: Tue, 10 Mar 2015 01:47:15 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E10D937FA@SHSMSX103.ccr.corp.intel.com> References: <1425892969-13094-1-git-send-email-yong.liu@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] framework: test case nic code name strip from pci 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: Tue, 10 Mar 2015 01:47:21 -0000 Applied in next branch, thx.=0A= > Acked-by: huilong xu =0A= > - Tested OS: FC21=0A= > - Kernel: 3.17.1-302.fc21.x86_64=0A= > - GCC: gcc version 4.9.1 20140930 (Red Hat 4.9.1-11) (GCC)=0A= > - CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz=0A= > - NIC: Intel Corporation Ethernet Controller X710 for 10GbE SFP+=0A= > - Default x86_64-native-linuxapp-gcc configuration=0A= >=0A= > -----Original Message-----=0A= > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yong Liu=0A= > Sent: Monday, March 09, 2015 5:23 PM=0A= > To: dts@dpdk.org=0A= > Subject: [dts] [PATCH] framework: test case nic code name strip from pci = type=0A= >=0A= > Case should not take configuration param as real nic name. NIC code name = now=0A= > convert from dut pci type.=0A= >=0A= > Signed-off-by: Marvin Liu =0A= >=0A= > diff --git a/framework/dts.py b/framework/dts.py=0A= > index 1c7a43e..ae12dc9 100644=0A= > --- a/framework/dts.py=0A= > +++ b/framework/dts.py=0A= > @@ -358,7 +358,7 @@ def dts_run_suite(crbInst, test_suites, target, nic):= =0A= > test_module =3D __import__('TestSuite_' + test_suite)=0A= > for test_classname, test_class in get_subclasses(test_module= , TestCase):=0A= > =0A= > - test_suite =3D test_class(dut, tester, target, nic)=0A= > + test_suite =3D test_class(dut, tester, target)=0A= > dts_log_testsuite(test_suite, log_handler, test_classnam= e)=0A= > =0A= > log_handler.info("\nTEST SUITE : " + test_classname)=0A= > diff --git a/framework/settings.py b/framework/settings.py=0A= > index 41c9c2c..70e6999 100644=0A= > --- a/framework/settings.py=0A= > +++ b/framework/settings.py=0A= > @@ -136,3 +136,12 @@ TIMEOUT =3D 15=0A= > Global macro for dts.=0A= > """=0A= > IXIA =3D "ixia"=0A= > +=0A= > +def nic_name_from_type(self, type):=0A= > + """=0A= > + strip nic code name by nic type=0A= > + """=0A= > + for name, nic_type in NICS.items():=0A= > + if nic_type =3D=3D type:=0A= > + return name=0A= > + return 'Unknown'=0A= > diff --git a/framework/test_case.py b/framework/test_case.py=0A= > index b1595fb..3d2e2dc 100644=0A= > --- a/framework/test_case.py=0A= > +++ b/framework/test_case.py=0A= > @@ -35,16 +35,20 @@ A base class for creating DTF test cases.=0A= > =0A= > import dts=0A= > from exception import VerifyFailure=0A= > -from settings import DRIVERS, NICS=0A= > +from settings import DRIVERS, NICS, nic_name_from_type=0A= > =0A= > =0A= > class TestCase(object):=0A= > =0A= > - def __init__(self, dut, tester, target, nic):=0A= > + def __init__(self, dut, tester, target):=0A= > self.dut =3D dut=0A= > self.tester =3D tester=0A= > self.target =3D target=0A= > - self.nic =3D nic=0A= > + self.nics =3D []=0A= > + for portid in range(len(self.dut.ports_info)):=0A= > + nic_type =3D self.dut.ports_info[portid]['type']=0A= > + self.nics.append(nic_name_from_type(nic_type))=0A= > + self.nic =3D self.nics[0]=0A= > =0A= > def set_up_all(self):=0A= > pass=0A= =0A=