Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp803280ybt; Tue, 7 Jul 2020 00:13:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIOZBv+mTwCSmhWiU3VTUUvEsbAmDRoRUDyp1JT+MZGbjhzWIB99sg+4gjIlAGs0WUeADz X-Received: by 2002:a50:9306:: with SMTP id m6mr59558895eda.216.1594106032983; Tue, 07 Jul 2020 00:13:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594106032; cv=none; d=google.com; s=arc-20160816; b=kFJ2e1YhESe42gBAWFmyUMkjX+73nb1fTNV19ZCiYzyL9p9xsRMVEJOFeVovhQSPUp KL07V88v+HKsii9hbQC6WmeWJX13gMPRvwoWwWEEuuzlzNfA8v9uYIhzBuIk1uAC+hnW Vc99ncmz1MXqmdKCCGK5JyQO1EGK0n53gRTunL//1OibdcyIq3X1GlMzuH98EI6+92k2 HjqV+7k1ZoxKqFNuyP2vnymtg2rLZxkSwG7nIFxttu7U2YtVqK9jFhjaPIslolT9Fq63 9yE2PnlXBFo5TBCE+q7nI6WhnnCsG9tPSj/LWbqDBaPBEUJ6rN6kTs9xQpSFY4oYzXsY tOjQ== 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:cc:to:from :subject:dkim-signature; bh=Bn+ruZS7FY0l4m1bwh4y9EZU234WLtYiVGQrbxmji8I=; b=GkI5PE+HR4JoZCfYqsKLhwrmjEIcUCqlprmTHrnAHgUL5IT238fEHBS/hSq3P4h/IT WB+21fNuvrqKTGYVfGvgmJuTP69q8RaQNUNVHbi0MHZtsTyrrFyRVVUJYW/Lzel4mZhJ JkE7QrDqE1alxK8BTTGOZid/MVIefpbfu8oNoyqw+AYse8h1ak0DQX9yAigXQ0oRJ7uE fl6SzDrHqFfe10kv5SOx/ltCGCcTib5bl6d3n8s70HKbZMDnE6+QaDHwicACBXofNQ7B WsxTxSNDxouPvYpSPtwBzdDIAM5vgpARnMQP1J/zWcWT7VLNm1vl+PpgLY2XEu7YrR0q 2h+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ePe1gpJm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si14411775ejc.99.2020.07.07.00.13.29; Tue, 07 Jul 2020 00:13:52 -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=@redhat.com header.s=mimecast20190719 header.b=ePe1gpJm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728179AbgGGHM3 (ORCPT + 99 others); Tue, 7 Jul 2020 03:12:29 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:39178 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725766AbgGGHM2 (ORCPT ); Tue, 7 Jul 2020 03:12:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594105947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bn+ruZS7FY0l4m1bwh4y9EZU234WLtYiVGQrbxmji8I=; b=ePe1gpJmxMrOqNdT0crIIMaS0qTGPlFklvAjAHmxU+dS0JFjHdN/h8xJBzSZoXGhJJvF5e WfUIKz+OqZWrzglpTI9gAvdrHSFaJD9NCea1C8EOBzYPthn7acyemvTh3F9+RFrN+Wdij/ pBEHqHmB8WgJ3wSDO7dzrDKLgurmqpE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-311-dm8ShyrnNbiNIFTlEzAj2g-1; Tue, 07 Jul 2020 03:12:25 -0400 X-MC-Unique: dm8ShyrnNbiNIFTlEzAj2g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3F2508015F7; Tue, 7 Jul 2020 07:12:24 +0000 (UTC) Received: from firesoul.localdomain (unknown [10.40.208.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3A9BCF934; Tue, 7 Jul 2020 07:12:20 +0000 (UTC) Received: from [192.168.42.3] (localhost [IPv6:::1]) by firesoul.localdomain (Postfix) with ESMTP id F0F2F3002D6DA; Tue, 7 Jul 2020 09:12:19 +0200 (CEST) Subject: [PATCH bpf-next V3 1/2] selftests/bpf: test_progs use another shell exit on non-actions From: Jesper Dangaard Brouer To: bpf@vger.kernel.org, Andrii Nakryiko Cc: Jesper Dangaard Brouer , Hangbin Liu , Daniel Borkmann , Alexei Starovoitov , vkabatov@redhat.com, jbenc@redhat.com, yhs@fb.com, kafai@fb.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 07 Jul 2020 09:12:19 +0200 Message-ID: <159410593992.1093222.90072558386094370.stgit@firesoul> In-Reply-To: <159410590190.1093222.8436994742373578091.stgit@firesoul> References: <159410590190.1093222.8436994742373578091.stgit@firesoul> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 104e833d0087..65d3f8686e29 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 = {}; @@ -740,7 +742,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; }