From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS47066 71.19.144.0/20 X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.kgio.general Subject: Re: Concurrency issue in TestKgioUnixConnect? Date: Tue, 3 Sep 2013 20:05:40 +0000 Message-ID: <20130903200540.GA29947@dcvr.yhbt.net> References: <20130901140301.GI1272@loar> <20130901195835.GB30612@dcvr.yhbt.net> <20130902212429.GA18310@dcvr.yhbt.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1378238760 2763 80.91.229.3 (3 Sep 2013 20:06:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Sep 2013 20:06:00 +0000 (UTC) To: kgio@librelist.org Original-X-From: kgio@librelist.org Tue Sep 03 22:06:02 2013 Return-path: Envelope-to: gclrkg-kgio@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: kgio@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.kgio.general:202 Archived-At: Received: from zedshaw2.xen.prgmr.com ([71.19.156.177]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VGwrS-0002xI-3K for gclrkg-kgio@m.gmane.org; Tue, 03 Sep 2013 22:06:02 +0200 Received: from zedshaw2.xen.prgmr.com (unknown [IPv6:::1]) by zedshaw2.xen.prgmr.com (Postfix) with ESMTP id 9447374E52 for ; Tue, 3 Sep 2013 20:14:57 +0000 (UTC) Hleb Valoshka <375gnu@gmail.com> wrote: > On 9/3/13, Eric Wong wrote: > > I haven't looked closely at your fakeroot workaround. > > It's a Debian specific patch. Its problematic when run as root, too (which may affect some folks). I'll push out the following: Subject: [PATCH] test_tryopen: skip EACCES test when euid == 0 This fails when the test is run as root (which may be the case of some Ruby installations) or fakeroot (which is the case of Debian build systems). --- test/test_tryopen.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/test_tryopen.rb b/test/test_tryopen.rb index 8a8278c..abcbd37 100644 --- a/test/test_tryopen.rb +++ b/test/test_tryopen.rb @@ -30,7 +30,12 @@ def test_tryopen_EACCES tmp = Tempfile.new "tryopen" File.chmod 0000, tmp.path tmp = Kgio::File.tryopen(tmp.path) - assert_equal(:EACCES, tmp) + if Process.euid == 0 + assert_kind_of Kgio::File, tmp + warn "cannot test EACCES when euid == 0" + else + assert_equal(:EACCES, tmp) + end end def test_tryopen_readwrite -- Eric Wong