From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C63EC1F4B4; Tue, 20 Apr 2021 22:06:08 +0000 (UTC) Date: Tue, 20 Apr 2021 22:06:08 +0000 From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] t/lei-daemon: skip inaccessible socket test as root Message-ID: <20210420220608.GA1307@dcvr> References: <20210420203318.onmonvswcnuryhuy@nitro.local> <20210420203854.GA28776@dcvr> <20210420213712.qfpftr2r543cqg7l@nitro.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210420213712.qfpftr2r543cqg7l@nitro.local> List-Id: Konstantin Ryabitsev wrote: > While poking around, I've discovered that it only fails when "make test" runs > as root (don't judge -- this is in a throwaway lab VM): > Hope that helps. Yes :) ----------8<-------- Subject: [PATCH] t/lei-daemon: skip inaccessible socket test as root "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 Link: https://public-inbox.org/meta/20210420213712.qfpftr2r543cqg7l@nitro.local/ --- t/lei-daemon.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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');