[dts] [PATCH 2/2] framework/dut: Style and clean up
Radoslaw Biernacki
radoslaw.biernacki at linaro.org
Tue Dec 12 15:35:14 CET 2017
Fixing indentation
Removing unused imports
Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki at linaro.org>
---
framework/dut.py | 34 +++++++++++++++++-----------------
framework/pmd_output.py | 2 +-
tests/TestSuite_generic_filter.py | 1 -
3 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/framework/dut.py b/framework/dut.py
index 6b89439..37590a1 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -260,25 +260,25 @@ class Dut(Crb):
pci_id = port['type']
# get device driver
driver, driver_module = settings.get_nic_driver_module(pci_id)
- if driver is not None:
- # unbind device driver
- addr_array = pci_bus.split(':')
- domain_id = addr_array[0]
- bus_id = addr_array[1]
- devfun_id = addr_array[2]
+ if driver is None:
+ self.logger.info("NOT FOUND DRIVER FOR PORT (%s|%s)!!!" % (pci_bus, pci_id))
+ continue
+ # unbind device driver
+ addr_array = pci_bus.split(':')
+ domain_id = addr_array[0]
+ bus_id = addr_array[1]
+ devfun_id = addr_array[2]
- port = GetNicObj(self, domain_id, bus_id, devfun_id)
+ port = GetNicObj(self, domain_id, bus_id, devfun_id)
- self.send_expect('echo %s > /sys/bus/pci/devices/%s\:%s\:%s/driver/unbind'
- % (pci_bus, domain_id, bus_id, devfun_id), '# ')
- # bind to linux kernel driver
- self.send_expect('modprobe %s' % driver_module, '# ')
- self.send_expect('echo %s > /sys/bus/pci/drivers/%s/bind'
- % (pci_bus, driver), '# ')
- itf = port.get_interface_name()
- self.send_expect("ifconfig %s up" % itf, "# ")
- else:
- self.logger.info("NOT FOUND DRIVER FOR PORT (%s|%s)!!!" % (pci_bus, pci_id))
+ self.send_expect('echo %s > /sys/bus/pci/devices/%s\:%s\:%s/driver/unbind'
+ % (pci_bus, domain_id, bus_id, devfun_id), '# ')
+ # bind to linux kernel driver
+ self.send_expect('modprobe %s' % driver_module, '# ')
+ self.send_expect('echo %s > /sys/bus/pci/drivers/%s/bind'
+ % (pci_bus, driver), '# ')
+ itf = port.get_interface_name()
+ self.send_expect("ifconfig %s up" % itf, "# ")
def setup_memory(self, hugepages=-1):
"""
diff --git a/framework/pmd_output.py b/framework/pmd_output.py
index 2d1e3d7..da6b2d2 100644
--- a/framework/pmd_output.py
+++ b/framework/pmd_output.py
@@ -32,7 +32,7 @@
import os
import re
from time import sleep
-from settings import TIMEOUT, PROTOCOL_PACKET_SIZE, get_nic_driver
+from settings import TIMEOUT, PROTOCOL_PACKET_SIZE
from utils import create_mask
diff --git a/tests/TestSuite_generic_filter.py b/tests/TestSuite_generic_filter.py
index e62e351..cc7744e 100644
--- a/tests/TestSuite_generic_filter.py
+++ b/tests/TestSuite_generic_filter.py
@@ -43,7 +43,6 @@ import re
from test_case import TestCase
from settings import HEADER_SIZE
from pmd_output import PmdOutput
-from settings import DRIVERS
class TestGeneric_filter(TestCase):
--
2.7.4
More information about the dts
mailing list