From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6FC17234 for ; Fri, 27 Feb 2015 08:09:46 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 26 Feb 2015 23:09:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,658,1418112000"; d="scan'208";a="684232093" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 26 Feb 2015 23:09:17 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t1R79Fqj024383; Fri, 27 Feb 2015 15:09:15 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t1R79DBu029534; Fri, 27 Feb 2015 15:09:15 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t1R79CmK029530; Fri, 27 Feb 2015 15:09:12 +0800 From: Yong Liu To: dts@dpdk.org Date: Fri, 27 Feb 2015 15:09:11 +0800 Message-Id: <1425020951-29498-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [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: Fri, 27 Feb 2015 07:09:47 -0000 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 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