From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 6 Nov 2015 16:44:47 -0500 (EST) From: Jan Stancek To: Paul Moore Cc: selinux@tycho.nsa.gov, Stephen Smalley Message-ID: <1815745045.4800143.1446846287294.JavaMail.zimbra@redhat.com> In-Reply-To: References: Subject: Re: [selinux-testsuite PATCH 1/4] tests/inet_socket: check 'ip xfrm policy ctx' support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: ----- Original Message ----- > From: "Paul Moore" > To: "Jan Stancek" > Cc: selinux@tycho.nsa.gov, "Stephen Smalley" > 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 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 > > Cc: Paul Moore > > Cc: Stephen Smalley > > --- > > 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 >