[dts] [patch V1] fix retrieve_eeprom in userspace_tools test suite

xu,huilong huilongx.xu at intel.com
Mon Jan 9 09:47:12 CET 2017


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 <huilongx.xu at intel.com>
---
 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)
-- 
1.9.3



More information about the dts mailing list