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 0D1AB4C95 for ; Thu, 15 Nov 2018 12:15:31 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2018 03:15:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,236,1539673200"; d="scan'208";a="108290674" Received: from dts-maintain.sh.intel.com (HELO [10.67.119.110]) ([10.67.119.110]) by fmsmga001.fm.intel.com with ESMTP; 15 Nov 2018 03:15:30 -0800 To: zhuwenhui , dts@dpdk.org References: <1542004887-38119-1-git-send-email-wenhuix.zhu@intel.com> From: Lijuan Tu Message-ID: Date: Fri, 16 Nov 2018 03:43:22 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1542004887-38119-1-git-send-email-wenhuix.zhu@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [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: Thu, 15 Nov 2018 11:15:32 -0000 Applied with comments changed. On 2018年11月12日 14:41, zhuwenhui wrote: > 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,