[dts] [PATCH V1 3/3] update get_intf_name function

huilong,xu huilongx.xu at intel.com
Fri Jun 5 07:50:18 CEST 2015


From: huilong xu <huilongx.xu at intel.com>

change list:
   1.in linux kernerl 3.13+, i40e kerner driver merger in kernel module.
     the kernerl default driver, one NIC have two intface name,
     so we must get one intface name for test

Signed-off-by: huilong xu <huilongx.xu at intel.com>
---
 framework/net_device.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/framework/net_device.py b/framework/net_device.py
index b8d785e..3b0a8d5 100644
--- a/framework/net_device.py
+++ b/framework/net_device.py
@@ -154,7 +154,10 @@ class NetDevice(object):
         """
         command = 'ls --color=never /sys/bus/pci/devices/0000\:%s\:%s/net' % (
             bus_id, devfun_id)
-        return self.__send_expect(command, '# ')
+        intf_name = self.__send_expect(command, '# ')
+        if " " in intf_name:
+            return intf_name.split(" ")[0]
+        return intf_name
 
     def get_interface_name_freebsd(self, bus_id, devfun_id, driver):
         """
-- 
1.7.4.4



More information about the dts mailing list