From: Jan Stancek <jstancek@redhat.com>
To: Paul Moore <paul@paul-moore.com>
Cc: selinux@tycho.nsa.gov, Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [selinux-testsuite PATCH 1/4] tests/inet_socket: check 'ip xfrm policy ctx' support
Date: Fri, 6 Nov 2015 16:44:47 -0500 (EST) [thread overview]
Message-ID: <1815745045.4800143.1446846287294.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAHC9VhQBOmybowY2H4rR3E6xoz-F21Ak3VQ61Y3O8GgwepjPsQ@mail.gmail.com>
----- Original Message -----
> From: "Paul Moore" <paul@paul-moore.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: selinux@tycho.nsa.gov, "Stephen Smalley" <sds@tycho.nsa.gov>
> Sent: Friday, 6 November, 2015 6:58:38 PM
> Subject: Re: [selinux-testsuite PATCH 1/4] tests/inet_socket: check 'ip xfrm policy ctx' support
>
> On Fri, Nov 6, 2015 at 8:07 AM, Jan Stancek <jstancek@redhat.com> wrote:
> > Early RHEL6 distros like RHEL6.0 do not support "ctx" parameter,
> > which is causing test to fail:
> > Error: argument "ctx" is wrong: unknown
> >
> > Signed-off-by: Jan Stancek <jstancek@redhat.com>
> > Cc: Paul Moore <paul@paul-moore.com>
> > Cc: Stephen Smalley <sds@tycho.nsa.gov>
> > ---
> > tests/inet_socket/test | 31 +++++++++++++++++++------------
> > 1 file changed, 19 insertions(+), 12 deletions(-)
> >
> > diff --git a/tests/inet_socket/test b/tests/inet_socket/test
> > index 4deca746208c..4f6ee51cec5c 100755
> > --- a/tests/inet_socket/test
> > +++ b/tests/inet_socket/test
> > @@ -1,7 +1,14 @@
> > #!/usr/bin/perl
> > -
> > -use Test;
> > -BEGIN { plan tests => 20}
> > +use Test::More;
> > +
> > +BEGIN {
> > + # check if ip xfrm supports ctx parameter
> > + if (system("ip xfrm policy help 2>&1 | grep ctx") != 0) {
> > + plan skip_all => "ctx not supported in ip xfrm policy";
> > + } else {
> > + plan tests => 20;
> > + }
> > +}
> >
> > $basedir = $0; $basedir =~ s|(.*)/[^/]*|$1|;
> >
> > @@ -17,7 +24,7 @@ sleep 1; # Give it a moment to initialize.
> >
> > # Verify that authorized client can communicate with the server.
> > $result = system "runcon -t test_inet_client_t $basedir/client stream
> > 65535";
> > -ok($result, 0);
> > +ok($result eq 0);
>
> My understanding of Perl is *very* basic - why this change (and the
> similar ones in this patch)?
I wanted to skip the test, but skip_all is supported only in Test::More
framework. And arguments in ok() have slightly different meaning.
In "Test" args are "ok($have, $expect);" [1]
In "Test::More" args are "ok($got eq $expected, $test_name);" [2]
This change adapts parameters to "Test::More" style.
[1] http://perldoc.perl.org/Test.html
[2] http://perldoc.perl.org/Test/More.html
>
> --
> paul moore
> www.paul-moore.com
>
next prev parent reply other threads:[~2015-11-06 21:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 13:07 [selinux-testsuite PATCH 0/4] inet_socket and mmap patches Jan Stancek
2015-11-06 13:07 ` [selinux-testsuite PATCH 1/4] tests/inet_socket: check 'ip xfrm policy ctx' support Jan Stancek
2015-11-06 17:58 ` Paul Moore
2015-11-06 21:44 ` Jan Stancek [this message]
2015-11-19 21:04 ` Paul Moore
2015-11-06 13:07 ` [selinux-testsuite PATCH 2/4] inet_socket: secon: use current pid Jan Stancek
2015-11-06 18:07 ` Paul Moore
2015-11-06 13:07 ` [selinux-testsuite PATCH 3/4] mmap/mprotect_heap: make sure memory is allocated from heap Jan Stancek
2015-11-06 18:14 ` Paul Moore
2015-11-06 21:57 ` Jan Stancek
2015-11-16 9:46 ` [selinux-testsuite PATCH v2 " Jan Stancek
2015-11-19 20:46 ` Paul Moore
2015-11-06 13:07 ` [selinux-testsuite PATCH 4/4] mmap/mprotect_file_private_execmod: clear READ_IMPLIES_EXEC Jan Stancek
2015-11-06 18:25 ` Paul Moore
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=1815745045.4800143.1446846287294.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=paul@paul-moore.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
/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 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.