unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] tests: skip ENOSPC injection on restricted systems
@ 2024-08-31  8:17 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2024-08-31  8:17 UTC (permalink / raw)
  To: meta

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 | 2 +-
 t/msgmap.t                    | 2 +-
 t/v2writable.t                | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index 00e96aee..8c70c6c2 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 77ec2748..6ed01e76 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 4c24ee92..144ee685 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";

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-31  8:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-31  8:17 [PATCH] tests: skip ENOSPC injection on restricted systems Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).