[dts] [PATCH V1] tests/TestSuite_link_flowctrl:add set_up
Chen Linglix
linglix.chen at intel.com
Tue Sep 29 10:27:49 CEST 2020
add set_up,tear_down:Avoid the influence between cases
Signed-off-by: Chen Linglix <linglix.chen at intel.com>
---
tests/TestSuite_link_flowctrl.py | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
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
--
2.17.1
More information about the dts
mailing list