[dts] [PATCH V1] tests/kni:set kni virtual interface carrier up automatically

zhuwenhui wenhuix.zhu at intel.com
Fri Nov 2 07:15:44 CET 2018


kni interface carrier status is "off"by default, which is equivalent of cable not plugged in in physical device,so start kni sample application with -m parameter, set kni virtual interface carrier up automatically

Signed-off-by: zhuwenhui <wenhuix.zhu at intel.com>
---
 tests/TestSuite_kni.py | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py
index 5f81def..7655266 100644
--- a/tests/TestSuite_kni.py
+++ b/tests/TestSuite_kni.py
@@ -277,7 +277,7 @@ class TestKni(TestCase):
         """
         pass
 
-    def start_kni(self, lo_mode=None, kthread_mode=None):
+    def start_kni(self, lo_mode=None, kthread_mode=None, status=True):
         """
         Insert the igb_uio and rte_kni modules with passed parameters and launch
         kni application.
@@ -306,11 +306,17 @@ class TestKni(TestCase):
             self.config['rx_cores'] + self.config['tx_cores'] + self.config['kernel_cores'])
 
         config_param = self.build_config_param()
-
-        out_kni = self.dut.send_expect(
-            './examples/kni/build/app/kni -c %s -n %d -- -P -p %s %s &' %
-            (core_mask, self.dut.get_memory_channels(), port_mask, config_param),
-            "Link Up", 20)
+          
+        if status is not True:  
+            out_kni = self.dut.send_expect(
+                './examples/kni/build/app/kni -c %s -n %d -- -P -p %s %s -m &' %
+                (core_mask, self.dut.get_memory_channels(), port_mask, config_param),
+                "Link Up", 20)
+        else:
+            out_kni = self.dut.send_expect(
+                './examples/kni/build/app/kni -c %s -n %d -- -P -p %s %s &' %
+                (core_mask, self.dut.get_memory_channels(), port_mask, config_param),
+                "Link Up", 20)
 
         time.sleep(5)
         if kthread_mode == 'single':
@@ -525,7 +531,7 @@ class TestKni(TestCase):
         # Ports and cores configuration set in set_up_all function
         # Setup IP address on virtual interfaces and tester ports
         self.dut.kill_all()
-        self.start_kni()
+        self.start_kni(status=False)
         for port in self.config['ports']:
             virtual_interface = self.virtual_interface_name(port)
 
-- 
2.17.2



More information about the dts mailing list