OSDN Git Service

selftests/bpf: Only run tests if !bpf_disabled
authorJoe Stringer <joe@wand.net.nz>
Wed, 14 Feb 2018 21:50:36 +0000 (13:50 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 15 Feb 2018 09:22:55 +0000 (10:22 +0100)
commit0a67487403683852e05fea97208ad7b0ed820115
treeb0a75aef54e4be2611578f072b98536e4156afcc
parentd0a0e4956f6c20754ef67db6dfb9746e85ecdcb5
selftests/bpf: Only run tests if !bpf_disabled

The "kernel.unprivileged_bpf_disabled" sysctl, if enabled, causes all
unprivileged tests to fail because it permanently disables unprivileged
BPF access for the currently running kernel. Skip the relevant tests if
the user attempts to run the testsuite with this sysctl enabled.

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_verifier.c