From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B7FC5A04A6; Wed, 19 Jan 2022 13:05:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77F6741147; Wed, 19 Jan 2022 13:05:56 +0100 (CET) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by mails.dpdk.org (Postfix) with ESMTP id 5A75F4013F for ; Wed, 19 Jan 2022 13:05:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 9B8A41376FB; Wed, 19 Jan 2022 13:05:54 +0100 (CET) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iEeWbBTnwPR1; Wed, 19 Jan 2022 13:05:52 +0100 (CET) Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 080171376FA; Wed, 19 Jan 2022 13:05:51 +0100 (CET) From: =?UTF-8?q?Juraj=20Linke=C5=A1?= To: lijuan.tu@intel.com, ohilyard@iol.unh.edu, junx.dong@intel.com Cc: dts@dpdk.org, =?UTF-8?q?Juraj=20Linke=C5=A1?= Subject: [PATCH v2] framework/dut: fix pylama errors Date: Wed, 19 Jan 2022 13:05:51 +0100 Message-Id: <1642593951-10980-1-git-send-email-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1638792877-2000-1-git-send-email-juraj.linkes@pantheon.tech> References: <1638792877-2000-1-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Pylama found the following errors: framework/dut.py:273: [E] E0602 Undefined variable 'threading' [pylint] framework/dut.py:591: [E] E1101 Instance of 'Dut' has no 'get_def_rte_config' member [pylint] - move the method from child class framework/dut.py:631: [E] E0602 Undefined variable 'crbs' [pylint] framework/dut.py:840: [E] E0602 Undefined variable 'ResultTable' [pylint] framework/dut.py:846: [E] E0602 Undefined variable 'ResultTable' [pylint] framework/dut.py:929: [E] E0602 Undefined variable 'pci_bus' [pylint] framework/dut.py:1173: [E] E0602 Undefined variable 'VMCORELIST' [pylint] - remove unused method Signed-off-by: Juraj Linkeš --- Lijuan, please add additional people to review if needed. --- framework/dut.py | 23 ++++++++++++++++++----- framework/project_dpdk.py | 13 ------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/framework/dut.py b/framework/dut.py index dc3fc874..16566a9c 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -31,6 +31,7 @@ import os import re +import threading import time from uuid import uuid4 @@ -41,6 +42,7 @@ from .config import AppNameConf, PortConf from .crb import Crb from .settings import LOG_NAME_SEP, NICS from .ssh_connection import SSHConnection +from .test_result import ResultTable from .utils import RED, remove_old_rsa_key from .virt_resource import VirtResource @@ -540,6 +542,19 @@ class Dut(Crb): except AttributeError: self.logger.error("%s is not implemented" % function_name) + def get_def_rte_config(self, config): + """ + Get RTE configuration from config/defconfig_*. + """ + out = self.send_expect("cat config/defconfig_%s | sed '/^#/d' | sed '/^\s*$/d'" + % self.target, "# ") + + def_rte_config = re.findall(config+'=(\S+)', out) + if def_rte_config: + return def_rte_config[0] + else: + return None + def setup_memory_linux(self, hugepages=-1): """ Setup Linux hugepages. @@ -628,7 +643,7 @@ class Dut(Crb): if pci_bus == port_info['pci']: port = port_info['port'] break - if port and port.get_ipv4_addr() == crbs['IP'].strip(): + if port and port.get_ipv4_addr() == self.get_ip_address().strip(): return True else: return False @@ -926,7 +941,8 @@ class Dut(Crb): port = port_info['port'] intf = port.get_interface_name() if "No such file" in intf: - self.logger.info("DUT: [%s] %s" % (pci_bus, unknow_interface)) + self.logger.info("DUT: [%s] %s" % (port_info['pci'], + unknow_interface)) continue self.send_expect("ifconfig %s up" % intf, "# ") time.sleep(5) @@ -1169,9 +1185,6 @@ class Dut(Crb): for port_id in range(len(self.ports_info)): self.destroy_sriov_vfs_by_port(port_id) - def get_vm_core_list(self): - return VMCORELIST[self.crb['VM CoreList']] - def load_portconf(self): """ Load port configurations for ports_info. If manually configured info diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index 9927bcc1..bc60f1ad 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -649,19 +649,6 @@ class DPDKdut(Dut): # No blocklist option in FreeBSD return blocklist - def get_def_rte_config(self, config): - """ - Get RTE configuration from config/defconfig_*. - """ - out = self.send_expect("cat config/defconfig_%s | sed '/^#/d' | sed '/^\s*$/d'" - % self.target, "# ") - - def_rte_config = re.findall(config+'=(\S+)', out) - if def_rte_config: - return def_rte_config[0] - else: - return None - def set_driver_specific_configurations(self, drivername): """ Set configurations required for specific drivers before compilation. -- 2.20.1