On Tue, Jan 19, 2021 at 5:10 PM Paul Moore <paul@xxxxxxxxxxxxxx> wrote: > On Tue, Jan 19, 2021 at 8:24 AM Ondrej Mosnacek <omosnace@xxxxxxxxxx> wrote: > > > > 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@xxxxxxxxxx> > > --- > > 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 > > Why not just do '-make -C tests test' instead? Then the exit code would be 0 regardless of whether the tests passed or failed. -- Ondrej Mosnacek Software Engineer, Platform Security - SELinux kernel Red Hat, Inc.