public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: bpf@vger.kernel.org, Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Hangbin Liu <haliu@redhat.com>,
	Daniel Borkmann <borkmann@iogearbox.net>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	vkabatov@redhat.com, jbenc@redhat.com, brouer@redhat.com
Subject: Re: [PATCH bpf-next V3 1/3] selftests/bpf: test_progs indicate to shell on non-actions
Date: Thu, 2 Jul 2020 15:47:28 +0200	[thread overview]
Message-ID: <20200702154728.6700e790@carbon> (raw)
In-Reply-To: <159363984736.930467.17956007131403952343.stgit@firesoul>

On Wed, 01 Jul 2020 23:44:07 +0200
Jesper Dangaard Brouer <brouer@redhat.com> wrote:

> 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 <brouer@redhat.com>
> ---
>  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 54fa5fa688ce..da70a4f72f54 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;

We should use another return code as indication, else the shell script
cannot tell the difference between no-test-selected and failed-test.
Normally I would request a V4 (from myself I guess), but this have
already been merged, so I'll send a followup patch.

> +
>  	return env.fail_cnt ? EXIT_FAILURE : EXIT_SUCCESS;
>  }
> 

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer


  parent reply	other threads:[~2020-07-02 13:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 21:44 [PATCH bpf-next V3 0/3] BPF selftests test runner test_progs improvement for scripting Jesper Dangaard Brouer
2020-07-01 21:44 ` [PATCH bpf-next V3 1/3] selftests/bpf: test_progs indicate to shell on non-actions Jesper Dangaard Brouer
2020-07-01 21:46   ` Andrii Nakryiko
2020-07-02 13:47   ` Jesper Dangaard Brouer [this message]
2020-07-02 17:59     ` [PATCH bpf-next] selftests/bpf: test_progs use another shell exit " Jesper Dangaard Brouer
2020-07-02 21:24       ` Yonghong Song
2020-07-03 11:59         ` Jesper Dangaard Brouer
2020-07-04 18:15           ` Yonghong Song
2020-07-01 21:44 ` [PATCH bpf-next V3 2/3] selftests/bpf: test_progs option for getting number of tests Jesper Dangaard Brouer
2020-07-01 21:47   ` Andrii Nakryiko
2020-07-01 21:44 ` [PATCH bpf-next V3 3/3] selftests/bpf: test_progs option for listing test names Jesper Dangaard Brouer
2020-07-01 21:48   ` Andrii Nakryiko
2020-07-01 22:22 ` [PATCH bpf-next V3 0/3] BPF selftests test runner test_progs improvement for scripting Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200702154728.6700e790@carbon \
    --to=brouer@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=borkmann@iogearbox.net \
    --cc=bpf@vger.kernel.org \
    --cc=haliu@redhat.com \
    --cc=jbenc@redhat.com \
    --cc=vkabatov@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox