test suite reviews and discussions
 help / color / mirror / Atom feed
From: Michael Qiu <michael.qiu@intel.com>
To: dts@dpdk.org
Cc: yong.liu@intel.com
Subject: [dts] [PATCH 1/6] framework/tester: Fix NoneType Error of port_map
Date: Tue, 13 Jan 2015 21:42:15 +0800	[thread overview]
Message-ID: <1421156540-25810-2-git-send-email-michael.qiu@intel.com> (raw)
In-Reply-To: <1421156540-25810-1-git-send-email-michael.qiu@intel.com>

File "./framework/tester.py", line 110, in tester_prerequisites
    assert len(self.ports_map) > 0
TypeError: object of type 'NoneType' has no len()

Currently ports_map is initialized with empty list,
but it could be overridden by 'None' value.

This patch solves this issue

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
 framework/tester.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/framework/tester.py b/framework/tester.py
index 2c023dd..d69503a 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -125,7 +125,8 @@ class Tester(Crb):
         self.restore_interfaces()
         self.scan_ports()
         self.map_available_ports()
-        assert len(self.ports_map) > 0
+        if self.ports_map == None or len(self.ports_map) == 0:
+            raise ValueError("ports_map should not be empty, please check all links")
 
     def get_local_port(self, remotePort):
         """
-- 
1.9.3

  reply	other threads:[~2015-01-13 13:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13 13:42 [dts] [PATCH 0/6] DTS enhancement and clean up Michael Qiu
2015-01-13 13:42 ` Michael Qiu [this message]
2015-01-14  1:15   ` [dts] [PATCH 1/6] framework/tester: Fix NoneType Error of port_map Liu, Yong
2015-01-25  1:07   ` Liu, Yong
2015-01-13 13:42 ` [dts] [PATCH 2/6] framework/crbs: Info clean up of crbs Michael Qiu
2015-01-25  1:07   ` Liu, Yong
2015-01-13 13:42 ` [dts] [PATCH 3/6] framework: Add login password support Michael Qiu
2015-01-14  1:18   ` Liu, Yong
2015-01-25  1:07   ` Liu, Yong
2015-01-13 13:42 ` [dts] [PATCH 4/6] framework/ssh: Add verify ability for command execution Michael Qiu
2015-01-14  1:24   ` Liu, Yong
2015-01-27  5:22   ` [dts] [PATCH v2] " Michael Qiu
2015-02-15  5:05     ` Liu, Yong
2015-01-13 13:42 ` [dts] [PATCH 5/6] framework: Fix ifname not found error Michael Qiu
2015-01-14  1:35   ` Liu, Yong
2015-01-13 13:42 ` [dts] [PATCH 6/6] framework/crb: rework restore_interfaces() Michael Qiu
2015-01-14  1:35   ` Liu, Yong

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=1421156540-25810-2-git-send-email-michael.qiu@intel.com \
    --to=michael.qiu@intel.com \
    --cc=dts@dpdk.org \
    --cc=yong.liu@intel.com \
    /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).