[dts] [PATCH] bug fix: fix issue when DTS run on Fedora21 and freebsd

Zhang, XiaonanX xiaonanx.zhang at intel.com
Sat Feb 28 04:22:08 CET 2015


Acked-by: Xiaonan Zhang <xiaonanx.zhang at intel.com>
- Tested OS: FC21
- Kernel: 3.17.1-302.fc21.x86_64
- GCC: gcc version 4.9.1 20140930 (Red Hat 4.9.1-11) (GCC)
- CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
- NIC: Intel Corporation Ethernet Controller X710 for 10GbE SFP+
- Default x86_64-native-linuxapp-gcc configuration

-----Original Message-----
From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of Yong Liu
Sent: Friday, February 27, 2015 3:09 PM
To: dts at dpdk.org
Subject: [dts] [PATCH] bug fix: fix issue when DTS run on Fedora21 and freebsd

Some nic like FVL have more than only one interface on Fedora21, DTS will take
the first one as functional one. Not all OS has alias "ll" available, use "ls"
in replace of it.

Signed-off-by: Marvinliu <yong.liu at intel.com>

diff --git a/framework/crb.py b/framework/crb.py
index 28df2f9..a699bfc 100644
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -191,7 +191,12 @@ class Crb(object):
         Get interface name of specified pci device on linux.
         """
         command = 'ls --color=never /sys/bus/pci/devices/0000:%s:%s/net' % (bus_id, devfun_id)
-        return self.send_expect(command, '# ')
+        out = self.send_expect(command, '# ', verify=True)
+        if out == -1:
+            name = ""
+        else:
+            name = out.split()[0]
+        return name
 
     def get_interface_name_freebsd(self, bus_id, devfun_id):
         """
diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index a6ac218..bc6ccca 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -202,7 +202,7 @@ class DPDKdut(Dut):
             # ToDo: make this configurable
             dst_dir = "/tmp/"
 
-            out = self.send_expect("ll %s && cd %s" % (dst_dir, p_dir),
+            out = self.send_expect("ls %s && cd %s" % (dst_dir, p_dir),
                                    "#", verify=True)
             if out == -1:
                 raise ValueError("Directiry %s or %s does not exist,"
-- 
1.9.3



More information about the dts mailing list