projects
/
linux-seccomp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
03d6d32
)
Skip functionality test if seccomp_load returns -EINVAL
author
Marius Gavrilescu
<marius@ieval.ro>
Fri, 25 Nov 2016 16:05:55 +0000
(16:05 +0000)
committer
Marius Gavrilescu
<marius@ieval.ro>
Fri, 25 Nov 2016 16:05:55 +0000
(16:05 +0000)
t/Linux-Seccomp.t
patch
|
blob
|
blame
|
history
diff --git
a/t/Linux-Seccomp.t
b/t/Linux-Seccomp.t
index b42df87deaf4607e6c6429a77545d61412c1f194..ee1737f939dfc0c28de96c33933e6caf6834f081 100644
(file)
--- a/
t/Linux-Seccomp.t
+++ b/
t/Linux-Seccomp.t
@@
-2,6
+2,7
@@
use strict;
use warnings;
use strict;
use warnings;
+use Errno qw/EINVAL/;
use Test::More tests => 4;
BEGIN { use_ok('Linux::Seccomp', ':all') };
use Test::More tests => 4;
BEGIN { use_ok('Linux::Seccomp', ':all') };
@@
-123,14
+124,19
@@
foreach my $constname (qw(
ok( $fail == 0 , 'Constants' );
ok( $fail == 0 , 'Constants' );
+is_deeply version, [2, 3, 1], 'library version is 2.3.1';
+
my $got_sigsys = 0;
$SIG{SYS} = sub { $got_sigsys = 1 };
my $ctx = Linux::Seccomp->new(SCMP_ACT_ALLOW);
$ctx->rule_add(SCMP_ACT_TRAP, syscall_resolve_name('mkdir'));
my $got_sigsys = 0;
$SIG{SYS} = sub { $got_sigsys = 1 };
my $ctx = Linux::Seccomp->new(SCMP_ACT_ALLOW);
$ctx->rule_add(SCMP_ACT_TRAP, syscall_resolve_name('mkdir'));
-$ctx->load;
+
my $result =
$ctx->load;
-is_deeply version, [2, 3, 1], 'library version is 2.3.1';
+SKIP: {
+ skip 'loading filter fails with EINVAL -- does your kernel have CONFIG_SECCOMP_FILTER=y?'
+ if $result == -EINVAL;
-mkdir 'testdir';
-ok $got_sigsys, 'filter with SCMP_ACT_TRAP on mkdir() works';
+ mkdir 'testdir';
+ ok $got_sigsys, 'filter with SCMP_ACT_TRAP on mkdir() works';
+}
This page took
0.011699 seconds
and
4
git commands to generate.