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 E79E75952 for ; Thu, 6 Aug 2015 14:35:37 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 06 Aug 2015 05:35:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,622,1432623600"; d="scan'208";a="537093976" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 06 Aug 2015 05:35:36 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t76CZY9x010613; Thu, 6 Aug 2015 20:35:34 +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 t76CZWcj003764; Thu, 6 Aug 2015 20:35:34 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t76CZWEr003760; Thu, 6 Aug 2015 20:35:32 +0800 From: Yong Liu To: dts@dpdk.org Date: Thu, 6 Aug 2015 20:35:22 +0800 Message-Id: <1438864522-3699-5-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1438864522-3699-1-git-send-email-yong.liu@intel.com> References: <1438864522-3699-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH 4/4] Load CRBs information from configuration file 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: Thu, 06 Aug 2015 12:35:38 -0000 From: Marvin Liu Now crb instance will be loaded from configuration file. Remove useless staffs from crbs.py. Signed-off-by: Marvin Liu diff --git a/framework/crbs.py b/framework/crbs.py index 6aa5435..c586caa 100644 --- a/framework/crbs.py +++ b/framework/crbs.py @@ -1,21 +1,6 @@ """ Static configuration data for any CRBs that can be used. """ -from settings import IXIA - -# Todo: modify this script to a config file, like crbs.cfg -crbs = [ - {'IP': '', - 'name': 'CrownPassCRB1', - 'user': '', - 'pass': '', - 'tester IP': '', - 'tester pass': '', - IXIA: None, - 'memory channels': 4, - 'bypass core0': True}, -] - crbs_desc = { 'CrownPassCRB1': diff --git a/framework/dts.py b/framework/dts.py index e9513c6..1b62077 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -41,7 +41,6 @@ import signal # signal module for debug mode import time # time module for unique output folder import rst # rst file support -from crbs import crbs from tester import Tester from dut import Dut from settings import FOLDERS, NICS, DRIVERS @@ -57,6 +56,7 @@ from logger import getLogger import logger import debugger from virt_scene import VirtScene +from config import CrbsConf import sys reload(sys) @@ -453,6 +453,10 @@ def run_all(config_file, pkgName, git, patch, skip_setup, excel_report = ExcelReporter(output_dir + '/test_results.xls') stats = StatsReporter(output_dir + '/statistics.txt') + crbInst = None + crbs_conf = CrbsConf() + crbs = crbs_conf.load_crbs_config() + # for all Exectuion sections for section in config.sections(): dts_parse_param(section) @@ -463,7 +467,6 @@ def run_all(config_file, pkgName, git, patch, skip_setup, 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 @@ -735,3 +738,21 @@ def save_all_results(): """ excel_report.save(result) stats.save(result) + +def accepted_nic(pci_id): + """ + Return True if the pci_id is a known NIC card in the settings file and if + it is selected in the execution file, otherwise it returns False. + """ + global nic + if pci_id not in NICS.values(): + return False + + if nic is 'any': + return True + + else: + if pci_id == NICS[nic]: + return True + + return False -- 1.9.3