[dts] [PATCH 4/4] Load CRBs information from configuration file
Yong Liu
yong.liu at intel.com
Thu Aug 6 14:35:22 CEST 2015
From: Marvin Liu <yong.liu at intel.com>
Now crb instance will be loaded from configuration file. Remove useless staffs
from crbs.py.
Signed-off-by: Marvin Liu <yong.liu at intel.com>
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
More information about the dts
mailing list