about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-10 22:26:33 +0000
committerEric Wong <e@80x24.org>2023-11-11 03:00:15 +0000
commit99eaad164ac2d7565ba61d6ebe9f95b37aa478ca (patch)
treebaee262fbbf9c356f731fa60a1a5bb9171c047c6 /t
parent363c043a8a3f379a69802fc566112fcd8f1e750c (diff)
downloadpublic-inbox-99eaad164ac2d7565ba61d6ebe9f95b37aa478ca.tar.gz
Systems with Yama can restrict ptrace(2) (the underlying syscall
used by strace(1)) and make it difficult to test error handling
via error injection.  Just skip the tests on such systems since
it's probably not worth the effort to start using prctl(2) to
enable the test on such systems.
Diffstat (limited to 't')
-rw-r--r--t/lei-import.t7
1 files changed, 3 insertions, 4 deletions
diff --git a/t/lei-import.t b/t/lei-import.t
index 6ad4c97b..1edd607d 100644
--- a/t/lei-import.t
+++ b/t/lei-import.t
@@ -155,19 +155,18 @@ do {
 like($lei_out, qr/\bbin\b/, 'commit-delay eventually commits');
 
 SKIP: {
-        my $strace = strace_inject; # skips if strace is old or non-Linux
+        my $strace = strace_inject(1); # skips if strace is old or non-Linux
         my $tmpdir = tmpdir;
         my $tr = "$tmpdir/tr";
-        my $cmd = [ $strace, "-o$tr", '-f',
+        my $cmd = [ $strace, '-q', "-o$tr", '-f',
                 "-P", File::Spec->rel2abs('t/plack-qp.eml'),
                 '-e', 'inject=readv,read:error=EIO'];
         lei_ok qw(daemon-pid);
         chomp(my $daemon_pid = $lei_out);
         push @$cmd, '-p', $daemon_pid;
-        my $strace_opt = { 1 => \my $out, 2 => \my $err };
         require PublicInbox::Spawn;
         require PublicInbox::AutoReap;
-        my $pid = PublicInbox::Spawn::spawn($cmd, \%ENV, $strace_opt);
+        my $pid = PublicInbox::Spawn::spawn($cmd, \%ENV);
         my $ar = PublicInbox::AutoReap->new($pid);
         tick; # wait for strace to attach
         ok(!lei(qw(import -F eml t/plack-qp.eml)),