[dts] [PATCH V2] tests/vf_port_start_stop: make adjustment to dpdk1705
Lijuan Tu
lijuanx.a.tu at intel.com
Mon May 15 09:10:17 CEST 2017
1, check the result always in the testing because of testing may failed any time
2, config the mac before start qemu ,because create 2 vfs from 1 pf ,the auto mac may not invild
3, remove crc-strip parameter
4, fortville: the value of Rx-Error include discarded packet. so we don't check it.
Signed-off-by: Lijuan Tu <lijuanx.a.tu at intel.com>
---
tests/TestSuite_vf_port_start_stop.py | 30 +++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/tests/TestSuite_vf_port_start_stop.py b/tests/TestSuite_vf_port_start_stop.py
index a272033..05c4582 100644
--- a/tests/TestSuite_vf_port_start_stop.py
+++ b/tests/TestSuite_vf_port_start_stop.py
@@ -122,6 +122,24 @@ class TestVfPortStartStop(TestCase):
self.verify("Checking link statuses" in out, "ERROR: port start all")
testpmd.execute_cmd('start')
time.sleep(.5)
+
+ # we should check the result always in the testing.
+ port_id_0 = 0
+ port_id_1 = 1
+ vf0_stats = self.vm0_testpmd.get_pmd_stats(port_id_0)
+ vf1_stats = self.vm0_testpmd.get_pmd_stats(port_id_1)
+
+ vf0_rx_cnt = vf0_stats['RX-packets']
+ self.verify(vf0_rx_cnt != 0, "no packet was received by vm0_VF0")
+ if self.kdriver == "i40e":
+ vf0_rx_err = vf0_stats['RX-errors']
+ self.verify(vf0_rx_err == 0, "vm0_VF0 rx-errors")
+
+ vf1_tx_cnt = vf1_stats['TX-packets']
+ self.verify(vf1_tx_cnt != 0, "no packet was transmitted by vm0_VF1")
+
+ vf1_tx_err = vf1_stats['TX-errors']
+ self.verify(vf1_tx_err == 0, "vm0_VF0 tx-errors")
testpmd.execute_cmd('stop')
out = testpmd.execute_cmd('port stop all')
self.verify("Checking link statuses" in out, "ERROR: port stop all")
@@ -134,8 +152,9 @@ class TestVfPortStartStop(TestCase):
vf0_rx_cnt = vf0_stats['RX-packets']
self.verify(vf0_rx_cnt != 0, "no packet was received by vm0_VF0")
- vf0_rx_err = vf0_stats['RX-errors']
- self.verify(vf0_rx_err == 0, "vm0_VF0 rx-errors")
+ if self.kdriver == "i40e":
+ vf0_rx_err = vf0_stats['RX-errors']
+ self.verify(vf0_rx_err == 0, "vm0_VF0 rx-errors")
vf1_tx_cnt = vf1_stats['TX-packets']
self.verify(vf1_tx_cnt != 0, "no packet was transmitted by vm0_VF1")
@@ -148,6 +167,10 @@ class TestVfPortStartStop(TestCase):
self.used_dut_port = self.dut_ports[0]
self.dut.generate_sriov_vfs_by_port(self.used_dut_port, 2, driver=driver)
self.sriov_vfs_port = self.dut.ports_info[self.used_dut_port]['vfs_port']
+ # create 2 vfs from 0 ,the auto mac may not invild.
+ pf_intf0 = self.dut.ports_info[0]['port'].get_interface_name()
+ self.pf0_vf0_mac = "00:12:34:56:78:01"
+ self.dut.send_expect("ip link set %s vf 0 mac %s" %(pf_intf0, self.pf0_vf0_mac), "#")
try:
@@ -189,6 +212,7 @@ class TestVfPortStartStop(TestCase):
self.vm0_dut_ports = None
#destroy vm0
self.vm0.stop()
+ time.sleep(3)
self.vm0 = None
if getattr(self, 'host_testpmd', None):
@@ -214,7 +238,7 @@ class TestVfPortStartStop(TestCase):
self.vm0_dut_ports = self.vm_dut_0.get_ports('any')
self.vm0_testpmd = PmdOutput(self.vm_dut_0)
- self.vm0_testpmd.start_testpmd(VM_CORES_MASK, '--crc-strip')
+ self.vm0_testpmd.start_testpmd(VM_CORES_MASK)
self.vm0_testpmd.execute_cmd('set fwd mac')
time.sleep(2)
--
1.9.3
More information about the dts
mailing list