test suite reviews and discussions
 help / color / mirror / Atom feed
From: zhuwenhui <wenhuix.zhu@intel.com>
To: dts@dpdk.org
Cc: zhuwenhui <wenhuix.zhu@intel.com>
Subject: [dts] [PATCH V1] tests/kni:set kni virtual interface carrier up automatically
Date: Fri,  2 Nov 2018 14:15:44 +0800	[thread overview]
Message-ID: <1541139344-21101-1-git-send-email-wenhuix.zhu@intel.com> (raw)

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

             reply	other threads:[~2018-11-02  6:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02  6:15 zhuwenhui [this message]
2018-11-05  2:06 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1541139344-21101-1-git-send-email-wenhuix.zhu@intel.com \
    --to=wenhuix.zhu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).