Skip to contentSkip to conversation

selinux-testsuite: only add the infiniband tests to SUBDIRS if they are enabled

PATCH New Paul Moore 1 participant 1 message Apr 17, 2018 SELinux security module

lore
Share & tools
lore

Paul Moore

author
#0 lore raw

PATCH 1/1 selinux-testsuite: only add the infiniband tests to SUBDIRS if they are enabled

From: Paul Moore <[email protected]>

It was difficult to tell if the InfiniBand tests were actually being run as they were always added to SUBDIRS regardless of the configuration; this patch should make this more obvious.

It is worth nothing that most of the changes to the tests themselves are simply due to reformatting (./tools/check-syntax -f) due to the removal of the enabled check.

---
 tests/Makefile                 |   11 +++-
 tests/infiniband_endport/test  |   52 ++++++++---------
 tests/infiniband_pkey/Makefile |    9 ---
 tests/infiniband_pkey/test     |  121 ++++++++++++++++++----------------------
 4 files changed, 90 insertions(+), 103 deletions(-)
tests/Makefile +9 -2
index f2291b2..27ed6eb 100644
@@ -10,8 +10,7 @@ SUBDIRS:= domain_trans entrypoint execshare exectrace execute_no_trans \
 	task_setnice task_setscheduler task_getscheduler task_getsid \
 	task_getpgid task_setpgid file ioctl capable_file capable_net \
 	capable_sys dyntrans dyntrace bounds nnp_nosuid mmap unix_socket \
-        inet_socket overlay checkreqprot mqueue mac_admin infiniband_pkey \
-	infiniband_endport atsecure
+        inet_socket overlay checkreqprot mqueue mac_admin atsecure
 
 ifeq ($(shell grep -q cap_userns $(POLDEV)/include/support/all_perms.spt && echo true),true)
 ifneq ($(shell ./kvercmp $$(uname -r) 4.7),-1)
@@ -31,6 +30,14 @@ ifeq ($(shell grep -q getrlimit $(POLDEV)/include/support/all_perms.spt && echo
 SUBDIRS += prlimit
 endif
 
+ifeq ($(shell grep "^SELINUX_INFINIBAND_ENDPORT_TEST=" infiniband_endport/ibendport_test.conf | cut -d'=' -f 2),1)
+SUBDIRS += infiniband_endport
+endif
+
+ifeq ($(shell grep "^SELINUX_INFINIBAND_PKEY_TEST=" infiniband_pkey/ibpkey_test.conf | cut -d'=' -f 2),1)
+SUBDIRS += infiniband_pkey
+endif
+
 ifeq ($(DISTRO),RHEL4)
     SUBDIRS:=$(filter-out bounds dyntrace dyntrans inet_socket mmap nnp_nosuid overlay unix_socket, $(SUBDIRS))
 endif
tests/infiniband_endport/test +25 -27

71 lines not on this page · raw message

tests/infiniband_pkey/Makefile +1 -8
index 4fa6fb2..b1a39a8 100644
@@ -2,14 +2,7 @@ TARGETS=create_modify_qp
 
 LDLIBS+= -libverbs
 
-RESULT=$(shell grep "SELINUX_INFINIBAND_PKEY_TEST=0" ./ibpkey_test.conf)
-
-ifeq  ($(RESULT), )
-    all: $(TARGETS)
-else
-    all:
-	@echo "Infiniband test disabled"
-endif
+all: $(TARGETS)
 
 clean:
 	rm -f $(TARGETS)
tests/infiniband_pkey/test +55 -66

148 lines not on this page · raw message