From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 3D176B62 for ; Mon, 29 Aug 2016 08:44:35 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 28 Aug 2016 23:44:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,595,1464678000"; d="scan'208";a="1042761880" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.239.254.239]) by orsmga002.jf.intel.com with ESMTP; 28 Aug 2016 23:44:30 -0700 From: Lijuan Tu To: dts@dpdk.org Cc: Lijuan Tu Date: Mon, 29 Aug 2016 14:39:58 +0800 Message-Id: <1472452798-7086-1-git-send-email-lijuanx.a.tu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [next]vf cases: fix cases not clear resources. 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, 29 Aug 2016 06:44:36 -0000 Signed-off-by: Lijuan Tu --- tests/TestSuite_sriov_kvm.py | 4 ++-- tests/TestSuite_vf_jumboframe.py | 8 ++++---- tests/TestSuite_vf_macfilter.py | 9 +++++---- tests/TestSuite_vf_offload.py | 4 ++-- tests/TestSuite_vf_packet_rxtx.py | 18 ++++++++++-------- tests/TestSuite_vf_port_start_stop.py | 12 +++++++----- tests/TestSuite_vf_vlan.py | 6 +++--- 7 files changed, 33 insertions(+), 28 deletions(-) diff --git a/tests/TestSuite_sriov_kvm.py b/tests/TestSuite_sriov_kvm.py index 41af4dd..05323d0 100644 --- a/tests/TestSuite_sriov_kvm.py +++ b/tests/TestSuite_sriov_kvm.py @@ -380,7 +380,7 @@ class TestSriovKvm(TestCase): self.host_testpmd.execute_cmd('quit', '# ') self.host_testpmd = None - if getattr(self, 'used_dut_port', None): + if getattr(self, 'used_dut_port', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port) port = self.dut.ports_info[self.used_dut_port]['port'] port.bind_driver('igb_uio') @@ -478,7 +478,7 @@ class TestSriovKvm(TestCase): self.host_testpmd.execute_cmd('quit', '# ') self.host_testpmd = None - if getattr(self, 'used_dut_port', None): + if getattr(self, 'used_dut_port', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port) port = self.ports_info[self.used_dut_port]['port'] port.bind_driver('igb_uio') diff --git a/tests/TestSuite_vf_jumboframe.py b/tests/TestSuite_vf_jumboframe.py index d32990a..a8cd6f5 100644 --- a/tests/TestSuite_vf_jumboframe.py +++ b/tests/TestSuite_vf_jumboframe.py @@ -60,7 +60,7 @@ class TestVfJumboFrame(TestCase): for port in ports: netdev = self.dut.ports_info[port]['port'] driver_now = netdev.get_nic_driver() - if driver == "": + if driver == None: driver = netdev.default_driver if driver != driver_now: netdev.bind_driver(driver=driver) @@ -125,11 +125,11 @@ class TestVfJumboFrame(TestCase): self.vm.stop() self.vm = None - if getattr(self, 'used_dut_port', None): + time.sleep(3) + if getattr(self, 'used_dut_port', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port) self.used_dut_port = None - - self.bind_nic_driver(self.dut_ports[:1], driver="igb_uio") + self.bind_nic_driver(self.dut_ports[:1], driver='default') self.env_done = False diff --git a/tests/TestSuite_vf_macfilter.py b/tests/TestSuite_vf_macfilter.py index 1fce394..f7c81d5 100644 --- a/tests/TestSuite_vf_macfilter.py +++ b/tests/TestSuite_vf_macfilter.py @@ -73,8 +73,9 @@ class TestVfMacFilter(TestCase): def destroy_2pf_2vf_1vm_env(self): if getattr(self, 'vm0', None): #destroy testpmd in vm0 - self.vm0_testpmd.execute_cmd('stop') - self.vm0_testpmd.execute_cmd('quit', '# ') + if getattr(self, 'vm0_testpmd', None): + self.vm0_testpmd.execute_cmd('stop') + self.vm0_testpmd.execute_cmd('quit', '# ') self.vm0_testpmd = None self.vm0_dut_ports = None #destroy vm0 @@ -85,13 +86,13 @@ class TestVfMacFilter(TestCase): self.host_testpmd.execute_cmd('quit', '# ') self.host_testpmd = None - if getattr(self, 'used_dut_port_0', None): + if getattr(self, 'used_dut_port_0', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port_0) port = self.dut.ports_info[self.used_dut_port_0]['port'] port.bind_driver() self.used_dut_port_0 = None - if getattr(self, 'used_dut_port_1', None): + if getattr(self, 'used_dut_port_1', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port_1) port = self.dut.ports_info[self.used_dut_port_1]['port'] port.bind_driver() diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py index 6a4ab52..3b8ae3a 100644 --- a/tests/TestSuite_vf_offload.py +++ b/tests/TestSuite_vf_offload.py @@ -83,13 +83,13 @@ class TestVfOffload(TestCase): self.host_testpmd.execute_cmd('quit', '# ') self.host_testpmd = None - if getattr(self, 'used_dut_port_0', None): + if getattr(self, 'used_dut_port_0', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port_0) port = self.dut.ports_info[self.used_dut_port_0]['port'] port.bind_driver() self.used_dut_port_0 = None - if getattr(self, 'used_dut_port_1', None): + if getattr(self, 'used_dut_port_1', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port_1) port = self.dut.ports_info[self.used_dut_port_1]['port'] port.bind_driver() diff --git a/tests/TestSuite_vf_packet_rxtx.py b/tests/TestSuite_vf_packet_rxtx.py index 25b03eb..9ae1e73 100644 --- a/tests/TestSuite_vf_packet_rxtx.py +++ b/tests/TestSuite_vf_packet_rxtx.py @@ -81,13 +81,13 @@ class TestVfPacketRxtx(TestCase): self.host_testpmd.execute_cmd('quit', '# ') self.host_testpmd = None - if getattr(self, 'used_dut_port_0', None): + if getattr(self, 'used_dut_port_0', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port_0) port = self.dut.ports_info[self.used_dut_port_0]['port'] port.bind_driver() self.used_dut_port_0 = None - if getattr(self, 'used_dut_port_1', None): + if getattr(self, 'used_dut_port_1', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port_1) port = self.dut.ports_info[self.used_dut_port_1]['port'] port.bind_driver() @@ -199,8 +199,9 @@ class TestVfPacketRxtx(TestCase): def destroy_3vf_2vm_env(self): if getattr(self, 'vm0', None): - self.vm0_testpmd.execute_cmd('stop') - self.vm0_testpmd.execute_cmd('quit', '# ') + if getattr(self, 'vm0_testpmd', None): + self.vm0_testpmd.execute_cmd('stop') + self.vm0_testpmd.execute_cmd('quit', '# ') self.vm0_testpmd = None self.vm0_dut_ports = None self.vm_dut_0 = None @@ -208,19 +209,20 @@ class TestVfPacketRxtx(TestCase): self.vm0 = None if getattr(self, 'vm1', None): - self.vm1_testpmd.execute_cmd('stop') - self.vm1_testpmd.execute_cmd('quit', '# ') + if getattr(self, 'vm1_testpmd', None): + self.vm1_testpmd.execute_cmd('stop') + self.vm1_testpmd.execute_cmd('quit', '# ') self.vm1_testpmd = None self.vm1_dut_ports = None self.vm_dut_1 = None self.vm1.stop() self.vm1 = None - if getattr(self, 'host_testpmd', None): + if getattr(self, 'host_testpmd', None) != None: self.host_testpmd.execute_cmd('quit', '# ') self.host_testpmd = None - if getattr(self, 'used_dut_port', None): + if getattr(self, 'used_dut_port', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port) port = self.dut.ports_info[self.used_dut_port]['port'] port.bind_driver() diff --git a/tests/TestSuite_vf_port_start_stop.py b/tests/TestSuite_vf_port_start_stop.py index 35309c4..078b926 100644 --- a/tests/TestSuite_vf_port_start_stop.py +++ b/tests/TestSuite_vf_port_start_stop.py @@ -72,7 +72,7 @@ class TestVfPortStartStop(TestCase): self.tester_tx_pci = self.tester.ports_info[self.tester_tx_port]['pci'] port = self.tester.ports_info[self.tester_tx_port]['port'] self.tester_port_driver = port.get_nic_driver() - self.tester.send_expect("./dpdk-devbind.py --bind=igb_uio %s" % self.tester_tx_pci, "#") + self.tester.send_expect("./dpdk_nic_bind.py --bind=igb_uio %s" % self.tester_tx_pci, "#") src_mac = self.tester.get_mac(self.tester_tx_port) if src_mac == 'N/A': @@ -182,8 +182,9 @@ class TestVfPortStartStop(TestCase): def destroy_1pf_2vf_1vm_env(self): if getattr(self, 'vm0', None): #destroy testpmd in vm0 - self.vm0_testpmd.execute_cmd('stop') - self.vm0_testpmd.execute_cmd('quit', '# ') + if getattr(self, 'vm0_testpmd', None): + self.vm0_testpmd.execute_cmd('stop') + self.vm0_testpmd.execute_cmd('quit', '# ') self.vm0_testpmd = None self.vm0_dut_ports = None #destroy vm0 @@ -194,7 +195,7 @@ class TestVfPortStartStop(TestCase): self.host_testpmd.execute_cmd('quit', '# ') self.host_testpmd = None - if getattr(self, 'used_dut_port', None): + if getattr(self, 'used_dut_port', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port) port = self.dut.ports_info[self.used_dut_port]['port'] port.bind_driver() @@ -232,7 +233,8 @@ class TestVfPortStartStop(TestCase): def tear_down_all(self): self.pktgen_kill() - self.tester.send_expect("./dpdk-devbind.py --bind=%s %s" %(self.tester_port_driver, self.tester_tx_pci), "#") + if getattr(self, 'tester_port_driver', None) and getattr(self, 'tester_tx_pci', None): + self.tester.send_expect("./dpdk_nic_bind.py --bind=%s %s" %(self.tester_port_driver, self.tester_tx_pci), "#") if getattr(self, 'vm0', None): self.vm0.stop() diff --git a/tests/TestSuite_vf_vlan.py b/tests/TestSuite_vf_vlan.py index f106cac..071da90 100644 --- a/tests/TestSuite_vf_vlan.py +++ b/tests/TestSuite_vf_vlan.py @@ -122,17 +122,17 @@ class TestVfVlan(TestCase): self.vm0.stop() self.vm0 = None - if getattr(self, 'used_dut_port_0', None): + if getattr(self, 'used_dut_port_0', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port_0) port = self.dut.ports_info[self.used_dut_port_0]['port'] self.used_dut_port_0 = None - if getattr(self, 'used_dut_port_1', None): + if getattr(self, 'used_dut_port_1', None) != None: self.dut.destroy_sriov_vfs_by_port(self.used_dut_port_1) port = self.dut.ports_info[self.used_dut_port_1]['port'] self.used_dut_port_1 = None - self.bind_nic_driver(self.dut_ports[:2], driver="igb_uio") + self.bind_nic_driver(self.dut_ports[:2], driver='default') self.env_done = False -- 1.9.3