test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH v2]vf cases: fix cases not clear resources
@ 2016-09-19  5:26 Lijuan Tu
  2016-09-19 14:27 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: Lijuan Tu @ 2016-09-19  5:26 UTC (permalink / raw)
  To: dts; +Cc: Lijuan Tu

vf_jumboframe,vf_offload,vf_packet_rxtx,vf_port_start_stop,vf_vlani:

"used_dut_port == 0" is ture, so the judgement is error.

Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
 tests/TestSuite_vf_jumboframe.py      |  9 +++++----
 tests/TestSuite_vf_offload.py         |  8 +++++---
 tests/TestSuite_vf_packet_rxtx.py     | 19 ++++++++++---------
 tests/TestSuite_vf_port_start_stop.py | 13 +++++++------
 tests/TestSuite_vf_vlan.py            |  6 +++---
 5 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/tests/TestSuite_vf_jumboframe.py b/tests/TestSuite_vf_jumboframe.py
index bac4a29..e0cbbcf 100644
--- a/tests/TestSuite_vf_jumboframe.py
+++ b/tests/TestSuite_vf_jumboframe.py
@@ -4,6 +4,7 @@ import re
 import time
 
 import dts
+import utils
 from qemu_kvm import QEMUKvm
 from test_case import TestCase
 from pmd_output import PmdOutput
@@ -60,7 +61,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 +126,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_offload.py b/tests/TestSuite_vf_offload.py
index 78fa5a6..3551e2d 100644
--- a/tests/TestSuite_vf_offload.py
+++ b/tests/TestSuite_vf_offload.py
@@ -2,15 +2,16 @@
 
 import re
 import time
+import string
 
 import dts
+import utils
 from qemu_kvm import QEMUKvm
 from test_case import TestCase
 from pmd_output import PmdOutput
 from utils import RED, GREEN
 from net_device import NetDevice
 from crb import Crb
-from scapy.all import *
 from settings import HEADER_SIZE
 VM_CORES_MASK = 'all'
 
@@ -79,17 +80,18 @@ class TestVfOffload(TestCase):
             self.vm0.stop()
             self.vm0 = None
 
+        time.sleep(3)
         if getattr(self, 'host_testpmd', None):
             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 2f9dfc1..9ae1e73 100644
--- a/tests/TestSuite_vf_packet_rxtx.py
+++ b/tests/TestSuite_vf_packet_rxtx.py
@@ -3,7 +3,6 @@
 import re
 import time
 
-import dts
 from qemu_kvm import QEMUKvm
 from test_case import TestCase
 from pmd_output import PmdOutput
@@ -82,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()
@@ -200,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
@@ -209,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 7657879..078b926 100644
--- a/tests/TestSuite_vf_port_start_stop.py
+++ b/tests/TestSuite_vf_port_start_stop.py
@@ -3,7 +3,6 @@
 import re
 import time
 
-import dts
 from qemu_kvm import QEMUKvm
 from test_case import TestCase
 from pmd_output import PmdOutput
@@ -73,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':
@@ -183,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
@@ -195,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()
@@ -233,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 fc1527c..0568543 100644
--- a/tests/TestSuite_vf_vlan.py
+++ b/tests/TestSuite_vf_vlan.py
@@ -123,17 +123,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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-19 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-19  5:26 [dts] [PATCH v2]vf cases: fix cases not clear resources Lijuan Tu
2016-09-19 14:27 ` Liu, Yong

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).