[V1,1/2] tests/ice_dcf_switch_filter_gtpu: remove the method of checking testpmd status
Commit Message
1.the "testpmd_status" is the wrong status when launch app timeout,
it will affect other cases test.remove this method.
2.add timeout.
Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
tests/TestSuite_ice_dcf_switch_filter_gtpu.py | 26 +++++++------------
1 file changed, 10 insertions(+), 16 deletions(-)
@@ -3550,7 +3550,6 @@ class ICEDCFSwitchFilterGTPUTest(TestCase):
localPort = self.tester.get_local_port(self.dut_ports[0])
self.__tx_iface = self.tester.get_interface(localPort)
self.pkt = Packet()
- self.testpmd_status = "close"
self.pass_flag = "passed"
self.fail_flag = "failed"
# bind pf to kernel
@@ -3592,8 +3591,7 @@ class ICEDCFSwitchFilterGTPUTest(TestCase):
"""
dcf switch need reload driver to ensure create rule sucessful
"""
- self.dut.send_expect("rmmod ice", "# ", 15)
- self.dut.send_expect("modprobe ice", "# ", 15)
+ self.dut.send_expect("rmmod ice && modprobe ice", "# ", 120)
def create_testpmd_command(self):
"""
@@ -3617,8 +3615,7 @@ class ICEDCFSwitchFilterGTPUTest(TestCase):
launch testpmd with the command
"""
command = self.create_testpmd_command()
- self.dut.send_expect(command, "testpmd> ", 15)
- self.testpmd_status = "running"
+ self.dut.send_expect(command, "testpmd> ", 30)
self.dut.send_expect("set portlist 1", "testpmd> ", 15)
self.dut.send_expect("set fwd rxonly", "testpmd> ", 15)
self.dut.send_expect("set verbose 1", "testpmd> ", 15)
@@ -3817,17 +3814,14 @@ class ICEDCFSwitchFilterGTPUTest(TestCase):
"""
quit testpmd and destroy vf
"""
- if self.testpmd_status != "close":
- # destroy all flow rules on DCF
- self.dut.send_expect("flow flush 0", "testpmd> ", 15)
- self.dut.send_expect("clear port stats all", "testpmd> ", 15)
- self.dut.send_expect("quit", "#", 15)
- # kill all DPDK application
- self.dut.kill_all()
- # destroy vfs
- for port_id in self.dut_ports:
- self.dut.destroy_sriov_vfs_by_port(port_id)
- self.testpmd_status = "close"
+ # destroy all flow rules on DCF
+ self.dut.send_expect("quit", "# ")
+ # kill all DPDK application
+ self.dut.kill_all()
+ # destroy vfs
+ for port_id in self.dut_ports:
+ self.dut.destroy_sriov_vfs_by_port(port_id)
+
if getattr(self, "session_secondary", None):
self.dut.close_session(self.session_secondary)