test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/kni:set kni virtual interface carrier up automatically
@ 2018-11-02  6:15 zhuwenhui
  2018-11-05  2:06 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: zhuwenhui @ 2018-11-02  6:15 UTC (permalink / raw)
  To: dts; +Cc: zhuwenhui

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@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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-05  2:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-02  6:15 [dts] [PATCH V1] tests/kni:set kni virtual interface carrier up automatically zhuwenhui
2018-11-05  2:06 ` Tu, Lijuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).