projects
/
linux-seccomp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0f2e096
)
Add a simple test of essential functionality
author
Marius Gavrilescu
<marius@ieval.ro>
Sat, 19 Nov 2016 20:06:05 +0000
(20:06 +0000)
committer
Marius Gavrilescu
<marius@ieval.ro>
Sat, 19 Nov 2016 20:06:05 +0000
(20:06 +0000)
t/Linux-Seccomp.t
patch
|
blob
|
blame
|
history
diff --git
a/t/Linux-Seccomp.t
b/t/Linux-Seccomp.t
index 771d41e4851f9b92e87d98b8bb3975360cfa1c91..954b2cce2926b06598e0219b2e60d31a6ab810a8 100644
(file)
--- a/
t/Linux-Seccomp.t
+++ b/
t/Linux-Seccomp.t
@@
-2,8
+2,8
@@
use strict;
use warnings;
use strict;
use warnings;
-use Test::More tests =>
2
;
-BEGIN { use_ok('Linux::Seccomp') };
+use Test::More tests =>
3
;
+BEGIN { use_ok('Linux::Seccomp'
, ':all'
) };
my $fail = 0;
my $fail = 0;
@@
-122,3
+122,13
@@
foreach my $constname (qw(
}
ok( $fail == 0 , 'Constants' );
}
ok( $fail == 0 , 'Constants' );
+
+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;
+
+mkdir 'testdir';
+ok $got_sigsys, 'filter with SCMP_ACT_TRAP on mkdir() works';
This page took
0.011112 seconds
and
4
git commands to generate.