[V1,2/2] tests/ice_dcf_switch_filter: remove the method of checking testpmd status

Message ID 20220720171113.902-2-songx.jiale@intel.com (mailing list archive)
State Superseded
Headers
Series [V1,1/2] tests/ice_dcf_switch_filter_gtpu: remove the method of checking testpmd status |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-suite-test success Testing OK

Commit Message

Jiale, SongX July 20, 2022, 5:11 p.m. UTC
  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.py | 44 ++++++++----------------
 1 file changed, 15 insertions(+), 29 deletions(-)
  

Comments

Weiyuan Li Aug. 26, 2022, 6:37 a.m. UTC | #1
> -----Original Message-----
> From: Jiale Song <songx.jiale@intel.com>
> Sent: Thursday, July 21, 2022 1:11 AM
> To: dts@dpdk.org
> Cc: Jiale, SongX <songx.jiale@intel.com>
> Subject: [dts] [PATCH V1 2/2] tests/ice_dcf_switch_filter: remove the
> method of checking testpmd status
> 
> 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>
> ---
Tested-by: Weiyuan Li <weiyuanx.li@intel.com>
  

Patch

diff --git a/tests/TestSuite_ice_dcf_switch_filter.py b/tests/TestSuite_ice_dcf_switch_filter.py
index 3c647be6..c1131c41 100644
--- a/tests/TestSuite_ice_dcf_switch_filter.py
+++ b/tests/TestSuite_ice_dcf_switch_filter.py
@@ -1686,7 +1686,6 @@  class ICEDCFSwitchFilterTest(TestCase):
         self.pf0_intf = self.dut.ports_info[self.used_dut_port_0]["intf"]
         self.__tx_iface = self.tester.get_interface(localPort)
         self.pkt = Packet()
-        self.testpmd_status = "close"
         # bind pf to kernel
         self.bind_nics_driver(self.dut_ports, driver="ice")
         # get priv-flags default stats
@@ -1719,8 +1718,7 @@  class ICEDCFSwitchFilterTest(TestCase):
         time.sleep(5)
 
     def reload_ice(self):
-        self.dut.send_expect("rmmod ice", "# ", 15)
-        self.dut.send_expect("modprobe ice", "# ", 15)
+        self.dut.send_expect("rmmod ice && modprobe ice", "# ", 120)
 
     def set_up(self):
         """
@@ -1748,8 +1746,7 @@  class ICEDCFSwitchFilterTest(TestCase):
         launch testpmd with the command
         """
         command = self.create_testpmd_command()
-        out = self.dut.send_expect(command, "testpmd> ", 15)
-        self.testpmd_status = "running"
+        out = 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)
@@ -2247,7 +2244,6 @@  class ICEDCFSwitchFilterTest(TestCase):
 
         self.dut.send_expect("flow flush 0", "testpmd> ", 300)
         self.dut.send_expect("quit", "#")
-        self.testpmd_status = "close"
         # destroy vfs
         for port_id in self.dut_ports:
             self.dut.destroy_sriov_vfs_by_port(port_id)
@@ -2265,8 +2261,7 @@  class ICEDCFSwitchFilterTest(TestCase):
             port_options={vf0_pci: "cap=dcf"},
         )
         command = self.path + all_eal_param + " -- -i"
-        out = self.dut.send_expect(command, "testpmd> ", 15)
-        self.testpmd_status = "running"
+        out = self.dut.send_expect(command, "testpmd> ", 30)
         self.dut.send_expect("set portlist 1,2", "testpmd> ", 15)
         self.dut.send_expect("set fwd rxonly", "testpmd> ", 15)
         self.dut.send_expect("set verbose 1", "testpmd> ", 15)
@@ -2322,8 +2317,7 @@  class ICEDCFSwitchFilterTest(TestCase):
             port_options={vf0_pci: "cap=dcf"},
         )
         command = self.path + all_eal_param + " -- -i"
-        out = self.dut.send_expect(command, "testpmd> ", 15)
-        self.testpmd_status = "running"
+        out = self.dut.send_expect(command, "testpmd> ", 30)
         self.dut.send_expect("set portlist 1,2", "testpmd> ", 15)
         self.dut.send_expect("set fwd rxonly", "testpmd> ", 15)
         self.dut.send_expect("set verbose 1", "testpmd> ", 15)
@@ -2370,8 +2364,7 @@  class ICEDCFSwitchFilterTest(TestCase):
         self.setup_1pf_vfs_env()
         # launch testpmd
         command = self.create_testpmd_command()
-        out = self.dut.send_expect(command, "testpmd> ", 15)
-        self.testpmd_status = "running"
+        out = self.dut.send_expect(command, "testpmd> ", 30)
         self.dut.send_expect("set portlist 1", "testpmd> ", 15)
         self.dut.send_expect("set fwd mac", "testpmd> ", 15)
         self.dut.send_expect("set verbose 1", "testpmd> ", 15)
@@ -2406,8 +2399,7 @@  class ICEDCFSwitchFilterTest(TestCase):
             port_options={vf0_pci: "cap=dcf"},
         )
         command = self.path + all_eal_param + " -- -i"
-        out = self.dut.send_expect(command, "testpmd> ", 15)
-        self.testpmd_status = "running"
+        out = self.dut.send_expect(command, "testpmd> ", 30)
         self.dut.send_expect("set portlist 1,2", "testpmd> ", 15)
         self.dut.send_expect("set fwd mac", "testpmd> ", 15)
         self.dut.send_expect("set verbose 1", "testpmd> ", 15)
@@ -2472,8 +2464,7 @@  class ICEDCFSwitchFilterTest(TestCase):
             cores="1S/4C/1T", ports=[vf0_pci], port_options={vf0_pci: "cap=dcf"}
         )
         command = self.path + all_eal_param + " -- -i"
-        out = self.dut.send_expect(command, "testpmd> ", 15)
-        self.testpmd_status = "running"
+        out = self.dut.send_expect(command, "testpmd> ", 30)
         # generate max_vf_number-1 rules to each vf and matched packets
         for i in range(1, max_vf_number):
             rte_flow_pattern = (
@@ -2624,8 +2615,7 @@  class ICEDCFSwitchFilterTest(TestCase):
             port_options={vf0_pci: "cap=dcf"},
         )
         command = self.path + all_eal_param + " -- -i"
-        out = self.dut.send_expect(command, "testpmd> ", 15)
-        self.testpmd_status = "running"
+        out = self.dut.send_expect(command, "testpmd> ", 30)
         self.dut.send_expect("set portlist 1,2", "testpmd> ", 15)
         self.dut.send_expect("set fwd rxonly", "testpmd> ", 15)
         self.dut.send_expect("set verbose 1", "testpmd> ", 15)
@@ -2670,17 +2660,13 @@  class ICEDCFSwitchFilterTest(TestCase):
         """
         Run after each test case.
         """
-        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)