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 F0BD12C4F for ; Tue, 29 Nov 2016 03:02:17 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 28 Nov 2016 18:02:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,714,1473145200"; d="scan'208";a="10796611" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by orsmga002.jf.intel.com with ESMTP; 28 Nov 2016 18:02:15 -0800 From: "xu,gang" To: dts@dpdk.org Cc: "xu,gang" Date: Tue, 29 Nov 2016 10:03:27 +0800 Message-Id: <1480385007-19394-1-git-send-email-gangx.xu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V2] fix IndexError on 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: Tue, 29 Nov 2016 02:02:18 -0000 restore interface before get interface Signed-off-by: xu,gang --- nics/net_device.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nics/net_device.py b/nics/net_device.py index bbe4bed..0eac48d 100644 --- a/nics/net_device.py +++ b/nics/net_device.py @@ -218,7 +218,11 @@ class NetDevice(object): """ Get the interface name by the default way on freebsd. """ - pci_str = "%s:%s:%s" % (domain_id, bus_id, devfun_id) + pci_str = "%s:%s:%s" % (domain_id, bus_id, devfun_id) + put = self.__send_expect("kldstat", "# ",20) + if "nic_uio.ko" in put: + self.__send_expect("kldunload contigmem.ko", "# ",20) + self.__send_expect("kldunload nic_uio.ko", "# ",20) out = self.__send_expect("pciconf -l", "# ") rexp = r"(\w*)@pci0:%s" % pci_str pattern = re.compile(rexp) -- 1.9.3