Discussion:
[PATCH] selinux-testsuite: Stop Infiniband building if not enabled
Richard Haines
2017-10-19 15:56:47 UTC
Permalink
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 <***@btinternet.com>
---
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)
--
2.13.6
Stephen Smalley
2017-10-23 20:17:07 UTC
Permalink
Post by Richard Haines
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.
Thanks, applied.
Post by Richard Haines
---
 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
+endif
+
  rm -f $(TARGETS)
Loading...