test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH] Enhance set_target function for check whether bind devices
Date: Mon,  6 Jul 2015 14:01:04 +0800	[thread overview]
Message-ID: <1436162464-3205-1-git-send-email-yong.liu@intel.com> (raw)

From: Marvin Liu <yong.liu@intel.com>

Most of time, devices need bound to igb_uio for later validation.
But in special case like legacy driver, devices should not bound first.

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

diff --git a/framework/dts.py b/framework/dts.py
index b843f22..5312849 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -289,7 +289,7 @@ def dts_run_target(crbInst, targets, test_suites, nic, scenario):
         try:
             if scene:
                 scene.set_target(target)
-                dut.set_target(target, build_only=True)
+                dut.set_target(target, bind_dev=False)
             else:
                 dut.set_target(target)
         except AssertionError as ex:
diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index bc1a9bd..7cbff51 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -53,7 +53,7 @@ class DPDKdut(Dut):
         super(DPDKdut, self).__init__(crb, serializer)
         self.testpmd = None
 
-    def set_target(self, target, build_only=False):
+    def set_target(self, target, bind_dev=True):
         """
         Set env variable, these have to be setup all the time. Some tests
         need to compile example apps by themselves and will fail otherwise.
@@ -76,7 +76,7 @@ class DPDKdut(Dut):
         self.setup_memory()
         self.setup_modules(target)
 
-        if build_only is False and self.get_os_type() == 'linux':
+        if bind_dev and self.get_os_type() == 'linux':
             self.bind_interfaces_linux(dts.drivername)
 
     def setup_modules(self, target):
diff --git a/framework/virt_base.py b/framework/virt_base.py
index b9ea56f..9787ed3 100644
--- a/framework/virt_base.py
+++ b/framework/virt_base.py
@@ -223,7 +223,7 @@ class VirtBase(object):
         self.load_global_config()
         self.load_local_config(self.suite)
 
-    def start(self, load_config=True, set_target=True, auto_portmap=True):
+    def start(self, load_config=True, set_target=True, auto_portmap=True, bind_dev=True):
         """
         Start VM and instantiate the VM with VirtDut.
         """
@@ -292,7 +292,7 @@ class VirtBase(object):
         """
         NotImplemented
 
-    def instantiate_vm_dut(self, set_target=True, auto_portmap=True):
+    def instantiate_vm_dut(self, set_target=True, auto_portmap=True, bind_dev=True):
         """
         Instantiate the Dut class for VM.
         """
@@ -341,7 +341,7 @@ class VirtBase(object):
             vm_dut.prerequisites(dts.Package, dts.Patches, auto_portmap)
             if set_target:
                 target = self.host_dut.target
-                vm_dut.set_target(target)
+                vm_dut.set_target(target, bind_dev)
         except:
             raise exception.VirtDutInitException(vm_dut)
             return None
diff --git a/framework/virt_dut.py b/framework/virt_dut.py
index 2edbf6f..05ead10 100644
--- a/framework/virt_dut.py
+++ b/framework/virt_dut.py
@@ -119,7 +119,7 @@ class VirtDut(DPDKdut):
                 pci_idx = self.tester.get_local_index(tester_pci)
                 self.ports_map[index] = pci_idx
 
-    def set_target(self, target):
+    def set_target(self, target, bind_dev=True):
         """
         Set env variable, these have to be setup all the time. Some tests
         need to compile example apps by themselves and will fail otherwise.
@@ -140,7 +140,8 @@ class VirtDut(DPDKdut):
         self.setup_memory(hugepages=512)
         self.setup_modules(target)
 
-        self.bind_interfaces_linux('igb_uio')
+        if bind_dev:
+            self.bind_interfaces_linux('igb_uio')
 
     def prerequisites(self, pkgName, patch, auto_portmap):
         """
-- 
1.9.3

                 reply	other threads:[~2015-07-06  6:01 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=1436162464-3205-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).