[dts] [PATCH] framework/crb: Throwing exception in case requested core configuration cannot be fulfilled

Radoslaw Biernacki radoslaw.biernacki at linaro.org
Fri Sep 15 18:22:29 CEST 2017


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 at 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



More information about the dts mailing list