From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 15081ADA5 for ; Wed, 4 Feb 2015 07:44:04 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 03 Feb 2015 22:37:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,517,1418112000"; d="scan'208";a="522266727" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 03 Feb 2015 22:36:24 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t146i0ZI005741; Wed, 4 Feb 2015 14:44:00 +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 t146hwEn019906; Wed, 4 Feb 2015 14:44:00 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t146hwf6019902; Wed, 4 Feb 2015 14:43:58 +0800 From: Yong Liu To: dts@dpdk.org Date: Wed, 4 Feb 2015 14:43:32 +0800 Message-Id: <1423032214-19856-3-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1423032214-19856-1-git-send-email-yong.liu@intel.com> References: <1423032214-19856-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH v2 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 06:44:05 -0000 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