X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2FLinux-Seccomp.t;h=b42df87deaf4607e6c6429a77545d61412c1f194;hb=8aad713fd0e8c1117cdfda799a7bb2f8c18e3465;hp=771d41e4851f9b92e87d98b8bb3975360cfa1c91;hpb=bcf524c10c0ad85fcef711acffc3251bb8472352;p=linux-seccomp.git diff --git a/t/Linux-Seccomp.t b/t/Linux-Seccomp.t index 771d41e..b42df87 100644 --- a/t/Linux-Seccomp.t +++ b/t/Linux-Seccomp.t @@ -2,8 +2,8 @@ use strict; use warnings; -use Test::More tests => 2; -BEGIN { use_ok('Linux::Seccomp') }; +use Test::More tests => 4; +BEGIN { use_ok('Linux::Seccomp', ':all') }; my $fail = 0; @@ -122,3 +122,15 @@ foreach my $constname (qw( } 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; + +is_deeply version, [2, 3, 1], 'library version is 2.3.1'; + +mkdir 'testdir'; +ok $got_sigsys, 'filter with SCMP_ACT_TRAP on mkdir() works';