selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] secilc: consider DESTDIR in tests
@ 2023-06-02 13:06 Christian Göttsche
  2023-06-02 13:06 ` [PATCH 2/2] libsemanage/tests: consider DESTDIR Christian Göttsche
  2023-06-02 14:28 ` [PATCH 1/2] secilc: consider DESTDIR in tests Petr Lautrbach
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Göttsche @ 2023-06-02 13:06 UTC (permalink / raw)
  To: selinux

Use the script `env_use_destdir` to preload libsepol from the DESTDIR
location to support development changes like policy version bumps.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 secilc/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/secilc/Makefile b/secilc/Makefile
index 94be0481..5a85df67 100644
--- a/secilc/Makefile
+++ b/secilc/Makefile
@@ -34,9 +34,9 @@ $(SECILC): $(SECILC_OBJS)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
 
 test: $(SECILC)
-	./$(SECILC) test/policy.cil
-	./$(SECILC) -c $(POL_VERS) -O -M 1 -f /dev/null -o opt-actual.bin test/opt-input.cil
-	$(CHECKPOLICY) -b -C -M -o opt-actual.cil opt-actual.bin >/dev/null
+	../scripts/env_use_destdir ./$(SECILC) test/policy.cil
+	../scripts/env_use_destdir ./$(SECILC) -c $(POL_VERS) -O -M 1 -f /dev/null -o opt-actual.bin test/opt-input.cil
+	../scripts/env_use_destdir $(CHECKPOLICY) -b -C -M -o opt-actual.cil opt-actual.bin >/dev/null
 	$(DIFF) test/opt-expected.cil opt-actual.cil
 
 $(SECIL2CONF): $(SECIL2CONF_OBJS)
-- 
2.40.1


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

* [PATCH 2/2] libsemanage/tests: consider DESTDIR
  2023-06-02 13:06 [PATCH 1/2] secilc: consider DESTDIR in tests Christian Göttsche
@ 2023-06-02 13:06 ` Christian Göttsche
  2023-06-02 14:28 ` [PATCH 1/2] secilc: consider DESTDIR in tests Petr Lautrbach
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Göttsche @ 2023-06-02 13:06 UTC (permalink / raw)
  To: selinux

Use the script `env_use_destdir` to preload libsepol and libsemanage
from the DESTDIR location to support development changes like policy
version bumps.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 libsemanage/tests/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libsemanage/tests/Makefile b/libsemanage/tests/Makefile
index 69f49a36..00f2fcf8 100644
--- a/libsemanage/tests/Makefile
+++ b/libsemanage/tests/Makefile
@@ -18,11 +18,11 @@ $(EXECUTABLE): $(OBJECTS) ../src/libsemanage.a
 	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
 
 %.policy: %.cil
-	../../secilc/secilc $*.cil -o $*.policy -f /dev/null
+	../../scripts/env_use_destdir ../../secilc/secilc $*.cil -o $*.policy -f /dev/null
 
 clean distclean: 
 	rm -rf $(OBJECTS) $(POLICIES) $(EXECUTABLE)
 
 test: all 
-	./$(EXECUTABLE)
+	../../scripts/env_use_destdir ./$(EXECUTABLE)
 
-- 
2.40.1


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

* Re: [PATCH 1/2] secilc: consider DESTDIR in tests
  2023-06-02 13:06 [PATCH 1/2] secilc: consider DESTDIR in tests Christian Göttsche
  2023-06-02 13:06 ` [PATCH 2/2] libsemanage/tests: consider DESTDIR Christian Göttsche
@ 2023-06-02 14:28 ` Petr Lautrbach
  1 sibling, 0 replies; 3+ messages in thread
From: Petr Lautrbach @ 2023-06-02 14:28 UTC (permalink / raw)
  To: Christian Göttsche, selinux

Christian Göttsche <cgzones@googlemail.com> writes:

> Use the script `env_use_destdir` to preload libsepol from the DESTDIR
> location to support development changes like policy version bumps.
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>

It would not work when run from secilc-...tar.gz sources. In such case I
would expect that the environment is already prepared from outside.


> ---
>  secilc/Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/secilc/Makefile b/secilc/Makefile
> index 94be0481..5a85df67 100644
> --- a/secilc/Makefile
> +++ b/secilc/Makefile
> @@ -34,9 +34,9 @@ $(SECILC): $(SECILC_OBJS)
>  	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
>  
>  test: $(SECILC)
> -	./$(SECILC) test/policy.cil
> -	./$(SECILC) -c $(POL_VERS) -O -M 1 -f /dev/null -o opt-actual.bin test/opt-input.cil
> -	$(CHECKPOLICY) -b -C -M -o opt-actual.cil opt-actual.bin >/dev/null
> +	../scripts/env_use_destdir ./$(SECILC) test/policy.cil
> +	../scripts/env_use_destdir ./$(SECILC) -c $(POL_VERS) -O -M 1 -f /dev/null -o opt-actual.bin test/opt-input.cil
> +	../scripts/env_use_destdir $(CHECKPOLICY) -b -C -M -o opt-actual.cil opt-actual.bin >/dev/null
>  	$(DIFF) test/opt-expected.cil opt-actual.cil
>  
>  $(SECIL2CONF): $(SECIL2CONF_OBJS)
> -- 
> 2.40.1


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

end of thread, other threads:[~2023-06-02 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 13:06 [PATCH 1/2] secilc: consider DESTDIR in tests Christian Göttsche
2023-06-02 13:06 ` [PATCH 2/2] libsemanage/tests: consider DESTDIR Christian Göttsche
2023-06-02 14:28 ` [PATCH 1/2] secilc: consider DESTDIR in tests Petr Lautrbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).