SELinuxProject / selinux-testsuite

This is the upstream SELinux testsuite which is designed as a basic set of regression tests for the SELinux kernel functionality.
GNU General Public License v2.0
54 stars 43 forks source link

tests/Makefile: check if BPF library is installed #67

Closed WOnder93 closed 5 years ago

WOnder93 commented 5 years ago

Check for the existence of the <bpf/bpf.h> header before enabling BPF testing. Otherwise building the tests fails in an environment where the kernel and policy support BPF, but the library is not installed.

Fixes: 8f0f980a4ad5 ("selinux-testsuite: Add BPF tests") Signed-off-by: Ondrej Mosnacek omosnace@redhat.com

stephensmalley commented 5 years ago

As noted on the list, I don't think we want to silently skip/disable tests when the kernel and policy support them, and the requisite library is listed as a dependency in the README so I don't think we want this change.

stephensmalley commented 5 years ago

If the concern is that this break older RHEL releases that might not have that package available at all, then generally we have handled that by excluding the test for that RHEL release in tests/Makefile rather than based on the presence of the header.

WOnder93 commented 5 years ago

Closing, as I agree with @stephensmalley that this is not a good way to fix handle distros that just don't have libbpf-devel available.