test suite reviews and discussions
 help / color / mirror / Atom feed
From: Marvin Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 2/4] framework: execuction file support port config nic_type
Date: Fri, 23 Jan 2015 16:26:57 +0800	[thread overview]
Message-ID: <1422001619-27112-3-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1422001619-27112-1-git-send-email-yong.liu@intel.com>

From: Yong Liu <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

  parent reply	other threads:[~2015-01-23  8:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  8:26 [dts] [PATCH 0/4] Support additional port configuration file Marvin Liu
2015-01-23  8:26 ` [dts] [PATCH 1/4] framework: add new module for load " Marvin Liu
2015-02-04  3:26   ` Qiu, Michael
2015-02-04  4:51     ` Liu, Yong
2015-01-23  8:26 ` Marvin Liu [this message]
2015-02-04  3:57   ` [dts] [PATCH 2/4] framework: execuction file support port config nic_type Qiu, Michael
2015-01-23  8:26 ` [dts] [PATCH 3/4] framework: reorganize DUT and Tester port initialize sequence Marvin Liu
2015-02-04  3:56   ` Qiu, Michael
2015-02-04  5:24     ` Liu, Yong
2015-01-23  8:26 ` [dts] [PATCH 4/4] suites: remove nic type check from testsuites Marvin Liu
2015-02-04  3:57   ` Qiu, Michael

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=1422001619-27112-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).