summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Liu <yong.liu@intel.com>2015-08-07 13:36:10 +0800
committerMarvin Liu <yong.liu@intel.com>2015-08-13 16:13:44 +0800
commit9539c5cff2ea0e0db443ac1f1ca934332bb9933e (patch)
treeaeddec65d1a1cd27a0f4e393ca27de18ba09a772
parentbec332658a54281d64abc566e26e9289e927964b (diff)
downloaddts-9539c5cff2ea0e0db443ac1f1ca934332bb9933e.zip
dts-9539c5cff2ea0e0db443ac1f1ca934332bb9933e.tar.gz
dts-9539c5cff2ea0e0db443ac1f1ca934332bb9933e.tar.xz
Move function accepted_nic to dts module
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>
-rw-r--r--framework/dut.py6
-rw-r--r--framework/project_dpdk.py4
-rw-r--r--framework/settings.py18
3 files changed, 5 insertions, 23 deletions
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']: