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 1B3422946 for ; Mon, 19 Sep 2016 07:24:57 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 18 Sep 2016 22:24:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,360,1470726000"; d="scan'208";a="1058714353" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by fmsmga002.fm.intel.com with ESMTP; 18 Sep 2016 22:24:52 -0700 From: Lijuan Tu To: dts@dpdk.org Cc: Lijuan Tu Date: Mon, 19 Sep 2016 13:26:28 +0800 Message-Id: <1474262788-20471-1-git-send-email-lijuanx.a.tu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH v2]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, 19 Sep 2016 05:24:58 -0000 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 --- 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