From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH V2 4/4] Load CRBs information from configuration file
Date: Fri, 7 Aug 2015 13:36:11 +0800 [thread overview]
Message-ID: <1438925771-32641-5-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1438925771-32641-1-git-send-email-yong.liu@intel.com>
From: Marvin Liu <yong.liu@intel.com>
Now crb instance will be loaded from configuration file. Remove useless staffs
from crbs.py.
Signed-off-by: Marvin Liu <yong.liu@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
prev parent reply other threads:[~2015-08-07 5:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-07 5:36 [dts] [PATCH V2 0/4] " Yong Liu
2015-08-07 5:36 ` [dts] [PATCH V2 1/4] Support load crbs " Yong Liu
2015-08-07 5:36 ` [dts] [PATCH V2 2/4] Add sample " Yong Liu
2015-08-07 5:36 ` [dts] [PATCH V2 3/4] Move function accepted_nic to dts module Yong Liu
2015-08-07 5:36 ` Yong Liu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1438925771-32641-5-git-send-email-yong.liu@intel.com \
--to=yong.liu@intel.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).