test suite reviews and discussions
 help / color / mirror / Atom feed
From: Lijuan Tu <lijuanx.a.tu@intel.com>
To: dts@dpdk.org
Cc: Lijuan Tu <lijuanx.a.tu@intel.com>
Subject: [dts] [next]vf cases: fix cases not clear resources.
Date: Mon, 29 Aug 2016 14:39:58 +0800	[thread overview]
Message-ID: <1472452798-7086-1-git-send-email-lijuanx.a.tu@intel.com> (raw)

Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
 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

             reply	other threads:[~2016-08-29  6:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29  6:39 Lijuan Tu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-08-23  3:04 Lijuan Tu

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=1472452798-7086-1-git-send-email-lijuanx.a.tu@intel.com \
    --to=lijuanx.a.tu@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).