netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next V3 0/2] BPF selftests test runner 'test_progs' use proper shell exit codes
@ 2020-07-07  7:12 Jesper Dangaard Brouer
  2020-07-07  7:12 ` [PATCH bpf-next V3 1/2] selftests/bpf: test_progs use another shell exit on non-actions Jesper Dangaard Brouer
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jesper Dangaard Brouer @ 2020-07-07  7:12 UTC (permalink / raw)
  To: bpf, Andrii Nakryiko
  Cc: Jesper Dangaard Brouer, Hangbin Liu, Daniel Borkmann,
	Alexei Starovoitov, vkabatov, jbenc, yhs, kafai, netdev,
	linux-kernel

This patchset makes it easier to use test_progs from shell scripts, by using
proper shell exit codes. The process's exit status should be a number
between 0 and 255 as defined in man exit(3) else it will be masked to comply.

Shell exit codes used by programs should be below 127. As 127 and above are
used for indicating signals. E.g. 139 means 11=SIGSEGV $((139 & 127))=11.
POSIX defines in man wait(3p) signal check if WIFSIGNALED(STATUS) and
WTERMSIG(139)=11. (Hint: cmd 'kill -l' list signals and their numbers).

Using Segmentation fault as an example, as these have happened before with
different tests (that are part of test_progs). CI people writing these
shell-scripts could pickup these hints and report them, if that makes sense.

---

Jesper Dangaard Brouer (2):
      selftests/bpf: test_progs use another shell exit on non-actions
      selftests/bpf: test_progs avoid minus shell exit codes


 tools/testing/selftests/bpf/test_progs.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-08 22:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07  7:12 [PATCH bpf-next V3 0/2] BPF selftests test runner 'test_progs' use proper shell exit codes Jesper Dangaard Brouer
2020-07-07  7:12 ` [PATCH bpf-next V3 1/2] selftests/bpf: test_progs use another shell exit on non-actions Jesper Dangaard Brouer
2020-07-07  7:12 ` [PATCH bpf-next V3 2/2] selftests/bpf: test_progs avoid minus shell exit codes Jesper Dangaard Brouer
2020-07-07  7:23 ` [PATCH bpf-next V3 0/2] BPF selftests test runner 'test_progs' use proper " Andrii Nakryiko
2020-07-08 18:16   ` Jesper Dangaard Brouer
2020-07-08 20:03     ` Andrii Nakryiko
2020-07-08 22:57 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).