From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 66D68A0588; Fri, 17 Apr 2020 04:27:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 328B11DDDF; Fri, 17 Apr 2020 04:27:02 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id BA6A81DDCF for ; Fri, 17 Apr 2020 04:27:00 +0200 (CEST) IronPort-SDR: I6p6aIVnom+i0JeITiOiEz9RZuv3hwH9+QRMAAIx0mO1AcP8rxt18WMROwRqHhLnB6EYcSyWZq faP2Zwall5Kg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2020 19:26:59 -0700 IronPort-SDR: w3olEflXLVwz8ADla0+NxKx95t8pPw96bb9lHdb6OwyReIi6sOGzTkmD36lv+VOFmdexIXLhC+ jbRJeNcnkR6w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,393,1580803200"; d="scan'208";a="364190588" Received: from unknown (HELO dpdk-xiaoqimai-dut.sh.intel.com) ([10.240.183.52]) by fmsmga001.fm.intel.com with ESMTP; 16 Apr 2020 19:26:58 -0700 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Fri, 17 Apr 2020 10:20:33 +0800 Message-Id: <1587090033-272429-1-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V1]link_status_interrupt: setup link-down-on-close on tester for this suite X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" *. set up link-down-on-close on tester side to support this suite Signed-off-by: Xiao Qimai --- 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