From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7F7C0903 for ; Sat, 28 Feb 2015 04:22:14 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 27 Feb 2015 19:22:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,664,1418112000"; d="scan'208";a="460530257" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by FMSMGA003.fm.intel.com with ESMTP; 27 Feb 2015 19:06:31 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sat, 28 Feb 2015 11:22:10 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.161]) by shsmsx102.ccr.corp.intel.com ([169.254.2.62]) with mapi id 14.03.0195.001; Sat, 28 Feb 2015 11:22:09 +0800 From: "Zhang, XiaonanX" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] bug fix: fix issue when DTS run on Fedora21 and freebsd Thread-Index: AQHQUlxuTyCHucnVckWVK9VSsMATvJ0FZESA Date: Sat, 28 Feb 2015 03:22:08 +0000 Message-ID: <63FB47D6C0357E428AA804B2C89068BA012A978B@SHSMSX104.ccr.corp.intel.com> References: <1425020951-29498-1-git-send-email-yong.liu@intel.com> In-Reply-To: <1425020951-29498-1-git-send-email-yong.liu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH] bug fix: fix issue when DTS run on Fedora21 and freebsd 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: Sat, 28 Feb 2015 03:22:15 -0000 Acked-by: Xiaonan Zhang - 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@dpdk.org] On Behalf Of Yong Liu Sent: Friday, February 27, 2015 3:09 PM To: dts@dpdk.org Subject: [dts] [PATCH] bug fix: fix issue when DTS run on Fedora21 and free= bsd Some nic like FVL have more than only one interface on Fedora21, DTS will t= ake the first one as functional one. Not all OS has alias "ll" available, use "= ls" in replace of it. Signed-off-by: Marvinliu 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 =3D 'ls --color=3Dnever /sys/bus/pci/devices/0000:%s:%s/ne= t' % (bus_id, devfun_id) - return self.send_expect(command, '# ') + out =3D self.send_expect(command, '# ', verify=3DTrue) + if out =3D=3D -1: + name =3D "" + else: + name =3D out.split()[0] + return name =20 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 =3D "/tmp/" =20 - out =3D self.send_expect("ll %s && cd %s" % (dst_dir, p_dir), + out =3D self.send_expect("ls %s && cd %s" % (dst_dir, p_dir), "#", verify=3DTrue) if out =3D=3D -1: raise ValueError("Directiry %s or %s does not exist," --=20 1.9.3