[dts] [PATCH] tests/unit_tests_eal: unbind all the ports before running

Jianbo Liu jianbo.liu at linaro.org
Thu Nov 16 03:39:42 CET 2017


From: Jianbo Liu <jianbo.liu at arm.com>

Unbinding all the ports to avoid system panic, because there are many cases
running as secondary processes in this tests.

Signed-off-by: Jianbo Liu <jianbo.liu at arm.com>
---
 tests/TestSuite_unit_tests_eal.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_unit_tests_eal.py b/tests/TestSuite_unit_tests_eal.py
index b619572..e513739 100644
--- a/tests/TestSuite_unit_tests_eal.py
+++ b/tests/TestSuite_unit_tests_eal.py
@@ -7,6 +7,7 @@ EAL autotest.
 
 """
 
+import copy
 import utils
 
 
@@ -30,6 +31,11 @@ class TestUnitTestsEal(TestCase):
         """
         Run at the start of each test suite.
         """
+        self.dut_ports = self.dut.get_ports(self.nic)
+        self.unbind_ports = copy.deepcopy(self.dut_ports)
+        if len(self.unbind_ports) > 0:
+            self.dut.unbind_interfaces_linux(self.unbind_ports)
+
         # icc compilation cost long long time.
         [arch, machine, self.env, toolchain] = self.target.split('-')
         self.start_test_time = 60
@@ -397,4 +403,5 @@ class TestUnitTestsEal(TestCase):
         """
         Run after each test suite.
         """
-        pass
+        if len(self.unbind_ports) > 0:
+            self.dut.bind_interfaces_linux(nics_to_bind=self.unbind_ports)
-- 
1.9.1



More information about the dts mailing list