From: Eric Wong Date: Sat, 31 Aug 2024 08:17:56 +0000 (+0000) Subject: tests: skip ENOSPC injection on restricted systems X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5363bc5ad0771c9de09b6add56a352687af13f2e;p=thirdparty%2Fpublic-inbox.git tests: skip ENOSPC injection on restricted systems 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. --- diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 00e96aeef..8c70c6c2e 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -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; } diff --git a/t/msgmap.t b/t/msgmap.t index 77ec2748b..6ed01e76d 100644 --- a/t/msgmap.t +++ b/t/msgmap.t @@ -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 }); diff --git a/t/v2writable.t b/t/v2writable.t index 4c24ee924..144ee6857 100644 --- a/t/v2writable.t +++ b/t/v2writable.t @@ -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";