test suite reviews and discussions
 help / color / mirror / Atom feed
From: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
To: dts@dpdk.org, yong.liu@intel.com, aczubak@caviumnetworks.com
Cc: herbert.guan@linaro.org,
	Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Subject: [dts] [PATCH 4/4] framework/dut: Adding exception in case ports_map is empty
Date: Fri,  1 Dec 2017 22:20:54 +0100	[thread overview]
Message-ID: <1512163254-31552-5-git-send-email-radoslaw.biernacki@linaro.org> (raw)
In-Reply-To: <1512163254-31552-1-git-send-email-radoslaw.biernacki@linaro.org>

dut_prerequisites() warns with message that "ports_map cannot be
empty". If in fact it cannot be empty it should throw an exception.
Empty port map cause problems in most of the test anyway, so it is better to
crash hard than pushing on diging into the test to find the empty port map as
root cause.

Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
---
 framework/dut.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/framework/dut.py b/framework/dut.py
index ee5608b..bf4dc18 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -212,7 +212,8 @@ class Dut(Crb):
         for port_info in self.ports_info:
             self.logger.info(port_info)
         if self.ports_map is None or len(self.ports_map) == 0:
-            self.logger.warning("ports_map should not be empty, please check all links")
+            self.logger.error("ports_map cannot not be empty, please check all links")
+            raise EnvironmentError("ports_map cannot be empty")
 
         # initialize virtualization resource pool
         self.virt_pool = VirtResource(self)
-- 
2.7.4

      parent reply	other threads:[~2017-12-01 21:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-01 21:20 [dts] [PATCH 0/4] ThunderX DTS initialization phase fixes Radoslaw Biernacki
2017-12-01 21:20 ` [dts] [PATCH 1/4] framework/crb: Fixing ThunderX ethernet controler detection Radoslaw Biernacki
2017-12-04 10:44   ` Radoslaw Biernacki
     [not found]     ` <CY4PR07MB2920B4D6EB1565292042CC4CF43C0@CY4PR07MB2920.namprd07.prod.outlook.com>
2017-12-04 13:57       ` Radoslaw Biernacki
2017-12-05  1:45         ` Liu, Yong
2017-12-01 21:20 ` [dts] [PATCH 2/4] framework: Fixing unnamed interface detection Radoslaw Biernacki
2017-12-01 21:20 ` [dts] [PATCH 3/4] framework/dut: fixing mixed tab and space python indention Radoslaw Biernacki
2017-12-01 21:20 ` Radoslaw Biernacki [this message]

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=1512163254-31552-5-git-send-email-radoslaw.biernacki@linaro.org \
    --to=radoslaw.biernacki@linaro.org \
    --cc=aczubak@caviumnetworks.com \
    --cc=dts@dpdk.org \
    --cc=herbert.guan@linaro.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).