summaryrefslogtreecommitdiff
path: root/tests/TestSuite_vf_rss.py
diff options
context:
space:
mode:
authorLijuan Tu <lijuanx.a.tu@intel.com>2017-02-15 17:24:31 +0800
committerMarvin Liu <yong.liu@intel.com>2017-02-20 15:48:25 +0800
commit48641795c3f0159b8684a7f254c3e95df3729a6a (patch)
treef9266e784a34b9f80abe87756f29d9eb480ef70e /tests/TestSuite_vf_rss.py
parent471c47aed245455b9ae5cd9fb332cf5659869989 (diff)
tests: utilize vm cleanup function for stop vm
and Fix grammatical & logic error Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
Diffstat (limited to 'tests/TestSuite_vf_rss.py')
-rw-r--r--tests/TestSuite_vf_rss.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py
index 21c717b..34f25cb 100644
--- a/tests/TestSuite_vf_rss.py
+++ b/tests/TestSuite_vf_rss.py
@@ -254,10 +254,11 @@ class TestVfRss(TestCase):
self.vm0.set_vm_device(driver='pci-assign', **vf0_prot)
self.vm_dut_0 = self.vm0.start()
- self.vm0_testpmd = PmdOutput(self.vm_dut_0)
if self.vm_dut_0 is None:
raise Exception("Set up VM0 ENV failed!")
+ self.vm0_testpmd = PmdOutput(self.vm_dut_0)
+
self.setup_1pf_1vf_1vm_env_flag = 1
except Exception as e:
self.destroy_1pf_1vf_1vm_env()
@@ -265,18 +266,20 @@ class TestVfRss(TestCase):
def destroy_1pf_1vf_1vm_env(self):
if getattr(self, 'vm0', None):
- self.vm0_testpmd.execute_cmd('quit', '# ')
- self.vm0_testpmd = None
+ if getattr(self, 'vm0_testpmd', None):
+ self.vm0_testpmd.execute_cmd('quit', '# ')
+ self.vm0_testpmd = None
self.vm0_dut_ports = None
#destroy vm0
self.vm0.stop()
+ self.dut.virt_exit()
self.vm0 = None
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()
@@ -292,6 +295,7 @@ class TestVfRss(TestCase):
# niantic kernel host driver not support this case
if self.nic is 'niantic' and not self.host_testpmd:
+ self.logger.warning("niantic kernel host driver not support this case")
return
vm0dutPorts = self.vm_dut_0.get_ports('any')
localPort = self.tester.get_local_port(vm0dutPorts[0])