From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 39146C392 for ; Mon, 6 Jul 2015 08:01:17 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 05 Jul 2015 23:01:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,413,1432623600"; d="scan'208";a="741221473" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 05 Jul 2015 23:01:11 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t66618a7011305; Mon, 6 Jul 2015 14:01:08 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t66616mf003241; Mon, 6 Jul 2015 14:01:08 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t66615oL003237; Mon, 6 Jul 2015 14:01:05 +0800 From: Yong Liu To: dts@dpdk.org Date: Mon, 6 Jul 2015 14:01:04 +0800 Message-Id: <1436162464-3205-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dts] [PATCH] Enhance set_target function for check whether bind devices X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2015 06:01:17 -0000 From: Marvin Liu 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 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