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 B305F5957 for ; Fri, 7 Aug 2015 07:36:26 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 06 Aug 2015 22:36:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,627,1432623600"; d="scan'208";a="743928703" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 06 Aug 2015 22:36:25 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t775aOkB004644; Fri, 7 Aug 2015 13:36:24 +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 t775aL2H032705; Fri, 7 Aug 2015 13:36:23 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t775aL6u032701; Fri, 7 Aug 2015 13:36:21 +0800 From: Yong Liu To: dts@dpdk.org Date: Fri, 7 Aug 2015 13:36:11 +0800 Message-Id: <1438925771-32641-5-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1438925771-32641-1-git-send-email-yong.liu@intel.com> References: <1438925771-32641-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH V2 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: Fri, 07 Aug 2015 05:36:27 -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