]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/lei-daemon: skip inaccessible socket test as root
authorEric Wong <e@80x24.org>
Tue, 20 Apr 2021 22:06:08 +0000 (22:06 +0000)
committerEric Wong <e@80x24.org>
Wed, 21 Apr 2021 08:28:36 +0000 (04:28 -0400)
"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/
t/lei-daemon.t

index 35e059b97cd956b8df20531ed98ad5ab0cb54de0..84e2791d6fcc5a0839dd882659cbf9b241776016 100644 (file)
@@ -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');