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 D94FC5FEB for ; Tue, 10 Mar 2015 01:41:54 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 09 Mar 2015 17:41:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,371,1422950400"; d="scan'208";a="538379970" Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82]) by orsmga003.jf.intel.com with ESMTP; 09 Mar 2015 17:41:22 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by PGSMSX103.gar.corp.intel.com (10.221.44.82) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 10 Mar 2015 08:41:51 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.150]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.144]) with mapi id 14.03.0224.002; Tue, 10 Mar 2015 08:41:50 +0800 From: "Xu, HuilongX" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] framework: test case nic code name strip from pci type Thread-Index: AQHQWkqu6U4jcIC5FEmKcRSZ/0nmhZ0U4N6A Date: Tue, 10 Mar 2015 00:41:49 +0000 Message-ID: References: <1425892969-13094-1-git-send-email-yong.liu@intel.com> In-Reply-To: <1425892969-13094-1-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] 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 00:41:55 -0000 Acked-by: huilong xu - Tested OS: FC21 - Kernel: 3.17.1-302.fc21.x86_64 - GCC: gcc version 4.9.1 20140930 (Red Hat 4.9.1-11) (GCC) - CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz - NIC: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ - Default x86_64-native-linuxapp-gcc configuration -----Original Message----- From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yong Liu Sent: Monday, March 09, 2015 5:23 PM To: dts@dpdk.org Subject: [dts] [PATCH] framework: test case nic code name strip from pci ty= pe Case should not take configuration param as real nic name. NIC code name no= w convert from dut pci type. Signed-off-by: Marvin Liu diff --git a/framework/dts.py b/framework/dts.py index 1c7a43e..ae12dc9 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -358,7 +358,7 @@ def dts_run_suite(crbInst, test_suites, target, nic): test_module =3D __import__('TestSuite_' + test_suite) for test_classname, test_class in get_subclasses(test_module, = TestCase): =20 - test_suite =3D test_class(dut, tester, target, nic) + test_suite =3D test_class(dut, tester, target) dts_log_testsuite(test_suite, log_handler, test_classname) =20 log_handler.info("\nTEST SUITE : " + test_classname) diff --git a/framework/settings.py b/framework/settings.py index 41c9c2c..70e6999 100644 --- a/framework/settings.py +++ b/framework/settings.py @@ -136,3 +136,12 @@ TIMEOUT =3D 15 Global macro for dts. """ IXIA =3D "ixia" + +def nic_name_from_type(self, type): + """ + strip nic code name by nic type + """ + for name, nic_type in NICS.items(): + if nic_type =3D=3D type: + return name + return 'Unknown' diff --git a/framework/test_case.py b/framework/test_case.py index b1595fb..3d2e2dc 100644 --- a/framework/test_case.py +++ b/framework/test_case.py @@ -35,16 +35,20 @@ A base class for creating DTF test cases. =20 import dts from exception import VerifyFailure -from settings import DRIVERS, NICS +from settings import DRIVERS, NICS, nic_name_from_type =20 =20 class TestCase(object): =20 - def __init__(self, dut, tester, target, nic): + def __init__(self, dut, tester, target): self.dut =3D dut self.tester =3D tester self.target =3D target - self.nic =3D nic + self.nics =3D [] + for portid in range(len(self.dut.ports_info)): + nic_type =3D self.dut.ports_info[portid]['type'] + self.nics.append(nic_name_from_type(nic_type)) + self.nic =3D self.nics[0] =20 def set_up_all(self): pass --=20 1.9.3