test suite reviews and discussions
 help / color / mirror / Atom feed
From: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
To: dts@dpdk.org, yong.liu@intel.com
Cc: herbert.guan@arm.com, Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Subject: [dts] [PATCH 2/2] framework/dut: Style and clean up
Date: Tue, 12 Dec 2017 15:35:14 +0100	[thread overview]
Message-ID: <1513089314-12719-2-git-send-email-radoslaw.biernacki@linaro.org> (raw)
In-Reply-To: <1513089314-12719-1-git-send-email-radoslaw.biernacki@linaro.org>

Fixing indentation
Removing unused imports

Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@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

      reply	other threads:[~2017-12-12 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 14:35 [dts] [PATCH 1/2] framework/dut: fixing misconception about nic pci driver name and driver module filename Radoslaw Biernacki
2017-12-12 14:35 ` Radoslaw Biernacki [this message]

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=1513089314-12719-2-git-send-email-radoslaw.biernacki@linaro.org \
    --to=radoslaw.biernacki@linaro.org \
    --cc=dts@dpdk.org \
    --cc=herbert.guan@arm.com \
    --cc=yong.liu@intel.com \
    /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).