summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Liu <yong.liu@intel.com>2015-08-07 13:36:11 +0800
committerMarvin Liu <yong.liu@intel.com>2015-08-13 16:17:39 +0800
commit53336f4397b4bcb36fc5cc88cdddacdfe98b4000 (patch)
tree0c17d1cf9ea2bc12a66e1ae0f21918049665f7de
parent9539c5cff2ea0e0db443ac1f1ca934332bb9933e (diff)
downloaddts-53336f4397b4bcb36fc5cc88cdddacdfe98b4000.zip
dts-53336f4397b4bcb36fc5cc88cdddacdfe98b4000.tar.gz
dts-53336f4397b4bcb36fc5cc88cdddacdfe98b4000.tar.xz
Load CRBs information from configuration file
Now crb instance will be loaded from configuration file. Remove useless staffs from crbs.py. Signed-off-by: Marvin Liu <yong.liu@intel.com>
-rw-r--r--framework/crbs.py14
-rw-r--r--framework/dts.py25
2 files changed, 23 insertions, 16 deletions
diff --git a/framework/crbs.py b/framework/crbs.py
index 6aa5435..2ff937a 100644
--- a/framework/crbs.py
+++ b/framework/crbs.py
@@ -3,20 +3,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 613926c..33ac542 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
from checkCase import *
import sys
reload(sys)
@@ -456,6 +456,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)
@@ -465,7 +469,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
@@ -744,3 +747,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