[dts] [PATCH V1] Add steps to clean environment

ChenBo box.c.chen at intel.com
Thu May 21 11:31:39 CEST 2020


If the test result is failed, the IP set previously will be reserved, need del IP

Signed-off-by: ChenBo <box.c.chen at intel.com>
---
 tests/TestSuite_kni.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py
index 2b2281d..d518f3e 100644
--- a/tests/TestSuite_kni.py
+++ b/tests/TestSuite_kni.py
@@ -1210,7 +1210,11 @@ class TestKni(TestCase):
         """
         Run after each test case.
         """
-        pass
+        if self._suite_result.test_case == "test_ping":
+            for port in self.config['ports']:
+                tx_port = self.tester.get_local_port(port)
+                tx_interface = self.tester.get_interface(tx_port)
+                self.tester.send_expect("ip addr flush %s" % tx_interface, "# ")
 
     def tear_down_all(self):
         """
-- 
2.17.1



More information about the dts mailing list