test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/pmd_bonded: modify script to supoort ice nic
@ 2023-02-01 14:21 Song Jiale
  0 siblings, 0 replies; only message in thread
From: Song Jiale @ 2023-02-01 14:21 UTC (permalink / raw)
  To: dts; +Cc: Song Jiale

if the link status of the port of the ice nic needs to be
synchronized with the peer, the peer also needs to open "link down on
close".

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
 tests/TestSuite_pmd_bonded.py | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/tests/TestSuite_pmd_bonded.py b/tests/TestSuite_pmd_bonded.py
index 97f76e93..7a5deaf7 100644
--- a/tests/TestSuite_pmd_bonded.py
+++ b/tests/TestSuite_pmd_bonded.py
@@ -885,14 +885,18 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)'
         self.pmdout = PmdOutput(self.dut)
 
         self.tester_bond = "bond0"
-
+        tester_port0 = self.tester.get_local_port(self.dut_ports[0])
+        self.tport_iface0 = self.tester.get_interface(tester_port0)
+        self.flag = "link-down-on-close"
+        self.default_stats = self.tester.get_priv_flags_state(
+            self.tport_iface0, self.flag
+        )
         for port in self.dut_ports:
             tester_port = self.tester.get_local_port(port)
             intf = self.tester.get_interface(tester_port)
-            driver = self.tester.ports_info[tester_port]["port"].get_nic_driver()
-            if driver == "i40e":
+            if self.default_stats:
                 self.tester.send_expect(
-                    "ethtool --set-priv-flags %s link-down-on-close on" % intf, "# ", 10
+                    "ethtool --set-priv-flags %s %s on" % (intf, self.flag), "# "
                 )
 
     def set_up(self):
@@ -2349,4 +2353,12 @@ UDP(sport=srcport, dport=destport)/Raw(load="\x50"*%s)], iface="%s", count=%d)'
         """
         Run after each test suite.
         """
-        pass
+        self.dut.kill_all()
+        for port in self.dut_ports:
+            tester_port = self.tester.get_local_port(port)
+            tport_iface = self.tester.get_interface(tester_port)
+            self.tester.send_expect(
+                "ethtool --set-priv-flags %s %s %s"
+                % (tport_iface, self.flag, self.default_stats),
+                "# ",
+            )
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-01  6:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 14:21 [dts] [PATCH V1] tests/pmd_bonded: modify script to supoort ice nic Song Jiale

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