From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id BC01F8D96 for ; Sun, 13 Dec 2015 05:57:53 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 12 Dec 2015 20:57:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,420,1444719600"; d="scan'208";a="872514051" Received: from shilc102.sh.intel.com ([10.239.39.44]) by fmsmga002.fm.intel.com with ESMTP; 12 Dec 2015 20:57:52 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shilc102.sh.intel.com with ESMTP id tBD4vo4m003189; Sun, 13 Dec 2015 12:57:50 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tBD4vlQB004405; Sun, 13 Dec 2015 12:57:49 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id tBD4vlmu004401; Sun, 13 Dec 2015 12:57:47 +0800 From: Yong Liu To: dts@dpdk.org Date: Sun, 13 Dec 2015 12:57:37 +0800 Message-Id: <1449982664-4362-2-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1449982664-4362-1-git-send-email-yong.liu@intel.com> References: <1449982664-4362-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH 1/8] framework settings: rename nic_name_from_type to get_nic_name 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: Sun, 13 Dec 2015 04:57:54 -0000 From: Marvin Liu This function will return nic name by pci type. Signed-off-by: Marvin Liu diff --git a/framework/checkCase.py b/framework/checkCase.py index e7b22f1..94e6a4a 100644 --- a/framework/checkCase.py +++ b/framework/checkCase.py @@ -1,6 +1,6 @@ import xlrd -from settings import nic_name_from_type +from settings import get_nic_name filter_file = r'./conf/dpdk_test_case_checklist.xls' filter_case = [] @@ -96,7 +96,7 @@ class check_case_skip(): def check_nic(self, nic_type): if 'all' == nic_type[0].lower(): return True - dut_nic_type = nic_name_from_type(self.dut.ports_info[0]['type']) + dut_nic_type = get_nic_name(self.dut.ports_info[0]['type']) if dut_nic_type in nic_type: return True else: diff --git a/framework/settings.py b/framework/settings.py index c99dcaa..0b658f2 100644 --- a/framework/settings.py +++ b/framework/settings.py @@ -40,6 +40,7 @@ FOLDERS = { 'Configuration': 'conf', 'Depends': 'dep', 'Output': 'output', + 'NicDriver': 'nics', } """ @@ -159,7 +160,7 @@ The log name seperater. LOG_NAME_SEP = '.' -def nic_name_from_type(type): +def get_nic_name(type): """ strip nic code name by nic type """ diff --git a/framework/test_case.py b/framework/test_case.py index 5013123..f601381 100644 --- a/framework/test_case.py +++ b/framework/test_case.py @@ -35,7 +35,7 @@ A base class for creating DTF test cases. import dts from exception import VerifyFailure -from settings import DRIVERS, NICS, nic_name_from_type +from settings import DRIVERS, NICS, get_nic_name class TestCase(object): @@ -48,7 +48,7 @@ class TestCase(object): self.nics = [] for portid in range(len(self.dut.ports_info)): nic_type = self.dut.ports_info[portid]['type'] - self.nics.append(nic_name_from_type(nic_type)) + self.nics.append(get_nic_name(nic_type)) if len(self.nics): self.nic = self.nics[0] else: -- 1.9.3