selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul@paul-moore.com>
To: Ondrej Mosnacek <omosnace@redhat.com>
Cc: SElinux list <selinux@vger.kernel.org>
Subject: Re: [PATCH testsuite] Makefile: unload policy when testsuite fails
Date: Tue, 19 Jan 2021 11:36:23 -0500	[thread overview]
Message-ID: <CAHC9VhT5Z0HjbTa7Gci73cLOvQST7is91F8PE5voXy3eUQTEow@mail.gmail.com> (raw)
In-Reply-To: <CAFqZXNtwkrtvcG_OAHOEXh2yczxMvHZ47EX_oAWzwTRA7Zowiw@mail.gmail.com>

On Tue, Jan 19, 2021 at 11:25 AM Ondrej Mosnacek <omosnace@redhat.com> wrote:
> On Tue, Jan 19, 2021 at 5:10 PM Paul Moore <paul@paul-moore.com> wrote:
> > On Tue, Jan 19, 2021 at 8:24 AM Ondrej Mosnacek <omosnace@redhat.com> 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@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
> >
> > Why not just do '-make -C tests test' instead?
>
> Then the exit code would be 0 regardless of whether the tests passed or failed.

Good point ;)

-- 
paul moore
www.paul-moore.com

  reply	other threads:[~2021-01-19 18:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-01-19 16:37 ` Stephen Smalley
2021-01-20 10:26   ` Ondrej Mosnacek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHC9VhT5Z0HjbTa7Gci73cLOvQST7is91F8PE5voXy3eUQTEow@mail.gmail.com \
    --to=paul@paul-moore.com \
    --cc=omosnace@redhat.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).