test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH V2 3/4] Move function accepted_nic to dts module
Date: Fri,  7 Aug 2015 13:36:10 +0800	[thread overview]
Message-ID: <1438925771-32641-4-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>

This function will use varaiable in dts. Moved to dts module will make
settings module independent from it.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/framework/dut.py b/framework/dut.py
index a5c9db3..1199fc6 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -322,7 +322,7 @@ class Dut(Crb):
 
         current_nic = 0
         for (pci_bus, pci_id) in self.pci_devices_info:
-            if settings.accepted_nic(pci_id):
+            if dts.accepted_nic(pci_id):
                 if self.is_ssh_session_port(pci_bus):
                     continue
 
@@ -345,7 +345,7 @@ class Dut(Crb):
 
         current_nic = 0
         for (pci_bus, pci_id) in self.pci_devices_info:
-            if settings.accepted_nic(pci_id):
+            if dts.accepted_nic(pci_id):
                 if self.is_ssh_session_port(pci_bus):
                     continue
 
@@ -671,7 +671,7 @@ class Dut(Crb):
 
         for (pci_bus, pci_id) in self.pci_devices_info:
 
-            if not settings.accepted_nic(pci_id):
+            if not dts.accepted_nic(pci_id):
                 self.logger.info("DUT: [%s %s] %s" % (pci_bus, pci_id,
                                                       skipped))
                 continue
diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index 7b6e1ae..e0009d3 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -39,7 +39,7 @@ from crb import Crb
 from dut import Dut
 from tester import Tester
 from logger import getLogger
-from settings import IXIA, accepted_nic
+from settings import IXIA
 
 
 class DPDKdut(Dut):
@@ -112,7 +112,7 @@ class DPDKdut(Dut):
         binding_list = ''
 
         for (pci_bus, pci_id) in self.pci_devices_info:
-            if accepted_nic(pci_id):
+            if dts.accepted_nic(pci_id):
                 binding_list += '%s,' % (pci_bus)
 
         self.send_expect("kldunload if_ixgbe.ko", "#")
diff --git a/framework/settings.py b/framework/settings.py
index 631bd32..6b02e4d 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -33,7 +33,6 @@ Folders for framework running enviornment.
 """
 import re
 import socket
-import dts
 
 FOLDERS = {
     'Framework': 'framework',
@@ -179,23 +178,6 @@ def get_nic_driver(pci_id):
     return driver
 
 
-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.
-    """
-    if pci_id not in NICS.values():
-        return False
-
-    if dts.nic is 'any':
-        return True
-
-    else:
-        if pci_id == NICS[dts.nic]:
-            return True
-
-    return False
-
 def get_netdev(crb, pci):
     for port in crb.ports_info:
         if pci == port['pci']:
-- 
1.9.3

  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] Load CRBs information from configuration file 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 ` Yong Liu [this message]
2015-08-07  5:36 ` [dts] [PATCH V2 4/4] Load CRBs information from " 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=1438925771-32641-4-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).