]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
tests: skip ENOSPC injection on restricted systems
authorEric Wong <e@80x24.org>
Sat, 31 Aug 2024 08:17:56 +0000 (08:17 +0000)
committerEric Wong <e@80x24.org>
Sat, 31 Aug 2024 19:15:24 +0000 (19:15 +0000)
Yama will not allow ptrace(2) on existing processes (only new
ones) if the kernel.yaml.ptrace_scope sysctl is non-zero.  Skip
those tests for now since the majority of strace(1) testing
is probably done on systems without ptrace restrictions.

lib/PublicInbox/TestCommon.pm
t/msgmap.t
t/v2writable.t

index 00e96aeef98214447012d8fd0cce2ffeed7481e1..8c70c6c2eeb5007150ed2a62f6c2992b8d2a5078 100644 (file)
@@ -1027,7 +1027,7 @@ sub strace (@) {
                        CORE::open($fh, '<', $f) ? readline($fh) : 0;
                };
                chomp $ps;
-               skip "strace unusable on daemons\n$f is `$ps' (!= 0)", 1 if $ps;
+               skip "strace unusable on existing PIDs\n$f is `$ps' (!= 0)", 1 if $ps;
        }
        require_cmd('strace', 1) or skip 'strace not available', 1;
 }
index 77ec2748be6525051825139b46a15e5bec1b18b6..6ed01e76d2f147b2686c5322f03b76322094cd91 100644 (file)
@@ -74,7 +74,7 @@ is(eval {
 }, 'ok', 'atfork_* work on tmp_clone');
 
 SKIP: {
-       my $strace = strace_inject;
+       my $strace = strace_inject(1);
        open my $fh, '>', my $trace = "$tmpdir/trace.out";
        my $rd = popen_rd([ $strace, '-p', $$, '-o', $trace,
                '-e', 'inject=pwrite64:error=ENOSPC'], undef, { 2 => 1 });
index 4c24ee924e203449501f603c222c65c2860af7f5..144ee68579eb73849baf65c4b76439a012c53c4f 100644 (file)
@@ -337,7 +337,7 @@ ok($@, 'V2Writable fails on non-existent dir');
 }
 
 SKIP: {
-       my $strace = strace_inject;
+       my $strace = strace_inject(1);
        my $eml = eml_load 't/plack-qp.eml';
        my $gfi_err = "$inboxdir/gfi.err";
        open my $fh, '>', my $trace = "$inboxdir/trace.out";