test suite reviews and discussions
 help / color / mirror / Atom feed
From: Marvin Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH] framework test_case: recover all dut ports before execution
Date: Fri, 28 Oct 2016 10:08:39 +0800	[thread overview]
Message-ID: <1477620519-28299-1-git-send-email-yong.liu@intel.com> (raw)

Bind all dut ports to configured driver before suite execution.
This will help when some suites forgot to recover nic driver.

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

diff --git a/framework/test_case.py b/framework/test_case.py
index 85fdb70..7a14d4d 100644
--- a/framework/test_case.py
+++ b/framework/test_case.py
@@ -60,12 +60,20 @@ class TestCase(object):
         self.logger.config_suite(class_name)
         # local variable
         self._requested_tests = None
+        self.drivername = load_global_setting(HOST_DRIVER_SETTING)
 
         # check session and reconnect if possible
         for dutobj in self.duts:
             self._check_and_reconnect(crb=dutobj)
         self._check_and_reconnect(crb=self.tester)
 
+        # try to recover all dut ports
+        for portid in range(len(self.dut.ports_info)):
+            port = self.dut.ports_info[portid]['port']
+            if len(port.get_sriov_vfs_pci()):
+                port.destroy_sriov_vfs()
+            port.bind_driver(self.drivername)
+
         # covert netdevice to codename
         self.nics = []
         for portid in range(len(self.dut.ports_info)):
@@ -107,7 +115,6 @@ class TestCase(object):
         else:
             self._debug_case = False
 
-        self.drivername = load_global_setting(HOST_DRIVER_SETTING)
 
         # create rst format report for this suite
         self._rst_obj = RstReport('rst_report', target, self.nic, self.suite_name, self._enable_perf)
-- 
1.9.1

                 reply	other threads:[~2016-10-28  2:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1477620519-28299-1-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).