All of lore.kernel.org
 help / color / mirror / Atom feed
* [selinux-testsuite RFC PATCH 0/4] selinux-testsuite patches
@ 2013-09-24 16:33 Paul Moore
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013) Paul Moore
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Paul Moore @ 2013-09-24 16:33 UTC (permalink / raw)
  To: serge; +Cc: selinux

This is a small patchset I put together this morning to get the SELinux
testsuite running on my Rawhide system which was current as of a few
minutes ago.  You can pull from here if you are so inclined:

 * git://git.infradead.org/users/pcmoore/selinux_testsuite
 * http://git.infradead.org/users/pcmoore/selinux_testsuite

The only patch that is really necessary is 1/4, the change to
test_global.te.  At this point I haven't really looked closely enough at
the tests to see if it is correct, but it at least builds and the tests
all run to completion without failure.  The other three patches are
basically just style/formatting tweaks I did while working on the fix in
1/4.  Feel free to do with them what you will.

Comments are always welcome.  I'm hoping to start running this against
the upstream bits on a regular basis.

---

Paul Moore (4):
      test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013)
      test_policy: general Makefile cleanup
      test_policy: use RHEL instead of REDHAT in Makefile
      test_policy: create a "build" target


 policy/Makefile       |   85 ++++++++++++++++++++++++++++---------------------
 policy/test_global.te |    5 ++-
 2 files changed, 51 insertions(+), 39 deletions(-)


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013)
  2013-09-24 16:33 [selinux-testsuite RFC PATCH 0/4] selinux-testsuite patches Paul Moore
@ 2013-09-24 16:33 ` Paul Moore
  2013-09-24 16:49   ` Serge E. Hallyn
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 2/4] test_policy: general Makefile cleanup Paul Moore
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Paul Moore @ 2013-09-24 16:33 UTC (permalink / raw)
  To: serge; +Cc: selinux

Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 policy/test_global.te |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/policy/test_global.te b/policy/test_global.te
index 3891f6e..49c85b1 100644
--- a/policy/test_global.te
+++ b/policy/test_global.te
@@ -5,6 +5,7 @@ policy_module(test_policy,1.0.0)
 #
 # Declarations
 #
+
 attribute testdomain;
 
 gen_require(`
@@ -34,8 +35,8 @@ miscfiles_read_test_files(testdomain)
 
 # Let the test domains set their current, exec and fscreate contexts.
 allow testdomain self:process setcurrent;
-# domain_dyntrans_type(testdomain)
-selinux_get_fs_mount(testdomain)
+#domain_dyntrans_type(testdomain)
+#selinux_get_fs_mount(testdomain)
 allow testdomain self:process setexec;
 allow testdomain self:process setfscreate;
 


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [selinux-testsuite RFC PATCH 2/4] test_policy: general Makefile cleanup
  2013-09-24 16:33 [selinux-testsuite RFC PATCH 0/4] selinux-testsuite patches Paul Moore
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013) Paul Moore
@ 2013-09-24 16:33 ` Paul Moore
  2013-09-24 16:52   ` Serge E. Hallyn
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 3/4] test_policy: use RHEL instead of REDHAT in Makefile Paul Moore
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 4/4] test_policy: create a "build" target Paul Moore
  3 siblings, 1 reply; 15+ messages in thread
From: Paul Moore @ 2013-09-24 16:33 UTC (permalink / raw)
  To: serge; +Cc: selinux

Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 policy/Makefile |   51 +++++++++++++++++++++++++++------------------------
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/policy/Makefile b/policy/Makefile
index 6fb9578..5dbb655 100644
--- a/policy/Makefile
+++ b/policy/Makefile
@@ -1,36 +1,40 @@
-REDHAT_RELEASE=$(shell rpm -q redhat-release)
-REDHAT_VERS=$(shell echo $(REDHAT_RELEASE) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
 
-POLICYDEVEL = /usr/share/selinux/devel
+POLDEV = /usr/share/selinux/devel
 SEMODULE = /usr/sbin/semodule
 CHECKPOLICY = /usr/bin/checkpolicy
-VERS := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
-
-TARGETS=test_global.te test_capable_file.te test_capable_net.te \
-test_capable_sys.te test_dyntrace.te test_dyntrans.te test_entrypoint.te \
-test_execshare.te test_exectrace.te test_execute_no_trans.te \
-test_fdreceive.te test_file.te test_inherit.te test_ioctl.te test_ipc.te \
-test_link.te test_mkdir.te test_open.te test_ptrace.te test_readlink.te \
-test_relabel.te test_rename.te test_rxdir.te test_setattr.te test_setnice.te \
-test_sigkill.te test_stat.te test_sysctl.te test_task_create.te \
-test_task_getpgid.te test_task_getsched.te test_task_getsid.te \
-test_task_setpgid.te test_task_setsched.te test_transition.te test_wait.te
-
-VERS_GE_24 := $(shell [ $(VERS) -ge 24 ] && echo true )
-
-ifeq ($(VERS_GE_24),true)
-TARGETS+= test_bounds.te
+
+REDHAT_RELEASE=$(shell rpm -q redhat-release)
+REDHAT_VERS=$(shell echo $(REDHAT_RELEASE) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
+
+POL_VERS := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
+
+TARGETS = \
+	test_global.te test_capable_file.te test_capable_net.te \
+	test_capable_sys.te test_dyntrace.te test_dyntrans.te \
+	test_entrypoint.te test_execshare.te test_exectrace.te \
+	test_execute_no_trans.te test_fdreceive.te test_file.te \
+	test_inherit.te test_ioctl.te test_ipc.te test_link.te test_mkdir.te \
+	test_open.te test_ptrace.te test_readlink.te \
+	test_relabel.te test_rename.te test_rxdir.te test_setattr.te \
+	test_setnice.te test_sigkill.te test_stat.te test_sysctl.te \
+	test_task_create.te test_task_getpgid.te test_task_getsched.te \
+	test_task_getsid.te test_task_setpgid.te test_task_setsched.te \
+	test_transition.te test_wait.te
+
+ifeq ($(shell [ $(POL_VERS) -ge 24 ] && echo true),true)
+TARGETS += test_bounds.te
 endif
 
 all: $(TARGETS)
 ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
 	$(MAKE) -C redhat/$(REDHAT_VERS) all
 else
-	@if [ -d $(POLICYDEVEL) ]; then \
+	@if [ -d $(POLDEV) ]; then \
 		mkdir -p test_policy; \
 		cp test_policy.if test_policy; \
-		set -e; rm -f test_policy.te; cat $(TARGETS) > test_policy/test_policy.te; \
-		cd test_policy && $(MAKE) -f $(POLICYDEVEL)/Makefile test_policy.pp; \
+		set -e; rm -f test_policy.te; \
+		cat $(TARGETS) > test_policy/test_policy.te; \
+		$(MAKE) -C test_policy -f $(POLDEV)/Makefile test_policy.pp; \
 	else \
 		echo "ERROR: You must have selinux-policy-devel installed."; \
 	fi
@@ -44,7 +48,7 @@ else
 	$(SEMODULE) -i test_policy/test_policy.pp
 endif
 
-unload:	
+unload:
 ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
 	$(MAKE) -C redhat/$(REDHAT_VERS) unload
 else
@@ -54,4 +58,3 @@ endif
 
 clean:
 	rm -rf test_policy tmp
-


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [selinux-testsuite RFC PATCH 3/4] test_policy: use RHEL instead of REDHAT in Makefile
  2013-09-24 16:33 [selinux-testsuite RFC PATCH 0/4] selinux-testsuite patches Paul Moore
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013) Paul Moore
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 2/4] test_policy: general Makefile cleanup Paul Moore
@ 2013-09-24 16:33 ` Paul Moore
  2013-09-24 16:53   ` Serge E. Hallyn
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 4/4] test_policy: create a "build" target Paul Moore
  3 siblings, 1 reply; 15+ messages in thread
From: Paul Moore @ 2013-09-24 16:33 UTC (permalink / raw)
  To: serge; +Cc: selinux

We also rework some of the if statements to make it easier to add
additional distributions, e.g. Fedora.

Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 policy/Makefile |   34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/policy/Makefile b/policy/Makefile
index 5dbb655..8763143 100644
--- a/policy/Makefile
+++ b/policy/Makefile
@@ -3,8 +3,8 @@ POLDEV = /usr/share/selinux/devel
 SEMODULE = /usr/sbin/semodule
 CHECKPOLICY = /usr/bin/checkpolicy
 
-REDHAT_RELEASE=$(shell rpm -q redhat-release)
-REDHAT_VERS=$(shell echo $(REDHAT_RELEASE) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
+RHEL_REL=$(shell rpm -q redhat-release)
+RHEL_VERS=$(shell echo $(RHEL_REL) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
 
 POL_VERS := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
 
@@ -26,9 +26,12 @@ TARGETS += test_bounds.te
 endif
 
 all: $(TARGETS)
-ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
-	$(MAKE) -C redhat/$(REDHAT_VERS) all
-else
+ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
+	# RHEL specific policy build
+	$(MAKE) -C redhat/$(RHEL_VERS) all \
+	exit $$?
+endif
+	# General policy build
 	@if [ -d $(POLDEV) ]; then \
 		mkdir -p test_policy; \
 		cp test_policy.if test_policy; \
@@ -38,23 +41,26 @@ else
 	else \
 		echo "ERROR: You must have selinux-policy-devel installed."; \
 	fi
-endif
 
 load: all
-ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
-	$(MAKE) -C redhat/$(REDHAT_VERS) load
-else
+ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
+	# RHEL specific policy load
+	$(MAKE) -C redhat/$(RHEL_VERS) load \
+	exit $$?
+endif
+	# General policy load
 	/usr/sbin/setsebool allow_domain_fd_use=0
 	$(SEMODULE) -i test_policy/test_policy.pp
-endif
 
 unload:
-ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
-	$(MAKE) -C redhat/$(REDHAT_VERS) unload
-else
+ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
+	# RHEL specific policy unload
+	$(MAKE) -C redhat/$(RHEL_VERS) unload \
+	exit $$?
+endif
+	# General policy unload
 	/usr/sbin/setsebool allow_domain_fd_use=1
 	$(SEMODULE) -r test_policy
-endif
 
 clean:
 	rm -rf test_policy tmp


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [selinux-testsuite RFC PATCH 4/4] test_policy: create a "build" target
  2013-09-24 16:33 [selinux-testsuite RFC PATCH 0/4] selinux-testsuite patches Paul Moore
                   ` (2 preceding siblings ...)
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 3/4] test_policy: use RHEL instead of REDHAT in Makefile Paul Moore
@ 2013-09-24 16:33 ` Paul Moore
  2013-09-24 16:53   ` Serge E. Hallyn
  3 siblings, 1 reply; 15+ messages in thread
From: Paul Moore @ 2013-09-24 16:33 UTC (permalink / raw)
  To: serge; +Cc: selinux

Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 policy/Makefile |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/policy/Makefile b/policy/Makefile
index 8763143..3a8a10d 100644
--- a/policy/Makefile
+++ b/policy/Makefile
@@ -25,7 +25,9 @@ ifeq ($(shell [ $(POL_VERS) -ge 24 ] && echo true),true)
 TARGETS += test_bounds.te
 endif
 
-all: $(TARGETS)
+all: build
+
+build: $(TARGETS)
 ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
 	# RHEL specific policy build
 	$(MAKE) -C redhat/$(RHEL_VERS) all \


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013)
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013) Paul Moore
@ 2013-09-24 16:49   ` Serge E. Hallyn
  2013-09-24 19:39     ` Paul Moore
  0 siblings, 1 reply; 15+ messages in thread
From: Serge E. Hallyn @ 2013-09-24 16:49 UTC (permalink / raw)
  To: Paul Moore; +Cc: serge, selinux

Quoting Paul Moore (pmoore@redhat.com):
> Signed-off-by: Paul Moore <pmoore@redhat.com>

Thanks, Paul!  This break had been reported to me and I got as far
as tracking it to its cause, but I hadn't yet figured out what to
replace it by.  I assume you're saying it's not strictly necessary :)
All the better.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>

> ---
>  policy/test_global.te |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/policy/test_global.te b/policy/test_global.te
> index 3891f6e..49c85b1 100644
> --- a/policy/test_global.te
> +++ b/policy/test_global.te
> @@ -5,6 +5,7 @@ policy_module(test_policy,1.0.0)
>  #
>  # Declarations
>  #
> +
>  attribute testdomain;
>  
>  gen_require(`
> @@ -34,8 +35,8 @@ miscfiles_read_test_files(testdomain)
>  
>  # Let the test domains set their current, exec and fscreate contexts.
>  allow testdomain self:process setcurrent;
> -# domain_dyntrans_type(testdomain)
> -selinux_get_fs_mount(testdomain)
> +#domain_dyntrans_type(testdomain)
> +#selinux_get_fs_mount(testdomain)
>  allow testdomain self:process setexec;
>  allow testdomain self:process setfscreate;
>  

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [selinux-testsuite RFC PATCH 2/4] test_policy: general Makefile cleanup
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 2/4] test_policy: general Makefile cleanup Paul Moore
@ 2013-09-24 16:52   ` Serge E. Hallyn
  0 siblings, 0 replies; 15+ messages in thread
From: Serge E. Hallyn @ 2013-09-24 16:52 UTC (permalink / raw)
  To: Paul Moore; +Cc: serge, selinux

Quoting Paul Moore (pmoore@redhat.com):
> Signed-off-by: Paul Moore <pmoore@redhat.com>

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>

> ---
>  policy/Makefile |   51 +++++++++++++++++++++++++++------------------------
>  1 file changed, 27 insertions(+), 24 deletions(-)
> 
> diff --git a/policy/Makefile b/policy/Makefile
> index 6fb9578..5dbb655 100644
> --- a/policy/Makefile
> +++ b/policy/Makefile
> @@ -1,36 +1,40 @@
> -REDHAT_RELEASE=$(shell rpm -q redhat-release)
> -REDHAT_VERS=$(shell echo $(REDHAT_RELEASE) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
>  
> -POLICYDEVEL = /usr/share/selinux/devel
> +POLDEV = /usr/share/selinux/devel
>  SEMODULE = /usr/sbin/semodule
>  CHECKPOLICY = /usr/bin/checkpolicy
> -VERS := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
> -
> -TARGETS=test_global.te test_capable_file.te test_capable_net.te \
> -test_capable_sys.te test_dyntrace.te test_dyntrans.te test_entrypoint.te \
> -test_execshare.te test_exectrace.te test_execute_no_trans.te \
> -test_fdreceive.te test_file.te test_inherit.te test_ioctl.te test_ipc.te \
> -test_link.te test_mkdir.te test_open.te test_ptrace.te test_readlink.te \
> -test_relabel.te test_rename.te test_rxdir.te test_setattr.te test_setnice.te \
> -test_sigkill.te test_stat.te test_sysctl.te test_task_create.te \
> -test_task_getpgid.te test_task_getsched.te test_task_getsid.te \
> -test_task_setpgid.te test_task_setsched.te test_transition.te test_wait.te
> -
> -VERS_GE_24 := $(shell [ $(VERS) -ge 24 ] && echo true )
> -
> -ifeq ($(VERS_GE_24),true)
> -TARGETS+= test_bounds.te
> +
> +REDHAT_RELEASE=$(shell rpm -q redhat-release)
> +REDHAT_VERS=$(shell echo $(REDHAT_RELEASE) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
> +
> +POL_VERS := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
> +
> +TARGETS = \
> +	test_global.te test_capable_file.te test_capable_net.te \
> +	test_capable_sys.te test_dyntrace.te test_dyntrans.te \
> +	test_entrypoint.te test_execshare.te test_exectrace.te \
> +	test_execute_no_trans.te test_fdreceive.te test_file.te \
> +	test_inherit.te test_ioctl.te test_ipc.te test_link.te test_mkdir.te \
> +	test_open.te test_ptrace.te test_readlink.te \
> +	test_relabel.te test_rename.te test_rxdir.te test_setattr.te \
> +	test_setnice.te test_sigkill.te test_stat.te test_sysctl.te \
> +	test_task_create.te test_task_getpgid.te test_task_getsched.te \
> +	test_task_getsid.te test_task_setpgid.te test_task_setsched.te \
> +	test_transition.te test_wait.te
> +
> +ifeq ($(shell [ $(POL_VERS) -ge 24 ] && echo true),true)
> +TARGETS += test_bounds.te
>  endif
>  
>  all: $(TARGETS)
>  ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
>  	$(MAKE) -C redhat/$(REDHAT_VERS) all
>  else
> -	@if [ -d $(POLICYDEVEL) ]; then \
> +	@if [ -d $(POLDEV) ]; then \
>  		mkdir -p test_policy; \
>  		cp test_policy.if test_policy; \
> -		set -e; rm -f test_policy.te; cat $(TARGETS) > test_policy/test_policy.te; \
> -		cd test_policy && $(MAKE) -f $(POLICYDEVEL)/Makefile test_policy.pp; \
> +		set -e; rm -f test_policy.te; \
> +		cat $(TARGETS) > test_policy/test_policy.te; \
> +		$(MAKE) -C test_policy -f $(POLDEV)/Makefile test_policy.pp; \
>  	else \
>  		echo "ERROR: You must have selinux-policy-devel installed."; \
>  	fi
> @@ -44,7 +48,7 @@ else
>  	$(SEMODULE) -i test_policy/test_policy.pp
>  endif
>  
> -unload:	
> +unload:
>  ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
>  	$(MAKE) -C redhat/$(REDHAT_VERS) unload
>  else
> @@ -54,4 +58,3 @@ endif
>  
>  clean:
>  	rm -rf test_policy tmp
> -

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [selinux-testsuite RFC PATCH 3/4] test_policy: use RHEL instead of REDHAT in Makefile
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 3/4] test_policy: use RHEL instead of REDHAT in Makefile Paul Moore
@ 2013-09-24 16:53   ` Serge E. Hallyn
  0 siblings, 0 replies; 15+ messages in thread
From: Serge E. Hallyn @ 2013-09-24 16:53 UTC (permalink / raw)
  To: Paul Moore; +Cc: serge, selinux

Quoting Paul Moore (pmoore@redhat.com):
> We also rework some of the if statements to make it easier to add
> additional distributions, e.g. Fedora.
> 
> Signed-off-by: Paul Moore <pmoore@redhat.com>

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>

> ---
>  policy/Makefile |   34 ++++++++++++++++++++--------------
>  1 file changed, 20 insertions(+), 14 deletions(-)
> 
> diff --git a/policy/Makefile b/policy/Makefile
> index 5dbb655..8763143 100644
> --- a/policy/Makefile
> +++ b/policy/Makefile
> @@ -3,8 +3,8 @@ POLDEV = /usr/share/selinux/devel
>  SEMODULE = /usr/sbin/semodule
>  CHECKPOLICY = /usr/bin/checkpolicy
>  
> -REDHAT_RELEASE=$(shell rpm -q redhat-release)
> -REDHAT_VERS=$(shell echo $(REDHAT_RELEASE) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
> +RHEL_REL=$(shell rpm -q redhat-release)
> +RHEL_VERS=$(shell echo $(RHEL_REL) | cut -f3 -d"-" | sed -e "s/[^0-9]*//g")
>  
>  POL_VERS := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
>  
> @@ -26,9 +26,12 @@ TARGETS += test_bounds.te
>  endif
>  
>  all: $(TARGETS)
> -ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
> -	$(MAKE) -C redhat/$(REDHAT_VERS) all
> -else
> +ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
> +	# RHEL specific policy build
> +	$(MAKE) -C redhat/$(RHEL_VERS) all \
> +	exit $$?
> +endif
> +	# General policy build
>  	@if [ -d $(POLDEV) ]; then \
>  		mkdir -p test_policy; \
>  		cp test_policy.if test_policy; \
> @@ -38,23 +41,26 @@ else
>  	else \
>  		echo "ERROR: You must have selinux-policy-devel installed."; \
>  	fi
> -endif
>  
>  load: all
> -ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
> -	$(MAKE) -C redhat/$(REDHAT_VERS) load
> -else
> +ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
> +	# RHEL specific policy load
> +	$(MAKE) -C redhat/$(RHEL_VERS) load \
> +	exit $$?
> +endif
> +	# General policy load
>  	/usr/sbin/setsebool allow_domain_fd_use=0
>  	$(SEMODULE) -i test_policy/test_policy.pp
> -endif
>  
>  unload:
> -ifeq (x$(REDHAT_VERS),$(filter x$(REDHAT_VERS),x4 x5))
> -	$(MAKE) -C redhat/$(REDHAT_VERS) unload
> -else
> +ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
> +	# RHEL specific policy unload
> +	$(MAKE) -C redhat/$(RHEL_VERS) unload \
> +	exit $$?
> +endif
> +	# General policy unload
>  	/usr/sbin/setsebool allow_domain_fd_use=1
>  	$(SEMODULE) -r test_policy
> -endif
>  
>  clean:
>  	rm -rf test_policy tmp

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [selinux-testsuite RFC PATCH 4/4] test_policy: create a "build" target
  2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 4/4] test_policy: create a "build" target Paul Moore
@ 2013-09-24 16:53   ` Serge E. Hallyn
  0 siblings, 0 replies; 15+ messages in thread
From: Serge E. Hallyn @ 2013-09-24 16:53 UTC (permalink / raw)
  To: Paul Moore; +Cc: serge, selinux

Quoting Paul Moore (pmoore@redhat.com):
> Signed-off-by: Paul Moore <pmoore@redhat.com>

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>

> ---
>  policy/Makefile |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/policy/Makefile b/policy/Makefile
> index 8763143..3a8a10d 100644
> --- a/policy/Makefile
> +++ b/policy/Makefile
> @@ -25,7 +25,9 @@ ifeq ($(shell [ $(POL_VERS) -ge 24 ] && echo true),true)
>  TARGETS += test_bounds.te
>  endif
>  
> -all: $(TARGETS)
> +all: build
> +
> +build: $(TARGETS)
>  ifeq (x$(RHEL_VERS),$(filter x$(RHEL_VERS),x4 x5))
>  	# RHEL specific policy build
>  	$(MAKE) -C redhat/$(RHEL_VERS) all \

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013)
  2013-09-24 16:49   ` Serge E. Hallyn
@ 2013-09-24 19:39     ` Paul Moore
  2013-09-25 21:31       ` Serge E. Hallyn
  2013-09-26 18:48       ` Serge E. Hallyn
  0 siblings, 2 replies; 15+ messages in thread
From: Paul Moore @ 2013-09-24 19:39 UTC (permalink / raw)
  To: Serge E. Hallyn; +Cc: selinux

On Tuesday, September 24, 2013 04:49:25 PM Serge E. Hallyn wrote:
> Quoting Paul Moore (pmoore@redhat.com):
> > Signed-off-by: Paul Moore <pmoore@redhat.com>
> 
> Thanks, Paul!  This break had been reported to me and I got as far
> as tracking it to its cause, but I hadn't yet figured out what to
> replace it by.

No problem.

> I assume you're saying it's not strictly necessary :) All the better.

Well, I guess what I'm trying to say is that I'm not sure if this is the right 
fix, but it does at least resolve the build problems I'm seeing.  I have yet 
to check to see if it works correctly.

> Acked-by: Serge Hallyn <serge.hallyn@canonical.com>

Ack?  I thought you were the one maintaining the test suite?

> > ---
> > 
> >  policy/test_global.te |    5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/policy/test_global.te b/policy/test_global.te
> > index 3891f6e..49c85b1 100644
> > --- a/policy/test_global.te
> > +++ b/policy/test_global.te
> > @@ -5,6 +5,7 @@ policy_module(test_policy,1.0.0)
> > 
> >  #
> >  # Declarations
> >  #
> > 
> > +
> > 
> >  attribute testdomain;
> >  
> >  gen_require(`
> > 
> > @@ -34,8 +35,8 @@ miscfiles_read_test_files(testdomain)
> > 
> >  # Let the test domains set their current, exec and fscreate contexts.
> >  allow testdomain self:process setcurrent;
> > 
> > -# domain_dyntrans_type(testdomain)
> > -selinux_get_fs_mount(testdomain)
> > +#domain_dyntrans_type(testdomain)
> > +#selinux_get_fs_mount(testdomain)
> > 
> >  allow testdomain self:process setexec;
> >  allow testdomain self:process setfscreate;

-- 
paul moore
security and virtualization @ redhat


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013)
  2013-09-24 19:39     ` Paul Moore
@ 2013-09-25 21:31       ` Serge E. Hallyn
  2013-09-25 22:19         ` Paul Moore
  2013-09-26 18:48       ` Serge E. Hallyn
  1 sibling, 1 reply; 15+ messages in thread
From: Serge E. Hallyn @ 2013-09-25 21:31 UTC (permalink / raw)
  To: Paul Moore; +Cc: Serge E. Hallyn, selinux

Quoting Paul Moore (pmoore@redhat.com):
> On Tuesday, September 24, 2013 04:49:25 PM Serge E. Hallyn wrote:
> > Quoting Paul Moore (pmoore@redhat.com):
> > > Signed-off-by: Paul Moore <pmoore@redhat.com>
> > 
> > Thanks, Paul!  This break had been reported to me and I got as far
> > as tracking it to its cause, but I hadn't yet figured out what to
> > replace it by.
> 
> No problem.
> 
> > I assume you're saying it's not strictly necessary :) All the better.
> 
> Well, I guess what I'm trying to say is that I'm not sure if this is the right 
> fix, but it does at least resolve the build problems I'm seeing.  I have yet 
> to check to see if it works correctly.
> 
> > Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> 
> Ack?  I thought you were the one maintaining the test suite?

Yes, that's me saying I'll apply that.

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013)
  2013-09-25 21:31       ` Serge E. Hallyn
@ 2013-09-25 22:19         ` Paul Moore
  2013-09-27 18:15           ` Serge E. Hallyn
  0 siblings, 1 reply; 15+ messages in thread
From: Paul Moore @ 2013-09-25 22:19 UTC (permalink / raw)
  To: Serge E. Hallyn; +Cc: selinux

On Wednesday, September 25, 2013 09:31:28 PM Serge E. Hallyn wrote:
> Quoting Paul Moore (pmoore@redhat.com):
> > On Tuesday, September 24, 2013 04:49:25 PM Serge E. Hallyn wrote:
> > > Quoting Paul Moore (pmoore@redhat.com):
> > > > Signed-off-by: Paul Moore <pmoore@redhat.com>
> > > 
> > > Thanks, Paul!  This break had been reported to me and I got as far
> > > as tracking it to its cause, but I hadn't yet figured out what to
> > > replace it by.
> > 
> > No problem.
> > 
> > > I assume you're saying it's not strictly necessary :) All the better.
> > 
> > Well, I guess what I'm trying to say is that I'm not sure if this is the
> > right fix, but it does at least resolve the build problems I'm seeing.  I
> > have yet to check to see if it works correctly.
> > 
> > > Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> > 
> > Ack?  I thought you were the one maintaining the test suite?
> 
> Yes, that's me saying I'll apply that.

Great, thanks.

-- 
paul moore
security and virtualization @ redhat


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013)
  2013-09-24 19:39     ` Paul Moore
  2013-09-25 21:31       ` Serge E. Hallyn
@ 2013-09-26 18:48       ` Serge E. Hallyn
  1 sibling, 0 replies; 15+ messages in thread
From: Serge E. Hallyn @ 2013-09-26 18:48 UTC (permalink / raw)
  To: Paul Moore; +Cc: Serge E. Hallyn, selinux

Quoting Paul Moore (pmoore@redhat.com):
> On Tuesday, September 24, 2013 04:49:25 PM Serge E. Hallyn wrote:
> > Quoting Paul Moore (pmoore@redhat.com):
> > > Signed-off-by: Paul Moore <pmoore@redhat.com>
> > 
> > Thanks, Paul!  This break had been reported to me and I got as far
> > as tracking it to its cause, but I hadn't yet figured out what to
> > replace it by.
> 
> No problem.
> 
> > I assume you're saying it's not strictly necessary :) All the better.
> 
> Well, I guess what I'm trying to say is that I'm not sure if this is the right 
> fix, but it does at least resolve the build problems I'm seeing.  I have yet 
> to check to see if it works correctly.

(I'm hoping to work on that tomorrow, fwiw)

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013)
  2013-09-25 22:19         ` Paul Moore
@ 2013-09-27 18:15           ` Serge E. Hallyn
  2013-09-27 18:27             ` Paul Moore
  0 siblings, 1 reply; 15+ messages in thread
From: Serge E. Hallyn @ 2013-09-27 18:15 UTC (permalink / raw)
  To: Paul Moore; +Cc: selinux

Quoting Paul Moore (pmoore@redhat.com):
> On Wednesday, September 25, 2013 09:31:28 PM Serge E. Hallyn wrote:
> > Quoting Paul Moore (pmoore@redhat.com):
> > > On Tuesday, September 24, 2013 04:49:25 PM Serge E. Hallyn wrote:
> > > > Quoting Paul Moore (pmoore@redhat.com):
> > > > > Signed-off-by: Paul Moore <pmoore@redhat.com>
> > > > 
> > > > Thanks, Paul!  This break had been reported to me and I got as far
> > > > as tracking it to its cause, but I hadn't yet figured out what to
> > > > replace it by.
> > > 
> > > No problem.
> > > 
> > > > I assume you're saying it's not strictly necessary :) All the better.
> > > 
> > > Well, I guess what I'm trying to say is that I'm not sure if this is the
> > > right fix, but it does at least resolve the build problems I'm seeing.  I
> > > have yet to check to see if it works correctly.
> > > 
> > > > Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> > > 
> > > Ack?  I thought you were the one maintaining the test suite?
> > 
> > Yes, that's me saying I'll apply that.
> 
> Great, thanks.

Thanks, Paul, all tests passed (on f19) with your patches!

-serge

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013)
  2013-09-27 18:15           ` Serge E. Hallyn
@ 2013-09-27 18:27             ` Paul Moore
  0 siblings, 0 replies; 15+ messages in thread
From: Paul Moore @ 2013-09-27 18:27 UTC (permalink / raw)
  To: Serge E. Hallyn; +Cc: selinux

On Friday, September 27, 2013 06:15:30 PM Serge E. Hallyn wrote:
> Quoting Paul Moore (pmoore@redhat.com):
> > On Wednesday, September 25, 2013 09:31:28 PM Serge E. Hallyn wrote:
> > > Quoting Paul Moore (pmoore@redhat.com):
> > > > On Tuesday, September 24, 2013 04:49:25 PM Serge E. Hallyn wrote:
> > > > > Quoting Paul Moore (pmoore@redhat.com):
> > > > > > Signed-off-by: Paul Moore <pmoore@redhat.com>
> > > > > 
> > > > > Thanks, Paul!  This break had been reported to me and I got as far
> > > > > as tracking it to its cause, but I hadn't yet figured out what to
> > > > > replace it by.
> > > > 
> > > > No problem.
> > > > 
> > > > > I assume you're saying it's not strictly necessary :) All the
> > > > > better.
> > > > 
> > > > Well, I guess what I'm trying to say is that I'm not sure if this is
> > > > the
> > > > right fix, but it does at least resolve the build problems I'm seeing.
> > > >  I
> > > > have yet to check to see if it works correctly.
> > > > 
> > > > > Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
> > > > 
> > > > Ack?  I thought you were the one maintaining the test suite?
> > > 
> > > Yes, that's me saying I'll apply that.
> > 
> > Great, thanks.
> 
> Thanks, Paul, all tests passed (on f19) with your patches!

Great, glad they worked for you too.

-- 
paul moore
security and virtualization @ redhat


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-09-27 18:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-24 16:33 [selinux-testsuite RFC PATCH 0/4] selinux-testsuite patches Paul Moore
2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 1/4] test_policy: test_global.te fix for Fedora Rawhide (Sept 24th, 2013) Paul Moore
2013-09-24 16:49   ` Serge E. Hallyn
2013-09-24 19:39     ` Paul Moore
2013-09-25 21:31       ` Serge E. Hallyn
2013-09-25 22:19         ` Paul Moore
2013-09-27 18:15           ` Serge E. Hallyn
2013-09-27 18:27             ` Paul Moore
2013-09-26 18:48       ` Serge E. Hallyn
2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 2/4] test_policy: general Makefile cleanup Paul Moore
2013-09-24 16:52   ` Serge E. Hallyn
2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 3/4] test_policy: use RHEL instead of REDHAT in Makefile Paul Moore
2013-09-24 16:53   ` Serge E. Hallyn
2013-09-24 16:33 ` [selinux-testsuite RFC PATCH 4/4] test_policy: create a "build" target Paul Moore
2013-09-24 16:53   ` Serge E. Hallyn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.