From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 270DE2BF2 for ; Mon, 12 Nov 2018 07:38:28 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Nov 2018 22:38:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,494,1534834800"; d="scan'208";a="107469861" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.176.135]) by orsmga001.jf.intel.com with ESMTP; 11 Nov 2018 22:38:26 -0800 From: zhuwenhui To: dts@dpdk.org Cc: zhuwenhui Date: Mon, 12 Nov 2018 14:41:27 +0800 Message-Id: <1542004887-38119-1-git-send-email-wenhuix.zhu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V2] kni/ethtool add judgment before the -a parameter 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: , X-List-Received-Date: Mon, 12 Nov 2018 06:38:29 -0000 According to whether the kernel supports "ETHTOOL_GLINKSETTINGS & ETHTOOL_SLINKSETTINGS", it is judged whether "ethtool "-a|--show-pause" works normally. Signed-off-by: zhuwenhui --- tests/TestSuite_kni.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py index 23d6d04..91408e4 100644 --- a/tests/TestSuite_kni.py +++ b/tests/TestSuite_kni.py @@ -675,14 +675,19 @@ class TestKni(TestCase): "'ethtool -i' not supported") self.verify("Operation not supported" not in out, "'ethtool -i' not supported") - + # Request pause parameters - out = self.dut.send_expect("ethtool -a %s" % virtual_interface, - "# ") - self.verify("Pause parameters for %s" % virtual_interface in out, - "'ethtool -a' not supported") - self.verify("Operation not supported" not in out, - "ethtool '-a' not supported") + with open("/usr/include/linux/ethtool.h","r") as ethtool_h: + ethtool_contents = ethtool_h.read() + GSET = "ETHTOOL_GLINKSETTINGS" + SSET = "ETHTOOL_SLINKSETTINGS" + if (GSET in ethtool_contents) and (SSET in ethtool_contents): + out = self.dut.send_expect("ethtool -a %s" % virtual_interface, + "# ") + self.verify("Pause parameters for %s" % virtual_interface in out, + "'ethtool -a' not supported") + self.verify("Operation not supported" not in out, + "ethtool '-a' not supported") # Request statistics out = self.dut.send_expect("ethtool -S %s" % virtual_interface, -- 2.17.2