selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH testsuite] Makefile: unload policy when testsuite fails
@ 2021-01-19  9:06 Ondrej Mosnacek
  2021-01-19 16:10 ` Paul Moore
  2021-01-19 16:37 ` Stephen Smalley
  0 siblings, 2 replies; 6+ messages in thread
From: Ondrej Mosnacek @ 2021-01-19  9:06 UTC (permalink / raw)
  To: selinux

Make sure that the test policy is properly unloaded when `make test`
fails, to prevent it from accidentally lingering on the system after a
failed test.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 9081406..8efe15c 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,11 @@ all:
 
 test:
 	make -C policy load
-	make -C tests test
+	make -C tests test || { \
+		res=$$?; \
+		make -C policy unload; \
+		exit $$res; \
+	}
 	make -C policy unload
 
 check-syntax:
-- 
2.29.2


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

end of thread, other threads:[~2021-01-20 12:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19  9:06 [PATCH testsuite] Makefile: unload policy when testsuite fails Ondrej Mosnacek
2021-01-19 16:10 ` Paul Moore
2021-01-19 16:25   ` Ondrej Mosnacek
2021-01-19 16:36     ` Paul Moore
2021-01-19 16:37 ` Stephen Smalley
2021-01-20 10:26   ` Ondrej Mosnacek

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).