test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/link_status_interrupt: add link-down-on-close status check and close it
@ 2021-09-24  1:43 Jiale Song
  2021-09-29  3:44 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Jiale Song @ 2021-09-24  1:43 UTC (permalink / raw)
  To: dts; +Cc: Jiale Song

since the link-down-on-close of the tester is turned on, but 
not closed, the subsequent tests are affected

Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
 tests/TestSuite_link_status_interrupt.py | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 tests/TestSuite_link_status_interrupt.py

diff --git a/tests/TestSuite_link_status_interrupt.py b/tests/TestSuite_link_status_interrupt.py
old mode 100644
new mode 100755
index 2e8c282..5590d94
--- 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):
         """
@@ -193,4 +209,6 @@ class TestLinkStatusInterrupt(TestCase):
         """
         Run after each test suite.
         """
-        pass
+        if self.dut.get_os_type() != 'freebsd':
+            for intf in self.intfs:
+                self.tester.send_expect("ethtool --set-priv-flags %s %s off" % (intf, self.flag), "#", 10)
-- 
2.17.1


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

* Re: [dts] [PATCH V1] tests/link_status_interrupt: add link-down-on-close status check and close it
  2021-09-24  1:43 [dts] [PATCH V1] tests/link_status_interrupt: add link-down-on-close status check and close it Jiale Song
@ 2021-09-29  3:44 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2021-09-29  3:44 UTC (permalink / raw)
  To: Jiale, SongX, dts; +Cc: Jiale, SongX

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Jiale Song
> Sent: 2021年9月24日 9:43
> To: dts@dpdk.org
> Cc: Jiale, SongX <songx.jiale@intel.com>
> Subject: [dts] [PATCH V1] tests/link_status_interrupt: add link-down-on-close
> status check and close it
> 
> since the link-down-on-close of the tester is turned on, but not closed, the
> subsequent tests are affected
> 
> Signed-off-by: Jiale Song <songx.jiale@intel.com>

Applied

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

end of thread, other threads:[~2021-09-29  3:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24  1:43 [dts] [PATCH V1] tests/link_status_interrupt: add link-down-on-close status check and close it Jiale Song
2021-09-29  3:44 ` Tu, Lijuan

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ http://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git