Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2443512pxp; Mon, 7 Mar 2022 15:49:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzoVY563IgFUtNIhgIbCml30//1a+0RA4JMpnTgvpRonRFZ3fEBhwRFSk4ChWBTDdN6doV8 X-Received: by 2002:a63:8b49:0:b0:380:8edf:fc24 with SMTP id j70-20020a638b49000000b003808edffc24mr674738pge.143.1646696973283; Mon, 07 Mar 2022 15:49:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646696973; cv=none; d=google.com; s=arc-20160816; b=cbfBDyvphMboNpcAyp21+ErPXKP0PfwYcrqPc2zSat/VR33P+i3DfoOtWErv+CVlQz eIM77gnP5j5GwcAN63qnvQ3GCprQblkRgj/tX/Uij32xSEUvRwcEDaeTrni4mompdCBl ROuFZD8oE3xtKfSmozZT+iTK/cGJEs9tS/L1gvdBquZH/FQOhGDegqHkVMM4BorkEoXS 3mK63JzwqfXKsnDqJ/+fox8esyMpRtxn0/NNuHRa5Ibmcd9fWaPfjCkMXic/MrVrIYUx 9z1tGIZofDsrgdONaBM9CPGXpIhMpWTLU0wOtnOeIn6zxxLP6vG1NnmNt0cag2uCPHSc rmIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r4W/SAfWLudOnrp+PIkLa521RZd4O/VCATAYMELFsHI=; b=RRUH9ryS6x0WeJE6uOITJqgKTXK3C+KUsvKL+IILMSOjUfm6MC4LYKYmWhWVUt7Bem DiD2bD8icYbKACou+mxyjNNMAWBYAZbFA+2VYyKFvfruSV4clWI8yuMasd2NReJKF66L Tm0atkcQvJiyhJs1DawHYAs6DkrrNT5T8FcYcHpxGfyrvVEMOrtw2UJU0YDSk4G1jUCM YBTF2gVzxvOsi5TvvrQIJYCaMCsAkr99pzKN0ReDkUqT4CZa4/sHs97WgsYOMAR5MzLd PBpJisMYSg88GNc8gEK2we4hgsXUr3xnB3QM+7MDW0EL+clRvxMYm2udZZbgKSAveWL9 sTBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NqRUr9OV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d5-20020a056a00244500b004dfc713a784si14898618pfj.150.2022.03.07.15.49.16; Mon, 07 Mar 2022 15:49:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NqRUr9OV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241011AbiCGKmm (ORCPT + 99 others); Mon, 7 Mar 2022 05:42:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240101AbiCGK1Y (ORCPT ); Mon, 7 Mar 2022 05:27:24 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B62B6D4F9; Mon, 7 Mar 2022 02:01:53 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6405AB810C3; Mon, 7 Mar 2022 09:56:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B82DAC340E9; Mon, 7 Mar 2022 09:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646647009; bh=4HZR3FGCDTx2vgRZ0cLmyAQw9TnJRaGdyrSyXvUjbuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NqRUr9OVwyebl2AU4ZOQ21bkyLnnrMFE304nrW+UdwlBQgVHqUA12EANpFP0VX3gT rd3fCSwko3Alb2nun1RORl33EuxuEOdyg6IZxzptFxR8rnpe5Y5ov/MS24EjBeR1lA 9y6S483G9TV7j1B7QgZ6dNjIfIODTRHq62eUcmuM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amit Cohen , Petr Machata , Ido Schimmel , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.16 164/186] selftests: mlxsw: resource_scale: Fix return value Date: Mon, 7 Mar 2022 10:20:02 +0100 Message-Id: <20220307091658.662396399@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307091654.092878898@linuxfoundation.org> References: <20220307091654.092878898@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amit Cohen [ Upstream commit 196f9bc050cbc5085b4cbb61cce2efe380bc66d0 ] The test runs several test cases and is supposed to return an error in case at least one of them failed. Currently, the check of the return value of each test case is in the wrong place, which can result in the wrong return value. For example: # TESTS='tc_police' ./resource_scale.sh TEST: 'tc_police' [default] 968 [FAIL] tc police offload count failed Error: mlxsw_spectrum: Failed to allocate policer index. We have an error talking to the kernel Command failed /tmp/tmp.i7Oc5HwmXY:969 TEST: 'tc_police' [default] overflow 969 [ OK ] ... TEST: 'tc_police' [ipv4_max] overflow 969 [ OK ] $ echo $? 0 Fix this by moving the check to be done after each test case. Fixes: 059b18e21c63 ("selftests: mlxsw: Return correct error code in resource scale test") Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- .../selftests/drivers/net/mlxsw/spectrum/resource_scale.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh index bcb110e830ce..dea33dc93790 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh @@ -50,8 +50,8 @@ for current_test in ${TESTS:-$ALL_TESTS}; do else log_test "'$current_test' [$profile] overflow $target" fi + RET_FIN=$(( RET_FIN || RET )) done - RET_FIN=$(( RET_FIN || RET )) done done current_test="" -- 2.34.1