From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by dpdk.org (Postfix) with ESMTP id 37D7B2B9E for ; Fri, 1 Dec 2017 22:22:23 +0100 (CET) Received: by mail-lf0-f67.google.com with SMTP id t197so13156334lfe.7 for ; Fri, 01 Dec 2017 13:22:23 -0800 (PST) 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=4wXXxtO8zyO7FRAlsmoHuZ/7z5C4KG0H1no+X5Cjb0c=; b=CEM/jlWMx3W5u77r85MvHf/gho85q+wJa70XTIKNXGuyT8KId+RmkQPX3Y84od3PoI 9x+h9eDJdQuuu62qQfJmS6SnngfA02YhsCIShuzWir5DEwR7UKnniG6YXWALBEM/h0c0 8uzA1yd9U1nxuRxBspsWiINfEM6fWjGBd9YVM= 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=4wXXxtO8zyO7FRAlsmoHuZ/7z5C4KG0H1no+X5Cjb0c=; b=rJk9DyFc5OFnQlFXwBwry0YMl4AJj56c+YlFsilTy5e7x/eMHHiL/i0+2QyCIeZwhd hbJwTP2VNZTWgNUUlWsYnuQ7wx+SNehbPvCMZqhUohBdBLhFeIce7QHIcMheACnUYbyy lxOo/L3E1FiNK6o4n+RRaYBZx07/CPPb7QgBBFR0NDd9rpsf7uTEAiKAXsi35ULuzHeb 5XCtxzGXMDqydQoIyzp0zCg/9fSqCuJj7b/3IwTUMLCfvhwSoD9hL77efgBDM8mDbuF3 fd9PnaOoC8CpVJDn3DS9augn1gzeorsNkQeHcw3ryL850l4C2ipoa7HQq522hQSilFrj r4kQ== X-Gm-Message-State: AJaThX7QN5Rk50gXfivXG43g9WXniKvA7y1Jr6IX7a/eemciVOjxhcmY vGbR53xZv6OdY19djTs1RgMWyV9pcqM= X-Google-Smtp-Source: AGs4zMa9xPURYbYTK3DN+Crui+bFlsUEoPbzrwieCrvb4uU4Of+cqSsK3BKm5yCTe6JmRhw3GEL2Zw== X-Received: by 10.46.4.149 with SMTP id a21mr5309314ljf.153.1512163342751; Fri, 01 Dec 2017 13:22:22 -0800 (PST) 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 w62sm1478571lje.59.2017.12.01.13.22.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Dec 2017 13:22:21 -0800 (PST) From: Radoslaw Biernacki To: dts@dpdk.org, yong.liu@intel.com, aczubak@caviumnetworks.com Cc: herbert.guan@linaro.org, Radoslaw Biernacki Date: Fri, 1 Dec 2017 22:20:54 +0100 Message-Id: <1512163254-31552-5-git-send-email-radoslaw.biernacki@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512163254-31552-1-git-send-email-radoslaw.biernacki@linaro.org> References: <1512163254-31552-1-git-send-email-radoslaw.biernacki@linaro.org> Subject: [dts] [PATCH 4/4] framework/dut: Adding exception in case ports_map is empty 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, 01 Dec 2017 21:22:23 -0000 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 --- 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