test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1]link_status_interrupt: setup link-down-on-close on tester for this suite
@ 2020-04-17  2:20 Xiao Qimai
  2020-04-17  3:04 ` Zhao, XinfengX
  0 siblings, 1 reply; 2+ messages in thread
From: Xiao Qimai @ 2020-04-17  2:20 UTC (permalink / raw)
  To: dts; +Cc: Xiao Qimai

*. set up link-down-on-close on tester side to support this suite 

Signed-off-by: Xiao Qimai <qimaix.xiao@intel.com>
---
 tests/TestSuite_link_status_interrupt.py | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_link_status_interrupt.py b/tests/TestSuite_link_status_interrupt.py
index 3208d71..097bb8e 100644
--- a/tests/TestSuite_link_status_interrupt.py
+++ b/tests/TestSuite_link_status_interrupt.py
@@ -70,6 +70,22 @@ class TestLinkStatusInterrupt(TestCase):
             self.basic_intr_mode = ["msix", "legacy"]
         if self.drivername == "vfio-pci":
             self.basic_intr_mode.append("msi")
+        self.intfs = [self.tester.get_interface(self.tester.get_local_port(i)) for i in self.dut_ports]
+        # check link-down-on-close flag
+        self.flag = "link-down-on-close"
+        for intf in self.intfs:
+            check_flag = "ethtool --show-priv-flags %s" % intf
+            set_flag = "ethtool --set-priv-flags %s %s on" % (intf, self.flag)
+            out = self.tester.send_expect(check_flag, "#")
+            p = re.compile('%s\s+:\s+(\w+)' % self.flag)
+            res = re.search(p, out).group(1)
+            if res == "off":
+                self.tester.send_expect(set_flag, "#")
+                time.sleep(0.5)
+                out = self.tester.send_expect(check_flag, "#")
+                self.verify(re.search(p, out).group(1) == "on", "set %s %s on failed" % (intf, self.flag))
+            elif not res:
+                self.logger.info("NIC %s might not support this case" % intf)
 
     def set_link_status_and_verify(self, dutPort, status):
         """
@@ -93,7 +109,6 @@ class TestLinkStatusInterrupt(TestCase):
         """
         Verify Link status change  
         """
-
         if self.drivername == "igb_uio":
             cmdline = self.path + " -c %s -n %s -- -p %s " % (
                 self.coremask, self.dut.get_memory_channels(), self.portmask)
@@ -191,4 +206,5 @@ class TestLinkStatusInterrupt(TestCase):
         """
         Run after each test suite.
         """
-        pass
+        for i in self.intfs:
+            self.tester.send_expect("ethtool --set-priv-flags %s %s off" % (i, self.flag), "#")
-- 
1.8.3.1


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

* Re: [dts] [PATCH V1]link_status_interrupt: setup link-down-on-close on tester for this suite
  2020-04-17  2:20 [dts] [PATCH V1]link_status_interrupt: setup link-down-on-close on tester for this suite Xiao Qimai
@ 2020-04-17  3:04 ` Zhao, XinfengX
  0 siblings, 0 replies; 2+ messages in thread
From: Zhao, XinfengX @ 2020-04-17  3:04 UTC (permalink / raw)
  To: dts; +Cc: Xiao, QimaiX

Please re-validate your patch with  ixgbe card

-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xiao Qimai
Sent: Friday, April 17, 2020 10:21 AM
To: dts@dpdk.org
Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
Subject: [dts] [PATCH V1]link_status_interrupt: setup link-down-on-close on tester for this suite

*. set up link-down-on-close on tester side to support this suite 

Signed-off-by: Xiao Qimai <qimaix.xiao@intel.com>
---
 tests/TestSuite_link_status_interrupt.py | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_link_status_interrupt.py b/tests/TestSuite_link_status_interrupt.py
index 3208d71..097bb8e 100644
--- a/tests/TestSuite_link_status_interrupt.py
+++ b/tests/TestSuite_link_status_interrupt.py
@@ -70,6 +70,22 @@ class TestLinkStatusInterrupt(TestCase):
             self.basic_intr_mode = ["msix", "legacy"]
         if self.drivername == "vfio-pci":
             self.basic_intr_mode.append("msi")
+        self.intfs = [self.tester.get_interface(self.tester.get_local_port(i)) for i in self.dut_ports]
+        # check link-down-on-close flag
+        self.flag = "link-down-on-close"
+        for intf in self.intfs:
+            check_flag = "ethtool --show-priv-flags %s" % intf
+            set_flag = "ethtool --set-priv-flags %s %s on" % (intf, self.flag)
+            out = self.tester.send_expect(check_flag, "#")
+            p = re.compile('%s\s+:\s+(\w+)' % self.flag)
+            res = re.search(p, out).group(1)
+            if res == "off":
+                self.tester.send_expect(set_flag, "#")
+                time.sleep(0.5)
+                out = self.tester.send_expect(check_flag, "#")
+                self.verify(re.search(p, out).group(1) == "on", "set %s %s on failed" % (intf, self.flag))
+            elif not res:
+                self.logger.info("NIC %s might not support this case" % 
+ intf)
 
     def set_link_status_and_verify(self, dutPort, status):
         """
@@ -93,7 +109,6 @@ class TestLinkStatusInterrupt(TestCase):
         """
         Verify Link status change  
         """
-
         if self.drivername == "igb_uio":
             cmdline = self.path + " -c %s -n %s -- -p %s " % (
                 self.coremask, self.dut.get_memory_channels(), self.portmask) @@ -191,4 +206,5 @@ class TestLinkStatusInterrupt(TestCase):
         """
         Run after each test suite.
         """
-        pass
+        for i in self.intfs:
+            self.tester.send_expect("ethtool --set-priv-flags %s %s 
+ off" % (i, self.flag), "#")
--
1.8.3.1


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

end of thread, other threads:[~2020-04-17  3:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17  2:20 [dts] [PATCH V1]link_status_interrupt: setup link-down-on-close on tester for this suite Xiao Qimai
2020-04-17  3:04 ` Zhao, XinfengX

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).