[V1] tests/TestSuite_link_flowctrl:add set_up
Commit Message
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
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
> add set_up,tear_down:Avoid the influence between cases
>
> Signed-off-by: Chen Linglix <linglix.chen@intel.com>
Applied
@@ -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