test suite reviews and discussions
 help / color / mirror / Atom feed
From: Xinfeng Zhao <xinfengx.zhao@intel.com>
To: dts@dpdk.org
Cc: Xinfeng Zhao <xinfengx.zhao@intel.com>
Subject: [dts] [PATCH V1] framework/tester: disable tester ports LLDP
Date: Tue, 10 Dec 2019 07:37:17 +0800	[thread overview]
Message-ID: <1575934637-332743-1-git-send-email-xinfengx.zhao@intel.com> (raw)

Signed-off-by: Xinfeng Zhao <xinfengx.zhao@intel.com>
---
 framework/tester.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/framework/tester.py b/framework/tester.py
index d7e74d4..8585a11 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -174,6 +174,27 @@ class Tester(Crb):
         self.restore_interfaces()
         self.scan_ports()
 
+        self.disable_lldp()
+
+    def disable_lldp(self):
+        """
+        Disable tester ports LLDP.
+        """
+        self.logger.info("Disable tester ports LLDP")
+        result = self.send_expect("lldpad -d",  "# ")
+        if result:
+            self.logger.error(result.strip())
+
+        for port in self.ports_info:
+            eth = port["intf"]
+            out = self.send_expect("ethtool --show-priv-flags %s"
+                    % eth, "# ", alt_session=True)
+            if "disable-fw-lldp" in out:
+                self.send_expect("ethtool --set-priv-flags %s disable-fw-lldp on"
+                        % eth, "# ", alt_session=True)
+            self.send_expect("lldptool set-lldp -i %s adminStatus=disabled"
+                    % eth, "# ", alt_session=True)
+
     def get_local_port(self, remotePort):
         """
         Return tester local port connect to specified dut port.
-- 
2.17.1


                 reply	other threads:[~2019-12-10  8:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1575934637-332743-1-git-send-email-xinfengx.zhao@intel.com \
    --to=xinfengx.zhao@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).