Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1249428pxa; Thu, 20 Aug 2020 06:45:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5hfILA79rzVlIuTc13FWv5juNP2twFRH1HDqrUgS6q41aVnlZNafYACnY3ldXf4CthOdx X-Received: by 2002:a17:906:a3d6:: with SMTP id ca22mr3293948ejb.78.1597931114678; Thu, 20 Aug 2020 06:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931114; cv=none; d=google.com; s=arc-20160816; b=l9Pcc0TBG9Vdpr2D+bsQMAtvISGwETcawpqJcPPvykqOlq4Ike79Pkt1bXFwgONLGq o+yzhZ2v8bfD1FjEwVKr0k6dtgrt4MQ5FbrWANpOH9Ej2WzV77WMZL76+b9j2CGt1/Zk XtKogPPIi8gl3SPvQUp+qhnj54eh25fD56Wjy1zTrFv2tLdvyMs25f8MkPMHlfRiH/Xf 8An+RRwfkMPG9EqQh1bslK/J9K0mnnnHnvrgR8ws+m5FJy1ytqxBBlxWD0Vb7OGQLcTg 2oatq8RQH7Z5zNt8ItrM0CjhV+McgoUtioj1n4bLg3jqjvZ/+pVq4dD310TxH6Ti+sAZ 20jg== 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=MAw/YDnAbDgK83Uqlbv0Ic6Ip0HOh4yo7lietl2Zu/I=; b=u4NrFP4qp0bRHXeSSwH/8MHehi4Ek1kzLaLCsiipQ6rOyePmGGo1O/7j+FKYj6XZPb KY+/6KwXdz2nNkjHk+CQpZAtZwKMvNiKHjX060dKjf4OLxUcRPZTR76bQyELrWU1an6U Jcg/1Pt7fGBmUEjG4k3gRBFJDChAwv49eHtZ8gcUzjYjGf2Gvmd80ni77cCEanQn0Ocd O0DlvAKmMFUGN2obCuXzLRR2jJCw3P9AmZqZRdMalQgkQgByEKWtLxrHwGcdcU1sJ8fY GA3qGhkSFnFbSwQwFNLvj2ul94sIl1iKbSWPxiUx6VoPFURl31vkRiKnEii2gaz9rS7n gakA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bb+JGaYt; 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 p26si1264200ejf.232.2020.08.20.06.44.49; Thu, 20 Aug 2020 06:45:14 -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=bb+JGaYt; 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 S1729876AbgHTNmD (ORCPT + 99 others); Thu, 20 Aug 2020 09:42:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:40284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728090AbgHTJ3n (ORCPT ); Thu, 20 Aug 2020 05:29:43 -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 61BEA2075E; Thu, 20 Aug 2020 09:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915783; bh=kCmhR+CJ9QTo6q+Nvv/t2fNCrVtHeBPbDvsuZwRkcYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bb+JGaYtiMk9Q3hkHm7BJLMU/7QX1T4P9qIGQD7ySns5Xa7jrwCgIZ/YNBFy3CXJD N2oixHyZRYLUTjlFWQorL0SyRJU/Pi0QXMPntXZAycsrqOnkj6QtLiG6NknsBl2Hml QYxodHNBWjyGvLNL4vysDh0t4HXNEk9Bwwf+i4+Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jesper Dangaard Brouer , Daniel Borkmann , Andrii Nakryiko , Sasha Levin Subject: [PATCH 5.8 133/232] selftests/bpf: test_progs use another shell exit on non-actions Date: Thu, 20 Aug 2020 11:19:44 +0200 Message-Id: <20200820091619.262423482@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 3220fb667842a9725cbb71656f406eadb03c094b ] This is a follow up adjustment to commit 6c92bd5cd465 ("selftests/bpf: Test_progs indicate to shell on non-actions"), that returns shell exit indication EXIT_FAILURE (value 1) when user selects a non-existing test. The problem with using EXIT_FAILURE is that a shell script cannot tell the difference between a non-existing test and the test failing. This patch uses value 2 as shell exit indication. (Aside note unrecognized option parameters use value 64). Fixes: 6c92bd5cd465 ("selftests/bpf: Test_progs indicate to shell on non-actions") Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/159410593992.1093222.90072558386094370.stgit@firesoul Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/test_progs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c index 6218b2b5a3f62..0849735ebda8a 100644 --- a/tools/testing/selftests/bpf/test_progs.c +++ b/tools/testing/selftests/bpf/test_progs.c @@ -12,6 +12,8 @@ #include #include /* backtrace */ +#define EXIT_NO_TEST 2 + /* defined in test_progs.h */ struct test_env env = {}; @@ -707,7 +709,7 @@ int main(int argc, char **argv) close(env.saved_netns_fd); if (env.succ_cnt + env.fail_cnt + env.skip_cnt == 0) - return EXIT_FAILURE; + return EXIT_NO_TEST; return env.fail_cnt ? EXIT_FAILURE : EXIT_SUCCESS; } -- 2.25.1