[V1] tests/TestSuite_link_flowctrl:add set_up

Message ID 20200929082749.15332-1-linglix.chen@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] tests/TestSuite_link_flowctrl:add set_up |

Commit Message

Lingli Chen Sept. 29, 2020, 8:27 a.m. UTC
  add set_up,tear_down:Avoid the influence between cases

Signed-off-by: Chen Linglix <linglix.chen@intel.com>
---
 tests/TestSuite_link_flowctrl.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
  

Comments

Lingli Chen Sept. 29, 2020, 8:47 a.m. UTC | #1
Tested-by:  Chen, LingliX <linglix.chen@intel.com>

Regards,
Chen, LingliX

> -----Original Message-----
> From: Chen, LingliX
> Sent: Tuesday, September 29, 2020 4:28 PM
> To: dts@dpdk.org
> Cc: Chen, LingliX <linglix.chen@intel.com>
> Subject: [dts][PATCH V1] tests/TestSuite_link_flowctrl:add set_up
  
Tu, Lijuan Oct. 13, 2020, 2:15 a.m. UTC | #2
> add set_up,tear_down:Avoid the influence between cases
> 
> Signed-off-by: Chen Linglix <linglix.chen@intel.com>

Applied
  

Patch

diff --git a/tests/TestSuite_link_flowctrl.py b/tests/TestSuite_link_flowctrl.py
index 9e608bab..326f8b98 100644
--- a/tests/TestSuite_link_flowctrl.py
+++ b/tests/TestSuite_link_flowctrl.py
@@ -76,8 +76,6 @@  class TestLinkFlowctrl(TestCase):
 
         self.portMask = utils.create_mask([self.rx_port, self.tx_port])
 
-        self.pmdout = PmdOutput(self.dut)
-        self.pmdout.start_testpmd("all", "--portmask=%s" % self.portMask)
         # get dts output path
         if self.logger.log_path.startswith(os.sep):
             self.output_path = self.logger.log_path
@@ -88,6 +86,10 @@  class TestLinkFlowctrl(TestCase):
         # create an instance to set stream field setting
         self.pktgen_helper = PacketGeneratorHelper()
 
+    def set_up(self):
+        self.pmdout = PmdOutput(self.dut)
+        self.pmdout.start_testpmd("all", "--portmask=%s" % self.portMask)
+
     def get_tgen_input(self):
         """
         create streams for ports.
@@ -563,9 +565,15 @@  class TestLinkFlowctrl(TestCase):
                         "Link flow control fail, the loss percent is less than 50%")
         self.dut.send_expect("stop", "testpmd> ")
 
-    def tear_down_all(self):
+    def tear_down(self):
         """
         Run after each test case.
         """
-        self.dut.kill_all()
         self.dut.send_expect("quit", "# ")
+        self.dut.kill_all()
+    
+    def tear_down_all(self):
+        """
+        Run after each test suite.
+        """
+        pass