From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 95BBE5AC9 for ; Fri, 23 Jan 2015 09:27:20 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 23 Jan 2015 00:27:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,453,1418112000"; d="scan'208";a="641467776" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 23 Jan 2015 00:27:18 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t0N8RFGH027950; Fri, 23 Jan 2015 16:27:15 +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 t0N8RCm9027161; Fri, 23 Jan 2015 16:27:15 +0800 Received: (from dayuqiu@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t0N8RCWP027157; Fri, 23 Jan 2015 16:27:12 +0800 From: Marvin Liu To: dts@dpdk.org Date: Fri, 23 Jan 2015 16:26:57 +0800 Message-Id: <1422001619-27112-3-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1422001619-27112-1-git-send-email-yong.liu@intel.com> References: <1422001619-27112-1-git-send-email-yong.liu@intel.com> Subject: [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: Fri, 23 Jan 2015 08:27:21 -0000 From: Yong Liu DTS support new function that get linux driver with pci device id. DTS sample execution configuration support configured DUT port. One execution section support only one DUT. Signed-off-by: Marvinliu --- execution.cfg | 2 +- framework/dts.py | 62 +++++++++++++++++++++++++++++++++----------------------- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/execution.cfg b/execution.cfg index 18781ee..a67d7b3 100644 --- a/execution.cfg +++ b/execution.cfg @@ -19,7 +19,7 @@ test_suites= pmd_bonded targets= x86_64-native-linuxapp-gcc -parameters=nic_type=niantic:func=true +parameters=nic_type=cfg:func=true [Execution2] crbs= diff --git a/framework/dts.py b/framework/dts.py index 712ed54..9ba23fe 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -42,7 +42,7 @@ import rst # rst file support from crbs import crbs from tester import Tester from dut import Dut -from settings import NICS +from settings import NICS, DRIVERS from serializer import Serializer from exception import VerifyFailure from test_case import TestCase @@ -131,6 +131,18 @@ def close_crb_sessions(): log_handler.info("DTF ended") +def get_nic_driver(pci_id): + """ + Return linux driver for specified pci device + """ + driverlist = dict(zip(NICS.values(), DRIVERS.keys())) + try: + driver = DRIVERS[driverlist[pci_id]] + except Exception as e: + driver = None + return driver + + def accepted_nic(pci_id): """ Return True if the pci_id is a known NIC card in the settings file and if @@ -201,7 +213,7 @@ def dts_parse_config(section): nics = [_.strip() for _ in paramDict['nic_type'].split(',')] - return duts, targets, test_suites, nics + return duts[0], targets, test_suites, nics def get_project_obj(project_name, super_class, crbInst, serializer): @@ -255,7 +267,7 @@ def dts_log_execution(log_handler): pass -def dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir): +def dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir, nics): """ Create dts dut/tester instance and initialize them. """ @@ -270,6 +282,7 @@ def dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir): tester.dut = dut dut.set_speedup_options(read_cache, skip_setup) dut.set_directory(base_dir) + dut.set_nic_types(nics) tester.set_speedup_options(read_cache, skip_setup) show_speedup_options_messages(read_cache, skip_setup) dut.set_test_types(func_tests=functional_only, perf_tests=performance_only) @@ -426,36 +439,35 @@ def run_all(config_file, pkgName, git, patch, skip_setup, dts_parse_param(section) # verify if the delimiter is good if the lists are vertical - duts, targets, test_suites, nics = dts_parse_config(section) + dutIP, targets, test_suites, nics = dts_parse_config(section) - for dutIP in duts: - log_handler.info("\nDUT " + dutIP) + log_handler.info("\nDUT " + dutIP) - # look up in crbs - to find the matching IP - crbInst = None - for crb in crbs: - if crb['IP'] == dutIP: - crbInst = crb - break + # look up in crbs - to find the matching IP + crbInst = None + for crb in crbs: + if crb['IP'] == dutIP: + crbInst = crb + break - # only run on the dut in known crbs - if crbInst is None: - log_handler.error(" SKIP UNKNOWN CRB") - continue + # only run on the dut in known crbs + if crbInst is None: + log_handler.error(" SKIP UNKNOWN CRB") + continue - result.dut = dutIP + result.dut = dutIP - # init dut, tester crb - dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir) + # init dut, tester crb + dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir, nics) - # Run DUT prerequisites - if dts_run_prerequisties(pkgName, patch) is False: - dts_crbs_exit() - continue + # Run DUT prerequisites + if dts_run_prerequisties(pkgName, patch) is False: + dts_crbs_exit() + continue - dts_run_target(crbInst, targets, test_suites, nics) + dts_run_target(crbInst, targets, test_suites, nics) - dts_crbs_exit() + dts_crbs_exit() save_all_results() -- 1.9.3