diff mbox

selinux-testsuite: Stop Infiniband building if not enabled

Message ID 20171019155647.26565-1-richard_c_haines@btinternet.com (mailing list archive)
State Accepted
Headers show

Commit Message

Richard Haines Oct. 19, 2017, 3:56 p.m. UTC
The default is not to test, however it still tries to build
create_modify_qp.c that requires a header and library that may not
exist.

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
---
 tests/infiniband_pkey/Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Stephen Smalley Oct. 23, 2017, 8:17 p.m. UTC | #1
On Thu, 2017-10-19 at 16:56 +0100, Richard Haines wrote:
> The default is not to test, however it still tries to build
> create_modify_qp.c that requires a header and library that may not
> exist.
> 
> Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>

Thanks, applied.

> ---
>  tests/infiniband_pkey/Makefile | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/infiniband_pkey/Makefile
> b/tests/infiniband_pkey/Makefile
> index 60f0d24..4fa6fb2 100644
> --- a/tests/infiniband_pkey/Makefile
> +++ b/tests/infiniband_pkey/Makefile
> @@ -2,6 +2,14 @@ TARGETS=create_modify_qp
>  
>  LDLIBS+= -libverbs
>  
> -all: $(TARGETS)
> +RESULT=$(shell grep "SELINUX_INFINIBAND_PKEY_TEST=0"
> ./ibpkey_test.conf)
> +
> +ifeq  ($(RESULT), )
> +    all: $(TARGETS)
> +else
> +    all:
> +	@echo "Infiniband test disabled"
> +endif
> +
>  clean:
>  	rm -f $(TARGETS)
diff mbox

Patch

diff --git a/tests/infiniband_pkey/Makefile b/tests/infiniband_pkey/Makefile
index 60f0d24..4fa6fb2 100644
--- a/tests/infiniband_pkey/Makefile
+++ b/tests/infiniband_pkey/Makefile
@@ -2,6 +2,14 @@  TARGETS=create_modify_qp
 
 LDLIBS+= -libverbs
 
-all: $(TARGETS)
+RESULT=$(shell grep "SELINUX_INFINIBAND_PKEY_TEST=0" ./ibpkey_test.conf)
+
+ifeq  ($(RESULT), )
+    all: $(TARGETS)
+else
+    all:
+	@echo "Infiniband test disabled"
+endif
+
 clean:
 	rm -f $(TARGETS)