test suite reviews and discussions
 help / color / mirror / Atom feed
From: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
To: dts@dpdk.org
Cc: jianbo.liu@linaro.org, herbert.guan@arm.com,
	Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Subject: [dts] [PATCH] framework/crb: Throwing exception in case requested core configuration cannot be fulfilled
Date: Fri, 15 Sep 2017 18:22:29 +0200	[thread overview]
Message-ID: <1505492549-8602-2-git-send-email-radoslaw.biernacki@linaro.org> (raw)
In-Reply-To: <1505492549-8602-1-git-send-email-radoslaw.biernacki@linaro.org>

Throwing exception instead of returning empty core set cause proper
error handling. Returning empty core set cause invalid parameter being
passed to EAL which in turn cause early exit from test program.

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

diff --git a/framework/crb.py b/framework/crb.py
index facf319..dd29a8b 100644
--- a/framework/crb.py
+++ b/framework/crb.py
@@ -694,9 +694,11 @@ class Crb(object):
                 n['core']) in core_list]
             temp = []
             if len(core_list) < nr_cores:
-                return []
+                raise ValueError("Cannot get requested core configuration "
+                                 "requested {} have {}".format(config, self.cores))
             if len(sockList) < nr_sockets:
-                return []
+                raise ValueError("Cannot get requested core configuration "
+                                 "requested {} have {}".format(config, self.cores))
             # recheck the core_list and create the thread_list
             i = 0
             for sock in sockList:
-- 
1.9.1

  reply	other threads:[~2017-09-15 16:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-15 16:22 [dts] [PATCH] framework: Adding limit for make job execution Radoslaw Biernacki
2017-09-15 16:22 ` Radoslaw Biernacki [this message]
2017-09-18 10:15   ` [dts] [PATCH] framework/crb: Throwing exception in case requested core configuration cannot be fulfilled Liu, Yong
2017-09-18 10:14 ` [dts] [PATCH] framework: Adding limit for make job execution 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=1505492549-8602-2-git-send-email-radoslaw.biernacki@linaro.org \
    --to=radoslaw.biernacki@linaro.org \
    --cc=dts@dpdk.org \
    --cc=herbert.guan@arm.com \
    --cc=jianbo.liu@linaro.org \
    /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).