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 E3FA9F610 for ; Wed, 11 Jan 2017 09:59:24 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP; 11 Jan 2017 00:59:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,345,1477983600"; d="scan'208";a="51937825" Received: from stv-crb-56.sh.intel.com (HELO [10.239.128.116]) ([10.239.128.116]) by fmsmga005.fm.intel.com with ESMTP; 11 Jan 2017 00:59:23 -0800 Message-ID: <5875F2E9.5070702@intel.com> Date: Wed, 11 Jan 2017 16:55:05 +0800 From: "Liu, Yong" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "xu,huilong" , dts@dpdk.org References: <1483951632-34291-1-git-send-email-huilongx.xu@intel.com> In-Reply-To: <1483951632-34291-1-git-send-email-huilongx.xu@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dts] [patch V1] fix retrieve_eeprom in userspace_tools test 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: , X-List-Received-Date: Wed, 11 Jan 2017 08:59:25 -0000 Huilong, strip eeprom image is required before compare md5. Please check with mo, yufen. On 01/09/2017 04:47 PM, xu,huilong wrote: > change list: > 1. remove resize_linux_eeprom_file function, because this function used python file model, the file should in tester machine > but the eeprom file on dut machine. so this function can't work. > 2. remove check eeprom file size, because we check the md5 value is same or not with userspace app dump eeprom and linux ethtool dumo eeprom > if the size not same, the md5 value not same. > > Signed-off-by: xu,huilong > --- > tests/TestSuite_userspace_ethtool.py | 17 ----------------- > 1 file changed, 17 deletions(-) > > diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py > index ced7e96..439ac8a 100644 > --- a/tests/TestSuite_userspace_ethtool.py > +++ b/tests/TestSuite_userspace_ethtool.py > @@ -128,22 +128,6 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): > else: > return 1518 > > - def resize_linux_eeprom_file(self, dpdk_eeprom_file, linux_eeprom_file): > - basePath = os.sep + "root" + self.dut.base_dir[1:] + os.sep > - with open( basePath + os.sep + dpdk_eeprom_file, 'rb') as fpDpdk: > - dpdk_bytes = fpDpdk.read() > - dpdk_length = len(dpdk_bytes) > - > - with open( basePath + linux_eeprom_file, 'rb') as fplinux: > - linux_bytes = fplinux.read() > - linux_length = len(linux_bytes) > - > - self.verify(dpdk_length <= linux_length, > - "linux ethtool haven't dump out enough data as dpdk ethtool") > - > - with open( basePath + linux_eeprom_file, 'wb') as fplinux: > - fplinux.write(linux_bytes[:dpdk_length]) > - > def strip_md5(self, filename): > md5_info = self.dut.send_expect("md5sum %s" % filename, "# ") > md5_pattern = r"(\w+) (\w+)" > @@ -294,7 +278,6 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator): > > for index in range(len(self.ports)): > md5 = self.strip_md5(portsinfo[index]['eeprom_file']) > - self.resize_linux_eeprom_file( portsinfo[index]['eeprom_file'], portsinfo[index]['ethtool_eeprom']) > md5_ref = self.strip_md5(portsinfo[index]['ethtool_eeprom']) > print utils.GREEN("Reference eeprom md5 %s" % md5) > print utils.GREEN("Reference eeprom md5_ref %s" % md5_ref)