From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 86AA81F47A for ; Sat, 31 Aug 2024 08:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1725092276; bh=2hDHdxfuPRVOqn5jreA/cE3W7T4Tta4wFTjUVv/EP9I=; h=From:To:Subject:Date:From; b=Gchq+XusYo8FMng+IDMVwP+rtiOdrL/P5xOxouEc3are0OYeDL7FCpCeAZv9v2R9/ qY6KHtawrsKWhmTtXM7ZhppA9D8lkrGYDzjU0saCsZIB58TwXFw5/v4cnp7/av5lMH A8FcO++vwNMDpT8XYnYmYTPQQCpA8At3/vLYbukk= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] tests: skip ENOSPC injection on restricted systems Date: Sat, 31 Aug 2024 08:17:56 +0000 Message-ID: <20240831081756.2223584-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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";