From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by dpdk.org (Postfix) with ESMTP id 615C02FDD for ; Fri, 15 Sep 2017 18:23:19 +0200 (CEST) Received: by mail-lf0-f49.google.com with SMTP id r17so2946096lff.6 for ; Fri, 15 Sep 2017 09:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2euaGssSrkj9gyKOLa2p08atq8rRTyD8YCkL+NCSlxw=; b=cIBljqotnuyxvVtSf/Bgn7vGIIOtETvo/c70aeLFbTp+yZCautC9Yv9iZ6YaIA1dXe jjjlxhiiIIdskWm0zizw9SO94WLn6I9MDXaqvShlUr0BekttRE5ypktFzLF6fo+Hf0cw 6IMjsQsXWjtl4+oVC3pWAF4gc2rpLu+9/j/GE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2euaGssSrkj9gyKOLa2p08atq8rRTyD8YCkL+NCSlxw=; b=LrYmylfeiyTVJ0tvUFaa9dudlO+lzlZZp8nPv+jhn+rqBnbDjVdi5WXlN+rCXVtnm8 xfFNZgbe/FIdhpqXJ+e7sWvOV6PxtDU3REAeNlc1aR8jDGYLZg1f//1SZnSuKeFdl30x VTMtAw5ax1Rp0ZYx7hqflug1BLzRpuLGesqdUlVtZXRZ6poSJ+kPy1kbujvh7kDKM97r 1DGhw1zFhxz3z53dr74vxnL8oOhaGBTNdRm03VZiallfljcQpi+cDqhEo5SvEHdT+mAn acSxZJ4U1++7+9dstIKHI0i2E66kn8ZE6XWw+bk+F5qAbiG8GpK7yfS7lWhdgTwsv8Mz 00Qg== X-Gm-Message-State: AHPjjUhVxQ/EQdKtnIxUEerI/wmbBCcdNcLSaWapkX9c7jnXFnr1/8nt r/MBTT+JyJ+LC5NwPC7ciQ== X-Google-Smtp-Source: AOwi7QCenhmO8X9t4mc8RNua+mv3YZdlmRY3jum7/FFWHllMe6SYtMNDAVi+P9HiF/m9LGt7DJb9Fg== X-Received: by 10.46.67.29 with SMTP id q29mr7648533lja.85.1505492598886; Fri, 15 Sep 2017 09:23:18 -0700 (PDT) Received: from rad-H81M-S1.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id j1sm210343lfe.82.2017.09.15.09.23.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Sep 2017 09:23:18 -0700 (PDT) From: Radoslaw Biernacki To: dts@dpdk.org Cc: jianbo.liu@linaro.org, herbert.guan@arm.com, Radoslaw Biernacki Date: Fri, 15 Sep 2017 18:22:29 +0200 Message-Id: <1505492549-8602-2-git-send-email-radoslaw.biernacki@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505492549-8602-1-git-send-email-radoslaw.biernacki@linaro.org> References: <1505492549-8602-1-git-send-email-radoslaw.biernacki@linaro.org> Subject: [dts] [PATCH] framework/crb: Throwing exception in case requested core configuration cannot be fulfilled X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2017 16:23:19 -0000 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 --- 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