test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
To: junx.dong@intel.com, lijuan.tu@intel.com, ohilyard@iol.unh.edu
Cc: dts@dpdk.org, "Juraj Linkeš" <juraj.linkes@pantheon.tech>
Subject: [PATCH v1 1/2] framework/crb: fix pylama errors
Date: Wed, 19 Jan 2022 14:40:54 +0100	[thread overview]
Message-ID: <1642599655-11727-2-git-send-email-juraj.linkes@pantheon.tech> (raw)
In-Reply-To: <1642599655-11727-1-git-send-email-juraj.linkes@pantheon.tech>

Pylama found the following errors:
framework/crb.py:68: [E] E1101 Instance of 'Crb' has no 'get_ip_address' member [pylint]
framework/crb.py:69: [E] E1101 Instance of 'Crb' has no 'get_username' member [pylint]
framework/crb.py:70: [E] E1101 Instance of 'Crb' has no 'get_password' member [pylint]
framework/crb.py:74: [E] E1101 Instance of 'Crb' has no 'get_ip_address' member [pylint]
framework/crb.py:76: [E] E1101 Instance of 'Crb' has no 'get_username' member [pylint]
framework/crb.py:77: [E] E1101 Instance of 'Crb' has no 'get_password' member [pylint]
framework/crb.py:109: [E] E1101 Instance of 'Crb' has no 'get_ip_address' member [pylint]
framework/crb.py:111: [E] E1101 Instance of 'Crb' has no 'get_username' member [pylint]
framework/crb.py:112: [E] E1101 Instance of 'Crb' has no 'get_password' member [pylint]
framework/crb.py:140: [E] E1101 Instance of 'Crb' has no 'loggger' member; maybe 'logger'? [pylint]
framework/crb.py:144: [E] E1101 Instance of 'Crb' has no 'get_ip_address' member [pylint]
framework/crb.py:146: [E] E1101 Instance of 'Crb' has no 'get_username' member [pylint]
framework/crb.py:147: [E] E1101 Instance of 'Crb' has no 'get_password' member [pylint]
framework/crb.py:150: [E] E1101 Instance of 'Crb' has no 'get_ip_address' member [pylint]
framework/crb.py:151: [E] E1101 Instance of 'Crb' has no 'get_username' member [pylint]
framework/crb.py:151: [E] E1101 Instance of 'Crb' has no 'get_password' member [pylint]
framework/crb.py:254: [E] E1136 Value 'self.ports_info' is unsubscriptable [pylint]
framework/crb.py:270: [E] E1101 Instance of 'Crb' has no 'PCI_DEV_CACHE_KEY' member [pylint]
framework/crb.py:274: [E] E1101 Instance of 'Crb' has no 'PCI_DEV_CACHE_KEY' member [pylint]
framework/crb.py:391: [E] E1120 No value for argument 'string' in function call [pylint]
framework/crb.py:478: [E] E1101 Instance of 'Crb' has no 'get_password' member [pylint]
framework/crb.py:560: [E] E0203 Access to member 'prefix_list' before its definition line 564 [pylint]
framework/crb.py:562: [E] E0203 Access to member 'prefix_list' before its definition line 564 [pylint]
framework/crb.py:606: [E] E1101 Instance of 'Crb' has no 'NUMBER_CORES_CACHE_KEY' member [pylint]
framework/crb.py:607: [E] E1101 Instance of 'Crb' has no 'CORE_LIST_CACHE_KEY' member [pylint]
framework/crb.py:611: [E] E1101 Instance of 'Crb' has no 'NUMBER_CORES_CACHE_KEY' member [pylint]
framework/crb.py:612: [E] E1101 Instance of 'Crb' has no 'CORE_LIST_CACHE_KEY' member [pylint]
framework/crb.py:880: [E] E1133 Non-iterable value self.ports_info is used in an iterating context [pylint]
framework/crb.py:888: [E] E1136 Value 'self.ports_info' is unsubscriptable [pylint]

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 framework/crb.py      | 29 ++++++++++++++++++++++++++---
 framework/dut.py      |  2 --
 framework/virt_dut.py |  2 --
 3 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/framework/crb.py b/framework/crb.py
index bd4f565d..0f22c5d3 100755
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -51,18 +51,23 @@ class Crb(object):
     CPU/PCI/NIC on the board and setup running environment for DPDK.
     """
 
+    PCI_DEV_CACHE_KEY = None
+    NUMBER_CORES_CACHE_KEY = None
+    CORE_LIST_CACHE_KEY = None
+
     def __init__(self, crb, serializer, name, alt_session=True, dut_id=0):
         self.dut_id = dut_id
         self.crb = crb
         self.read_cache = False
         self.skip_setup = False
         self.serializer = serializer
-        self.ports_info = None
+        self.ports_info = []
         self.sessions = []
         self.stage = 'pre-init'
         self.name = name
         self.trex_prefix = None
         self.default_hugepages_cleared = False
+        self.prefix_list = []
 
         self.logger = getLogger(name)
         self.session = SSHConnection(self.get_ip_address(), name,
@@ -80,6 +85,24 @@ class Crb(object):
         else:
             self.alt_session = None
 
+    def get_ip_address(self):
+        """
+        Get CRB's ip address.
+        """
+        raise NotImplementedError
+
+    def get_password(self):
+        """
+        Get CRB's login password.
+        """
+        raise NotImplementedError
+
+    def get_username(self):
+        """
+        Get CRB's login username.
+        """
+        raise NotImplementedError
+
     def send_expect(self, cmds, expected, timeout=TIMEOUT,
                     alt_session=False, verify=False, trim_whitespace=True):
         """
@@ -137,7 +160,7 @@ class Crb(object):
             else:
                 self.session.close(force=True)
         except Exception as e:
-            self.loggger.error("Session close failed for [%s]" % e)
+            self.logger.error("Session close failed for [%s]" % e)
 
         if alt_session:
             session = SSHConnection(
@@ -388,7 +411,7 @@ class Crb(object):
                                (domain_id, bus_id, devfun_id), "# ", alt_session=True)
         rexp = r"PCI_ID=(.+)"
         pattern = re.compile(rexp)
-        match = re.search(out)
+        match = re.search(pattern, out)
         if not match:
             return None
         return match.group(1)
diff --git a/framework/dut.py b/framework/dut.py
index dc3fc874..45db4616 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -71,14 +71,12 @@ class Dut(Crb):
         self.tester = None
         self.cores = []
         self.architecture = None
-        self.ports_info = []
         self.conf = PortConf()
         self.ports_map = []
         self.virt_pool = None
         # hypervisor pid list, used for cleanup
         self.virt_pids = []
         self.prefix_subfix = str(os.getpid()) + '_' + time.strftime("%Y%m%d%H%M%S", time.localtime())
-        self.prefix_list = []
         self.hugepage_path = None
         self.apps_name_conf = {}
         self.apps_name = {}
diff --git a/framework/virt_dut.py b/framework/virt_dut.py
index bde65667..ca8c8c6b 100644
--- a/framework/virt_dut.py
+++ b/framework/virt_dut.py
@@ -78,11 +78,9 @@ class VirtDut(DPDKdut):
         self.tester = None
         self.cores = []
         self.architecture = None
-        self.ports_info = None
         self.ports_map = []
         self.virttype = virttype
         self.prefix_subfix = str(os.getpid()) + '_' + time.strftime("%Y%m%d%H%M%S", time.localtime())
-        self.prefix_list = []
         self.apps_name_conf = {}
         self.apps_name = {}
 
-- 
2.20.1


  reply	other threads:[~2022-01-19 13:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 13:40 [PATCH v1 0/2] fix pylama framework errors in crb and virt Juraj Linkeš
2022-01-19 13:40 ` Juraj Linkeš [this message]
2022-01-25  5:41   ` [PATCH v1 1/2] framework/crb: fix pylama errors Dong, JunX
2022-01-19 13:40 ` [PATCH v1 2/2] framework/virt_*: " Juraj Linkeš
2022-01-25  5:42   ` Dong, JunX
2022-01-25  6:18     ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1642599655-11727-2-git-send-email-juraj.linkes@pantheon.tech \
    --to=juraj.linkes@pantheon.tech \
    --cc=dts@dpdk.org \
    --cc=junx.dong@intel.com \
    --cc=lijuan.tu@intel.com \
    --cc=ohilyard@iol.unh.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).