From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH v2 2/4] framework: execuction file support port config nic_type
Date: Wed, 4 Feb 2015 14:43:32 +0800 [thread overview]
Message-ID: <1423032214-19856-3-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1423032214-19856-1-git-send-email-yong.liu@intel.com>
DTS support new function that get linux driver with pci device id.
DTS sample execution configuration support configured DUT port.
One execution section support only one DUT.
Signed-off-by: Marvinliu <yong.liu@intel.com>
---
execution.cfg | 2 +-
framework/dts.py | 62 +++++++++++++++++++++++++++++++++-----------------------
2 files changed, 38 insertions(+), 26 deletions(-)
diff --git a/execution.cfg b/execution.cfg
index 18781ee..a67d7b3 100644
--- a/execution.cfg
+++ b/execution.cfg
@@ -19,7 +19,7 @@ test_suites=
pmd_bonded
targets=
x86_64-native-linuxapp-gcc
-parameters=nic_type=niantic:func=true
+parameters=nic_type=cfg:func=true
[Execution2]
crbs=<Performance CRB IP Address>
diff --git a/framework/dts.py b/framework/dts.py
index 712ed54..9ba23fe 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -42,7 +42,7 @@ import rst # rst file support
from crbs import crbs
from tester import Tester
from dut import Dut
-from settings import NICS
+from settings import NICS, DRIVERS
from serializer import Serializer
from exception import VerifyFailure
from test_case import TestCase
@@ -131,6 +131,18 @@ def close_crb_sessions():
log_handler.info("DTF ended")
+def get_nic_driver(pci_id):
+ """
+ Return linux driver for specified pci device
+ """
+ driverlist = dict(zip(NICS.values(), DRIVERS.keys()))
+ try:
+ driver = DRIVERS[driverlist[pci_id]]
+ except Exception as e:
+ driver = None
+ return driver
+
+
def accepted_nic(pci_id):
"""
Return True if the pci_id is a known NIC card in the settings file and if
@@ -201,7 +213,7 @@ def dts_parse_config(section):
nics = [_.strip() for _ in paramDict['nic_type'].split(',')]
- return duts, targets, test_suites, nics
+ return duts[0], targets, test_suites, nics
def get_project_obj(project_name, super_class, crbInst, serializer):
@@ -255,7 +267,7 @@ def dts_log_execution(log_handler):
pass
-def dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir):
+def dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir, nics):
"""
Create dts dut/tester instance and initialize them.
"""
@@ -270,6 +282,7 @@ def dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir):
tester.dut = dut
dut.set_speedup_options(read_cache, skip_setup)
dut.set_directory(base_dir)
+ dut.set_nic_types(nics)
tester.set_speedup_options(read_cache, skip_setup)
show_speedup_options_messages(read_cache, skip_setup)
dut.set_test_types(func_tests=functional_only, perf_tests=performance_only)
@@ -426,36 +439,35 @@ def run_all(config_file, pkgName, git, patch, skip_setup,
dts_parse_param(section)
# verify if the delimiter is good if the lists are vertical
- duts, targets, test_suites, nics = dts_parse_config(section)
+ dutIP, targets, test_suites, nics = dts_parse_config(section)
- for dutIP in duts:
- log_handler.info("\nDUT " + dutIP)
+ 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
- break
+ # look up in crbs - to find the matching IP
+ crbInst = None
+ for crb in crbs:
+ if crb['IP'] == dutIP:
+ crbInst = crb
+ break
- # only run on the dut in known crbs
- if crbInst is None:
- log_handler.error(" SKIP UNKNOWN CRB")
- continue
+ # only run on the dut in known crbs
+ if crbInst is None:
+ log_handler.error(" SKIP UNKNOWN CRB")
+ continue
- result.dut = dutIP
+ result.dut = dutIP
- # init dut, tester crb
- dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir)
+ # init dut, tester crb
+ dts_crbs_init(crbInst, skip_setup, read_cache, project, base_dir, nics)
- # Run DUT prerequisites
- if dts_run_prerequisties(pkgName, patch) is False:
- dts_crbs_exit()
- continue
+ # Run DUT prerequisites
+ if dts_run_prerequisties(pkgName, patch) is False:
+ dts_crbs_exit()
+ continue
- dts_run_target(crbInst, targets, test_suites, nics)
+ dts_run_target(crbInst, targets, test_suites, nics)
- dts_crbs_exit()
+ dts_crbs_exit()
save_all_results()
--
1.9.3
next prev parent reply other threads:[~2015-02-04 6:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 6:43 [dts] [PATCH v2 0/4] Support additional port configuration file Yong Liu
2015-02-04 6:43 ` [dts] [PATCH v2 1/4] framework: add new module for load " Yong Liu
2015-02-04 6:47 ` Qiu, Michael
2015-02-04 6:43 ` Yong Liu [this message]
2015-02-04 7:07 ` [dts] [PATCH v2 2/4] framework: execuction file support port config nic_type Qiu, Michael
2015-02-04 6:43 ` [dts] [PATCH v2 3/4] framework: reorganize DUT and Tester port initialize sequence Yong Liu
2015-02-04 6:59 ` Qiu, Michael
2015-02-04 6:43 ` [dts] [PATCH v2 4/4] suites: remove nic type check from testsuites Yong Liu
2015-02-04 6:50 ` Qiu, Michael
2015-02-05 1:32 ` [dts] [PATCH v2 0/4] Support additional port configuration file Liu, Yong
2015-02-05 2:18 ` [dts] [PATCH] framework: add port config pci bus id check suites: seperated checksum_offload function and performance port requirements Yong Liu
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=1423032214-19856-3-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).