about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-04-20 22:06:08 +0000
committerEric Wong <e@80x24.org>2021-04-21 04:28:36 -0400
commit42bf77d28591740ac94e4e3d50661ae84c88ca5b (patch)
tree594ce4dff00d6980d44a3de0951de44ff3099947
parent41d3b34eb617927131e619de3ed16bd3981a9b66 (diff)
downloadpublic-inbox-42bf77d28591740ac94e4e3d50661ae84c88ca5b.tar.gz
"chmod 0000" on a Unix socket can't stop root from connecting to it;
so just skip the test for rare cases when testing as root.

Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Link: https://public-inbox.org/meta/20210420213712.qfpftr2r543cqg7l@nitro.local/
-rw-r--r--t/lei-daemon.t3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/lei-daemon.t b/t/lei-daemon.t
index 35e059b9..84e2791d 100644
--- a/t/lei-daemon.t
+++ b/t/lei-daemon.t
@@ -74,7 +74,8 @@ test_lei({ daemon_only => 1 }, sub {
         chomp $lei_out;
         is($lei_out, $new_pid, 'PID unchanged after -0/-CHLD');
 
-        if ('socket inaccessible') {
+        SKIP: { # socket inaccessible
+                skip "cannot test connect EPERM as root", 3 if $> == 0;
                 chmod 0000, $sock or BAIL_OUT "chmod 0000: $!";
                 lei_ok('help', \'connect fail, one-shot fallback works');
                 like($lei_err, qr/\bconnect\(/, 'connect error noted');