Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1242716pxa; Thu, 20 Aug 2020 06:34:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8MAJvg5ZIbAfTSsTVyTjXRRTIbZMZk3QjpTcF6aavCq6EyylTDVR4zLdFzm/1UwUFXA0b X-Received: by 2002:a17:906:7153:: with SMTP id z19mr3164101ejj.319.1597930465907; Thu, 20 Aug 2020 06:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597930465; cv=none; d=google.com; s=arc-20160816; b=EjgErTi9ervUWGgvIKcKrvDM/0s71CS1pi5slwcRMqvVZ8bIXxo267RK5ugr4Kv0FN Fs7xRs/FDZYjaKh8xMINl8dVba4Vlf0BhkBNsQMfntdycrVUOUyhXF05BSnCWZsI131t TO3BoKP7Ri/JEt0ORcgbIrOBaT+kTyIVWcORbQRWsa2RK0zEZ+M9Gss9UhjONtvZH8i4 rNwHQIh/FMoPwsov28ap65Ns/xsziz8NHj2B15DM9xd2OSovh8mHKKQRBvntpVgSD+ZQ 8SUNvv4zb2gOulEBMAZpdteoYwa/Gst4AWkaIlnXIJ+dHj7ln/wry1BwefauSuTTrs5b N++g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mLu5PxNYvl+pw07bdyZIfLyBgQja6l7NJsZKa/97rbY=; b=S9TT89l0oWF9vlVqSEB746ilBKInuK5dZq2XtVnG8IkPFZGZKwTu1c0SVZntQVXhCl P2/gLeq7xl5iLf0HkJl49zT+zpj23F8JF1SBfhzcKpDm8D17FVe7mWKNrbs1V1k137v6 WBjv6boajJFHC2dQehGlPpxI0GTelT1bVVZ9P8ImNzRPYCoR1bITpcir6GID1EnVWRNW Rztyt1lI7sHkSaUYKNgx7eISfrfcM68ARVVbtg8uRYv2inaNAdEZfkSm07PHxyjLePM9 Mgz0gOy9TKyf4tEH6T3XREmN07HbIXyAY1ETI1ofv/0aGWZRlCaEQg2H7FRFJq0CnHF3 nTmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EB61nRW7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce15si1476307edb.201.2020.08.20.06.34.00; Thu, 20 Aug 2020 06:34:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EB61nRW7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728290AbgHTNdO (ORCPT + 99 others); Thu, 20 Aug 2020 09:33:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728019AbgHTJbD (ORCPT ); Thu, 20 Aug 2020 05:31:03 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7FDDA207DE; Thu, 20 Aug 2020 09:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915863; bh=66G90lRavlVdhlnjqF4FluvMXpWwQXugFK+f2oebVQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EB61nRW7nAWHpRDyj5vNdyySsxrITd1ZyraEj/cVih8IVQnDFsDzY5QV9yM2mQKhy En+aNS1ZnmMLg/AhAveL+fggZdaZYUvuG2xOQlRhY3XsCdfHf1IUNbfh3xdBf4+A7h MujNBexaAhwizsz/MzP8xHJxQQ6pgAhr44yTEPF0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jesper Dangaard Brouer , Alexei Starovoitov , Andrii Nakryiko , Sasha Levin Subject: [PATCH 5.8 131/232] selftests/bpf: Test_progs indicate to shell on non-actions Date: Thu, 20 Aug 2020 11:19:42 +0200 Message-Id: <20200820091619.163066268@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jesper Dangaard Brouer [ Upstream commit 6c92bd5cd4650c39dd929565ee172984c680fead ] When a user selects a non-existing test the summary is printed with indication 0 for all info types, and shell "success" (EXIT_SUCCESS) is indicated. This can be understood by a human end-user, but for shell scripting is it useful to indicate a shell failure (EXIT_FAILURE). Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/159363984736.930467.17956007131403952343.stgit@firesoul Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/test_progs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c index 54fa5fa688ce9..da70a4f72f547 100644 --- a/tools/testing/selftests/bpf/test_progs.c +++ b/tools/testing/selftests/bpf/test_progs.c @@ -687,5 +687,8 @@ int main(int argc, char **argv) free_str_set(&env.subtest_selector.whitelist); free(env.subtest_selector.num_set); + if (env.succ_cnt + env.fail_cnt + env.skip_cnt == 0) + return EXIT_FAILURE; + return env.fail_cnt ? EXIT_FAILURE : EXIT_SUCCESS; } -- 2.25.1