]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: test_progs avoid minus shell exit codes
authorJesper Dangaard Brouer <brouer@redhat.com>
Tue, 7 Jul 2020 07:12:25 +0000 (09:12 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 8 Jul 2020 22:35:33 +0000 (00:35 +0200)
commitea0796dd8d93f013c52cb51014bfc32facf013e3
treefc555b91bf4d84ab7bbac23fe87ef543fe1111b0
parent8a4a501afe0b754d88f599f91d07592668fb62c1
selftests/bpf: test_progs avoid minus shell exit codes

There are a number of places in test_progs that use minus-1 as the argument
to exit(). This is confusing as a process exit status is masked to be a
number between 0 and 255 as defined in man exit(3). Thus, users will see
status 255 instead of minus-1.

This patch use positive exit code 3 instead of minus-1. These cases are put
in the same group of infrastructure setup errors.

Fixes: 840fec01f965 ("selftests/bpf: Reset process and thread affinity after each test/sub-test")
Fixes: c30750c6a645 ("bpf: selftests: Restore netns after each test")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/159410594499.1093222.11080787853132708654.stgit@firesoul
tools/testing/selftests/bpf/test_progs.c