From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 04 22:41:11 2014 Received: (at submit) by debbugs.gnu.org; 5 Mar 2014 03:41:11 +0000 Received: from localhost ([127.0.0.1]:50944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WL2hi-0004AH-HF for submit@debbugs.gnu.org; Tue, 04 Mar 2014 22:41:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52946) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WL2hf-0004A8-F4 for submit@debbugs.gnu.org; Tue, 04 Mar 2014 22:41:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WL2hY-00083h-JL for submit@debbugs.gnu.org; Tue, 04 Mar 2014 22:41:07 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL2hY-00083d-7C for submit@debbugs.gnu.org; Tue, 04 Mar 2014 22:41:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL2hR-0007R1-JF for bug-coreutils@gnu.org; Tue, 04 Mar 2014 22:41:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WL2hK-00082M-JE for bug-coreutils@gnu.org; Tue, 04 Mar 2014 22:40:53 -0500 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:37185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL2hK-00082E-C5 for bug-coreutils@gnu.org; Tue, 04 Mar 2014 22:40:46 -0500 Received: by mail-we0-f175.google.com with SMTP id q58so495388wes.20 for ; Tue, 04 Mar 2014 19:40:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=cncGTwhxx+FI0nJiU8QPWZghLKuZ/wQJcCUn+vCkMPA=; b=xbimEHmqQ7twYhB6vhTUukI7dB27o1qJQXMi5t5tol5hUlAGhyknGJopTAwLycD+Cs 02UyjsJiDomT6MFWQ86ptMvIqowbKK8HBrJtGTjVDJmWhNTbN8z/dRoMYJ21/cCk5yFX 8iQEmWxzRwQ4xxUdxQpdrkNJrCa20YdR6+i2gX3Bcp6iNOY7g3SNsD+kHzQN+UG+okey Faieg2nGeWZjtkF2/VmmPINL5jRoe4zeUHdHpKj5Gdjosr+M10Xh2KzbfhxJJ7ZHKRdo A+nCXPLsFsruaahFUReBnWLpGOajvfU/9gOBcKR5WVawdfnPflV+R33lGwPkwXpTwesl 2b6A== X-Received: by 10.194.203.200 with SMTP id ks8mr4430591wjc.61.1393990845406; Tue, 04 Mar 2014 19:40:45 -0800 (PST) Received: from localhost.localdomain (tal33-3-82-233-82-24.fbx.proxad.net. [82.233.82.24]) by mx.google.com with ESMTPSA id az1sm4833291wjb.11.2014.03.04.19.40.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Mar 2014 19:40:44 -0800 (PST) From: Cyril Roelandt To: bug-coreutils@gnu.org Subject: [PATCH] tests: Do not access /dev/tty if it does not exist Date: Wed, 5 Mar 2014 04:34:47 +0100 Message-Id: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> X-Mailer: git-send-email 1.9.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Cyril Roelandt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) * tests/misc/nohup.sh: Do not try to access /dev/tty if it does not exist. This happens on GNU Guix, for instance. --- tests/misc/nohup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/misc/nohup.sh b/tests/misc/nohup.sh index 6d2b515..e331eab 100755 --- a/tests/misc/nohup.sh +++ b/tests/misc/nohup.sh @@ -61,7 +61,7 @@ rm -f nohup.out err # Bug present through coreutils 8.0: failure to print advisory message # to stderr must be fatal. Requires stdout to be terminal. -if test -w /dev/full && test -c /dev/full; then +if test -w /dev/full && test -c /dev/full && test -f /dev/tty; then ( exec >/dev/tty test -t 1 || exit 0 -- 1.9.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 04 23:20:09 2014 Received: (at 16940) by debbugs.gnu.org; 5 Mar 2014 04:20:09 +0000 Received: from localhost ([127.0.0.1]:50972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WL3JQ-0005Ma-Qg for submit@debbugs.gnu.org; Tue, 04 Mar 2014 23:20:09 -0500 Received: from mail5.vodafone.ie ([213.233.128.176]:19723) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WL3JO-0005MO-NO for 16940@debbugs.gnu.org; Tue, 04 Mar 2014 23:20:07 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApMBAL6kFlNtTei7/2dsb2JhbAANTYNBwWaBLIMZAQEBBDIBFDIQCw0BCgkUAg8JAwIBAgFFBg0BBwEBh3oIrAKFCJxEF41tZAeEOASZboVAjmaBaA Received: from unknown (HELO [192.168.1.79]) ([109.77.232.187]) by mail3.vodafone.ie with ESMTP; 05 Mar 2014 04:20:05 +0000 Message-ID: <5316A5F4.1080103@draigBrady.com> Date: Wed, 05 Mar 2014 04:20:04 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Cyril Roelandt Subject: Re: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist References: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> In-Reply-To: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16940 Cc: 16940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 03/05/2014 03:34 AM, Cyril Roelandt wrote: > * tests/misc/nohup.sh: Do not try to access /dev/tty if it does not exist. This > happens on GNU Guix, for instance. > --- > tests/misc/nohup.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/misc/nohup.sh b/tests/misc/nohup.sh > index 6d2b515..e331eab 100755 > --- a/tests/misc/nohup.sh > +++ b/tests/misc/nohup.sh > @@ -61,7 +61,7 @@ rm -f nohup.out err > > # Bug present through coreutils 8.0: failure to print advisory message > # to stderr must be fatal. Requires stdout to be terminal. > -if test -w /dev/full && test -c /dev/full; then > +if test -w /dev/full && test -c /dev/full && test -f /dev/tty; then > ( > exec >/dev/tty > test -t 1 || exit 0 We might as well ensure it's a writeable char device while we're at it. I'll apply it in your name in the morning with the following adjustment, unless you have an objection: if test -w /dev/full && test -c /dev/full && test -w /dev/tty && test -c /dev/tty; then Note this might also handle this Fedora rawhide issue that I noticed in passing yesterday: http://pkgs.fedoraproject.org/cgit/coreutils.git/commit/?id=156e6cc thanks! Pįdraig. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 04:17:17 2014 Received: (at 16940) by debbugs.gnu.org; 5 Mar 2014 09:17:18 +0000 Received: from localhost ([127.0.0.1]:51057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WL7wz-0005dN-9r for submit@debbugs.gnu.org; Wed, 05 Mar 2014 04:17:17 -0500 Received: from moutng.kundenserver.de ([212.227.17.13]:57967) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WL7wx-0005dC-LK for 16940@debbugs.gnu.org; Wed, 05 Mar 2014 04:17:16 -0500 Received: from [10.0.2.15] (gw.camline.com [62.153.148.194]) by mrelayeu.kundenserver.de (node=mreue104) with ESMTP (Nemesis) id 0MFsVa-1WNrVm0lxm-00Ewia; Wed, 05 Mar 2014 10:17:12 +0100 Message-ID: <5316EB92.1000907@bernhard-voelker.de> Date: Wed, 05 Mar 2014 10:17:06 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: =?ISO-8859-1?Q?P=E1draig_Brady?= , Cyril Roelandt Subject: Re: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist References: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> <5316A5F4.1080103@draigBrady.com> In-Reply-To: <5316A5F4.1080103@draigBrady.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:KBsf6Q7AGK7+zgOrwPa/sk8uayVO1Ai2EWUtIOVJUlX kzgqJDY19gDC1KimMykaoz4thYpXvvCqrIQnx8MHDyW5l+l4He 4LNA2rrmhG2h2Zy1FZqTAzjHh2bPyeanyqeaSzReOjn+ENADLX sunsopOQ+F76CtjgwRPbL0//eC7AgIio7tzp2xUKB8Cgxw6S5J 2rFa+l44GXd0ynYxtmqKOtklW3PJgRWEGOoqaUQjM9lHklAFws phwVX4T0vkfiYFYml5avG7wdlSXNzV/xv0jZbmwIYiUWKcHcRN kNnGJ0L4lRzanpUC+sWs97d8J5y0gSCPk9NHD7kHGt3jIvT2Zz P3Gyv4E/WJiF4fX/7pUzw2rGAnWZJFpZqgCuzqDCj X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 16940 Cc: 16940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 03/05/2014 05:20 AM, Pįdraig Brady wrote: > if test -w /dev/full && test -c /dev/full && > test -w /dev/tty && test -c /dev/tty; then This looks right. However, I'm wondering why the 'test -t 1' right after the exec redirection didn't already catch this: if test -w /dev/full && test -c /dev/full; then ( exec >/dev/tty test -t 1 || exit 0 nohup echo hi 2> /dev/full test $? = 125 || fail=1 test -f nohup.out || fail=1 test -s nohup.out && fail=1 rm -f nohup.out exit $fail ) || fail=1 fi Does someone have a test log file with the failure? Have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 10:09:34 2014 Received: (at 16940) by debbugs.gnu.org; 5 Mar 2014 15:09:34 +0000 Received: from localhost ([127.0.0.1]:51831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLDRt-0000nk-In for submit@debbugs.gnu.org; Wed, 05 Mar 2014 10:09:33 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:65071) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLDRq-0000nZ-BD for 16940@debbugs.gnu.org; Wed, 05 Mar 2014 10:09:30 -0500 Received: by mail-ee0-f46.google.com with SMTP id t10so513798eei.5 for <16940@debbugs.gnu.org>; Wed, 05 Mar 2014 07:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=y5jMJ5+SLpTJCbVH2dYr57TugWXLB2089oFYG0Wc+xA=; b=Pr4j42vuHD3Z9CT+hArylu1sOF823iciKDo2CIxjX56maYBsN5Hwvb6B0zS4F0o6cM 67xZfUROv1gxY/VY4PhK2fcW7NFL8852+igeni/FXnnC3oRr/au5HN56TcV75GOKn+aa RImiWQBMCPGKgaG7BbVNJ68emnxu+L31DDPzzICDJOXwmaygv3VdOiaCDFs0J2COa2q/ mdnaH3jvqyFuQXQE8+P7WQrs9IQdWRxci4ElLLVqG/hZFjvm/aNBxL0qcyiCnuG5i9pb xYd2z/9CX/FTl/RWVNLyIG0rMPzYh+QuNqtYasG7O2nDUaEH0RaUpgYo4KUj6EDQwSH0 btMw== X-Received: by 10.14.95.2 with SMTP id o2mr6315185eef.69.1394032169445; Wed, 05 Mar 2014 07:09:29 -0800 (PST) Received: from [192.168.0.10] (tal33-3-82-233-82-24.fbx.proxad.net. [82.233.82.24]) by mx.google.com with ESMTPSA id f45sm10046220eeg.5.2014.03.05.07.09.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Mar 2014 07:09:27 -0800 (PST) Message-ID: <53173CC6.1080505@gmail.com> Date: Wed, 05 Mar 2014 16:03:34 +0100 From: Cyril Roelandt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.3.0 MIME-Version: 1.0 To: Bernhard Voelker , =?ISO-8859-1?Q?P=E1draig?= =?ISO-8859-1?Q?_Brady?= Subject: Re: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist References: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> <5316A5F4.1080103@draigBrady.com> <5316EB92.1000907@bernhard-voelker.de> In-Reply-To: <5316EB92.1000907@bernhard-voelker.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16940 Cc: 16940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 03/05/2014 10:17 AM, Bernhard Voelker wrote: > On 03/05/2014 05:20 AM, Pįdraig Brady wrote: >> if test -w /dev/full && test -c /dev/full && >> test -w /dev/tty && test -c /dev/tty; then > > This looks right. > However, I'm wondering why the 'test -t 1' right after > the exec redirection didn't already catch this: > > if test -w /dev/full && test -c /dev/full; then > ( > exec >/dev/tty > test -t 1 || exit 0 > nohup echo hi 2> /dev/full > test $? = 125 || fail=1 > test -f nohup.out || fail=1 > test -s nohup.out && fail=1 > rm -f nohup.out > exit $fail > ) || fail=1 > fi > > Does someone have a test log file with the failure? > The bug was originally reported on GNU Guix, here: https://lists.gnu.org/archive/html/guix-devel/2014-03/msg00009.html Cyril. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 10:21:43 2014 Received: (at 16940) by debbugs.gnu.org; 5 Mar 2014 15:21:43 +0000 Received: from localhost ([127.0.0.1]:51842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLDde-00019t-H0 for submit@debbugs.gnu.org; Wed, 05 Mar 2014 10:21:42 -0500 Received: from mail5.vodafone.ie ([213.233.128.176]:56825) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLDdc-00019i-2r for 16940@debbugs.gnu.org; Wed, 05 Mar 2014 10:21:41 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar0BAPk/F1NtTei7/2dsb2JhbAANTYNBUYMKhV24KoEugxkBAQEDASNWBQsJAg0BAwMBAgEJFgsCAgkDAgECAT0IBgEMAQUCAQGHbQ0DkUWbIXagLBeOQBEHCYJmgUkBA5BJgTSHcoVAhXSIcg Received: from unknown (HELO [192.168.1.79]) ([109.77.232.187]) by mail3.vodafone.ie with ESMTP; 05 Mar 2014 15:21:38 +0000 Message-ID: <53174101.1060108@draigBrady.com> Date: Wed, 05 Mar 2014 15:21:37 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Bernhard Voelker , Cyril Roelandt Subject: Re: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist References: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> <5316A5F4.1080103@draigBrady.com> <5316EB92.1000907@bernhard-voelker.de> In-Reply-To: <5316EB92.1000907@bernhard-voelker.de> X-Enigmail-Version: 1.6 Content-Type: multipart/mixed; boundary="------------040803000901040202080003" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16940 Cc: 16940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) This is a multi-part message in MIME format. --------------040803000901040202080003 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 03/05/2014 09:17 AM, Bernhard Voelker wrote: > On 03/05/2014 05:20 AM, PĆ”draig Brady wrote: >> if test -w /dev/full && test -c /dev/full && >> test -w /dev/tty && test -c /dev/tty; then > > This looks right. > However, I'm wondering why the 'test -t 1' right after > the exec redirection didn't already catch this: Good point. > if test -w /dev/full && test -c /dev/full; then > ( > exec >/dev/tty > test -t 1 || exit 0 > nohup echo hi 2> /dev/full > test $? = 125 || fail=1 > test -f nohup.out || fail=1 > test -s nohup.out && fail=1 > rm -f nohup.out > exit $fail > ) || fail=1 > fi > > Does someone have a test log file with the failure? Ondřej VaŔík ran the rawhide build again producing: ./tests/misc/nohup.sh: line 66: /dev/tty: No such device or address + fail=1 So exec >/dev/tty is throwing ENXIO and exiting the subshell. ENXIO is fine and corresponds to the process not having a controlling tty. I guessed the change here is with the newly released bash 4.3 which is exiting the subshell immediately in this case, and confirmed the following fails: setsid make SHELL=~/bash-4.3/bash TESTS=tests/misc/nohup.sh SUBDIRS=. check Now reducing the case and comparing different shells we get: $ setsid bash --posix -c 'echo $BASH_VERSION; (exec >/dev/tty; exit 0) || echo failed_early' 4.2.45(1)-release bash: /dev/tty: No such device or address $ setsid ./bash --posix -c 'echo $BASH_VERSION; (exec >/dev/tty; exit 0) || echo failed_early' 4.3.0(1)-release ./bash: /dev/tty: No such device or address failed_early $ setsid ksh -c '(exec >/dev/tty; exit 0) || echo failed_early' $ ksh: /dev/tty: cannot create [No such device or address] failed_early $ setsid dash -c '(exec >/dev/tty; exit 0) || echo failed_early' dash: 1: cannot create /dev/tty: No such device or address failed_early So rather than newer bash being the difference here, it's the older bash that is the outlier. So we should adjust the test case to handle all shells. Proposed patch attached. thanks, PĆ”draig. --------------040803000901040202080003 Content-Type: text/x-patch; name="nohup-bash-4.3.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="nohup-bash-4.3.patch" >From 76bd83186496b3ed45adef598c1eab9797852d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Wed, 5 Mar 2014 15:14:07 +0000 Subject: [PATCH] tests: fix false failure in nohup.sh in non tty builds * tests/misc/nohup.sh: When building without a controlling tty, an exec failure is triggered in a subshell, which causes POSIX shells to immediately exit the subshell. This was brought to notice by the newly conforming bash 4.3. Fixes http:/bugs.gnu.org/16940 --- tests/misc/nohup.sh | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tests/misc/nohup.sh b/tests/misc/nohup.sh index 6d2b515..015e84f 100755 --- a/tests/misc/nohup.sh +++ b/tests/misc/nohup.sh @@ -63,6 +63,11 @@ rm -f nohup.out err # to stderr must be fatal. Requires stdout to be terminal. if test -w /dev/full && test -c /dev/full; then ( + # POSIX shells immediately exit the subshell on exec error. + # So check we can write to /dev/tty before the exec, which + # isn't possible if we've no controlling tty for example. + >/dev/tty || exit 0 + exec >/dev/tty test -t 1 || exit 0 nohup echo hi 2> /dev/full -- 1.7.7.6 --------------040803000901040202080003-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 10:43:57 2014 Received: (at 16940) by debbugs.gnu.org; 5 Mar 2014 15:43:57 +0000 Received: from localhost ([127.0.0.1]:51853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLDzA-0001pi-4n for submit@debbugs.gnu.org; Wed, 05 Mar 2014 10:43:56 -0500 Received: from moutng.kundenserver.de ([212.227.17.10]:59303) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLDz7-0001pZ-6S for 16940@debbugs.gnu.org; Wed, 05 Mar 2014 10:43:54 -0500 Received: from [10.0.2.15] (gw.camline.com [62.153.148.194]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0LlVhP-1Wsd7p1maN-00bONC; Wed, 05 Mar 2014 16:43:50 +0100 Message-ID: <53174635.3020101@bernhard-voelker.de> Date: Wed, 05 Mar 2014 16:43:49 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= , Cyril Roelandt Subject: Re: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist References: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> <5316A5F4.1080103@draigBrady.com> <5316EB92.1000907@bernhard-voelker.de> <53174101.1060108@draigBrady.com> In-Reply-To: <53174101.1060108@draigBrady.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:T5NCDlpB1TgBbJjcdG1EkIu9tpoOJ0TQ5rDykhOdO4I P9pmJvSCuOjx8uWhmtQ2CfY+Asz1l3wMLE8gVu4tT585Jhl0VK es8HsWGWzx8ZiOUHBVOmtu/m9upanfnghi9Ix6vn3UzQrlWh85 m8ebk6i8SRAZ+u7RTyDEH7i/uLG/UHr7l4QpVzIDQ6bhjq0xBy +n6XoK+sbkgaN9SwrZni6EIA+3RDbrid2IRWQ+jBpJFH5b9T7S lHesq5nSXQ8tYPK5XzlJo55s41Hx9p1UX6spMx910cbTj9SdRk iKc1gYjsYzbaGYH+BGqR68NrSoXm38s2bwtssF9PjmrEQB/hbO D7lm99GDqCjm4pRh5R/s1mUluN1Z/BSAQt2M4ANPQ X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 16940 Cc: 16940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 03/05/2014 04:21 PM, PĆ”draig Brady wrote: > Ondřej VaŔík ran the rawhide build again producing: > > ./tests/misc/nohup.sh: line 66: /dev/tty: No such device or address > + fail=1 > > So exec >/dev/tty is throwing ENXIO and exiting the subshell. > ENXIO is fine and corresponds to the process not having a controlling tty. > > I guessed the change here is with the newly released bash 4.3 > which is exiting the subshell immediately in this case, and confirmed > the following fails: > > setsid make SHELL=~/bash-4.3/bash TESTS=tests/misc/nohup.sh SUBDIRS=. check > > Now reducing the case and comparing different shells we get: > > $ setsid bash --posix -c 'echo $BASH_VERSION; (exec >/dev/tty; exit 0) || echo failed_early' > 4.2.45(1)-release > bash: /dev/tty: No such device or address > > $ setsid ./bash --posix -c 'echo $BASH_VERSION; (exec >/dev/tty; exit 0) || echo failed_early' > 4.3.0(1)-release > ./bash: /dev/tty: No such device or address > failed_early > > $ setsid ksh -c '(exec >/dev/tty; exit 0) || echo failed_early' > $ ksh: /dev/tty: cannot create [No such device or address] > failed_early > > $ setsid dash -c '(exec >/dev/tty; exit 0) || echo failed_early' > dash: 1: cannot create /dev/tty: No such device or address > failed_early oh, that's a tricky one. Thanks for the in-depth analysis. > So rather than newer bash being the difference here, > it's the older bash that is the outlier. > So we should adjust the test case to handle all shells. > Proposed patch attached. > + # POSIX shells immediately exit the subshell on exec error. > + # So check we can write to /dev/tty before the exec, which > + # isn't possible if we've no controlling tty for example. > + >/dev/tty || exit 0 > + The above '>/dev/tty' would also work if /dev/tty does not exist and /dev is writable. Therefore - although the reason of the failure originates from something completely different -, I think it'd be better to go back to checking explicitly for a character device again: test -c /dev/tty && :>/dev/tty || exit 0 WDYT? Thanks & have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 10:54:20 2014 Received: (at 16940) by debbugs.gnu.org; 5 Mar 2014 15:54:20 +0000 Received: from localhost ([127.0.0.1]:51859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLE9D-00028U-4H for submit@debbugs.gnu.org; Wed, 05 Mar 2014 10:54:19 -0500 Received: from moutng.kundenserver.de ([212.227.17.24]:55617) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLE99-00028H-W2 for 16940@debbugs.gnu.org; Wed, 05 Mar 2014 10:54:16 -0500 Received: from [10.0.2.15] (gw.camline.com [62.153.148.194]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0MZlwE-1WdIzr3Gbm-00LVB0; Wed, 05 Mar 2014 16:54:13 +0100 Message-ID: <531748A5.6000305@bernhard-voelker.de> Date: Wed, 05 Mar 2014 16:54:13 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Cyril Roelandt , =?ISO-8859-1?Q?P=E1draig_Brady?= Subject: Re: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist References: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> <5316A5F4.1080103@draigBrady.com> <5316EB92.1000907@bernhard-voelker.de> <53173CC6.1080505@gmail.com> In-Reply-To: <53173CC6.1080505@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:b0/IPQ9p0gdDgBadqhpBaJBckUkb31JPXAFWm+59oWE 1/DvDVxDX05IeDeqw2RI4zHFGniu7TDVrtzP2du1ZRMkDtZWDO ssgmlP3jndG/Fxf/9NxAvihNs02H2HA5Wrlls+qUgbhur99ZBy 89XgWcGKqUltjygQSeQ5lJWstQo9ZjE3ye4HyCoTwHIZ9hUR/e O3grPBpAnXw0cqEKdWJmggBZbT9WcKT6dM1mBfFlBTzFDmZdw7 G4EuxV9f+QIv4GoBw3geyyjr7CwP+g0tEkK37wTEX/4K6z05xu ZJqGtHdD/RCRG9Vgks3C7H3jpzLdh64NFJoM60+SuNdGZ92HAX 3lQwQUzEK83iWykqm7EAaa2KrePvtd7vUGQQLFw7o X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 16940 Cc: 16940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 03/05/2014 04:03 PM, Cyril Roelandt wrote: > On 03/05/2014 10:17 AM, Bernhard Voelker wrote: >> Does someone have a test log file with the failure? >> > > The bug was originally reported on GNU Guix, here: > https://lists.gnu.org/archive/html/guix-devel/2014-03/msg00009.html That makes clear that you hit the same issue as Ondrej on rawhide. Thanks! Have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 11:46:25 2014 Received: (at 16940) by debbugs.gnu.org; 5 Mar 2014 16:46:25 +0000 Received: from localhost ([127.0.0.1]:51902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLExc-0003i1-V7 for submit@debbugs.gnu.org; Wed, 05 Mar 2014 11:46:25 -0500 Received: from mail5.vodafone.ie ([213.233.128.176]:60399) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLExa-0003ho-Dp for 16940@debbugs.gnu.org; Wed, 05 Mar 2014 11:46:23 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApQBABdUF1NtTei7/2dsb2JhbAANTYNBg1u+B4EvgxkBAQEEIw8BRhAJAg0BCgICBRYLAgIJAwIBAgFFBg0BBwEBh3qRZJshdqAuF4EpjSgHgm+BSQEDmW+FQI5m Received: from unknown (HELO [192.168.1.79]) ([109.77.232.187]) by mail3.vodafone.ie with ESMTP; 05 Mar 2014 16:46:19 +0000 Message-ID: <531754DB.1020201@draigBrady.com> Date: Wed, 05 Mar 2014 16:46:19 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Bernhard Voelker Subject: Re: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist References: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> <5316A5F4.1080103@draigBrady.com> <5316EB92.1000907@bernhard-voelker.de> <53174101.1060108@draigBrady.com> <53174635.3020101@bernhard-voelker.de> In-Reply-To: <53174635.3020101@bernhard-voelker.de> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16940 Cc: 16940@debbugs.gnu.org, Cyril Roelandt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 03/05/2014 03:43 PM, Bernhard Voelker wrote: > On 03/05/2014 04:21 PM, PĆ”draig Brady wrote: >> Ondřej VaŔík ran the rawhide build again producing: >> >> ./tests/misc/nohup.sh: line 66: /dev/tty: No such device or address >> + fail=1 >> >> So exec >/dev/tty is throwing ENXIO and exiting the subshell. >> ENXIO is fine and corresponds to the process not having a controlling tty. >> >> I guessed the change here is with the newly released bash 4.3 >> which is exiting the subshell immediately in this case, and confirmed >> the following fails: >> >> setsid make SHELL=~/bash-4.3/bash TESTS=tests/misc/nohup.sh SUBDIRS=. check >> >> Now reducing the case and comparing different shells we get: >> >> $ setsid bash --posix -c 'echo $BASH_VERSION; (exec >/dev/tty; exit 0) || echo failed_early' >> 4.2.45(1)-release >> bash: /dev/tty: No such device or address >> >> $ setsid ./bash --posix -c 'echo $BASH_VERSION; (exec >/dev/tty; exit 0) || echo failed_early' >> 4.3.0(1)-release >> ./bash: /dev/tty: No such device or address >> failed_early >> >> $ setsid ksh -c '(exec >/dev/tty; exit 0) || echo failed_early' >> $ ksh: /dev/tty: cannot create [No such device or address] >> failed_early >> >> $ setsid dash -c '(exec >/dev/tty; exit 0) || echo failed_early' >> dash: 1: cannot create /dev/tty: No such device or address >> failed_early > > oh, that's a tricky one. > Thanks for the in-depth analysis. > >> So rather than newer bash being the difference here, >> it's the older bash that is the outlier. >> So we should adjust the test case to handle all shells. >> Proposed patch attached. > >> + # POSIX shells immediately exit the subshell on exec error. >> + # So check we can write to /dev/tty before the exec, which >> + # isn't possible if we've no controlling tty for example. >> + >/dev/tty || exit 0 >> + > > The above '>/dev/tty' would also work if /dev/tty does not exist > and /dev is writable. Therefore - although the reason of the failure > originates from something completely different -, I think it'd be better > to go back to checking explicitly for a character device again: > > test -c /dev/tty && :>/dev/tty || exit 0 The test -c is safer. I'll add that. Note the ':>' is problematic though as the : always returns true. Well it does for solaris, freebsd, dash, bash-4.3 at least. In ksh and bash<=4.2 it does return an error as you assumed. The ':>' construct is only needed for csh anyway I think which we don't support. I notice a few more cases: git grep ": *>.*" which I'll fix in a follow up patch with maybe a syntax check. thanks, PĆ”draig. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 14:05:48 2014 Received: (at 16940) by debbugs.gnu.org; 5 Mar 2014 19:05:48 +0000 Received: from localhost ([127.0.0.1]:51953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLH8V-0007aS-7v for submit@debbugs.gnu.org; Wed, 05 Mar 2014 14:05:48 -0500 Received: from mail6.vodafone.ie ([213.233.128.184]:15616) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLH8L-0007a9-Jf for 16940@debbugs.gnu.org; Wed, 05 Mar 2014 14:05:45 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApgBAPN0F1NtTei7/2dsb2JhbAANTYNBg1uFXbgsgTCDGQEBAQQjBCAyEAsNAQMDAQIBCRYLAgIJAwIBAgE9CAYNAQUCAQGHeq08doQSnBYXjFeBaREHCYJmgUkEkEmJJoVAjmY Received: from unknown (HELO [192.168.1.79]) ([109.77.232.187]) by mail3.vodafone.ie with ESMTP; 05 Mar 2014 19:05:35 +0000 Message-ID: <5317757D.3030307@draigBrady.com> Date: Wed, 05 Mar 2014 19:05:33 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Bernhard Voelker Subject: Re: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist References: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> <5316A5F4.1080103@draigBrady.com> <5316EB92.1000907@bernhard-voelker.de> <53174101.1060108@draigBrady.com> <53174635.3020101@bernhard-voelker.de> <531754DB.1020201@draigBrady.com> In-Reply-To: <531754DB.1020201@draigBrady.com> X-Enigmail-Version: 1.6 Content-Type: multipart/mixed; boundary="------------070804040007000702090207" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16940 Cc: 16940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) This is a multi-part message in MIME format. --------------070804040007000702090207 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 03/05/2014 04:46 PM, PĆ”draig Brady wrote: > Note the ':>' is problematic though as the : always returns true. > Well it does for solaris, freebsd, dash, bash-4.3 at least. > In ksh and bash<=4.2 it does return an error as you assumed. > The ':>' construct is only needed for csh anyway I think > which we don't support. > > I notice a few more cases: git grep ": *>.*" > which I'll fix in a follow up patch with maybe a syntax check. Attached. thanks, PĆ”draig. --------------070804040007000702090207 Content-Type: text/x-patch; name="leading-colon-redirections.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="leading-colon-redirections.patch" >From 056d6de78fcf11a0f404f25faf8cecc9f9ee9c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Wed, 5 Mar 2014 18:41:16 +0000 Subject: [PATCH] tests: avoid the :> construct which can hide errors On most shells `:>file || framework_failure_` will not evaluate the framework_failure_ even if there was an error writing the file. shells which do evaluate the failure are ksh 93u+ and bash 4.2, while shells wich don't include bash 4.3, solaris, freebsd, dash. Furthermore this construct is problematic on Solaris 10 sh, which will try to optimize away a `:' command in a loop after the first iteration, even if it is redirected. * tests/cp/link-deref.sh: Remove the leading colon on redirections. * tests/cp/reflink-perm.sh: Likewise. * tests/id/zero.sh: Likewise. * tests/install/install-C.sh: Likewise. * tests/misc/env.sh: Likewise. * tests/misc/md5sum-bsd.sh: Likewise. * tests/misc/runcon-no-reorder.sh: Likewise. * tests/mv/partition-perm.sh: Likewise. * tests/rm/r-root.sh: Likewise. * tests/split/l-chunk.sh: Likewise. * tests/split/line-bytes.sh: Likewise. * tests/tail-2/inotify-rotate.sh: Likewise. * tests/tail-2/retry.sh: Likewise. * tests/tail-2/symlink.sh: Likewise. * tests/tail-2/wait.sh: Likewise. * tests/touch/read-only.sh: Likewise. + cfg.mk (sc_prohibit_colon_redirection): A new syntax check to avoid further instances of this creeping in. --- cfg.mk | 7 +++++++ tests/cp/link-deref.sh | 2 +- tests/cp/reflink-perm.sh | 4 ++-- tests/id/zero.sh | 2 +- tests/install/install-C.sh | 2 +- tests/misc/env.sh | 2 +- tests/misc/md5sum-bsd.sh | 2 +- tests/misc/runcon-no-reorder.sh | 2 +- tests/mv/partition-perm.sh | 6 +++--- tests/rm/r-root.sh | 6 +++--- tests/split/l-chunk.sh | 8 ++++---- tests/split/line-bytes.sh | 4 ++-- tests/tail-2/inotify-rotate.sh | 2 +- tests/tail-2/retry.sh | 2 +- tests/tail-2/symlink.sh | 4 ++-- tests/tail-2/wait.sh | 2 +- tests/touch/read-only.sh | 2 +- 17 files changed, 33 insertions(+), 26 deletions(-) diff --git a/cfg.mk b/cfg.mk index 7f74afa..cc6f4b8 100644 --- a/cfg.mk +++ b/cfg.mk @@ -123,6 +123,13 @@ sc_tests_executable: | sed -e "s/^/$(ME): Please make test executable: /" | grep . \ && exit 1; : +# Avoid :>file which doesn't propagate errors +sc_prohibit_colon_redirection: + @cd $(srcdir)/tests && GIT_PAGER= git grep -n ': *>.*||' \ + && { echo '$(ME): '"The leading colon in :> will hide errors" 1>&2; \ + exit 1; } \ + || : + # Create a list of regular expressions matching the names # of files included from system.h. Exclude a couple. .re-list: diff --git a/tests/cp/link-deref.sh b/tests/cp/link-deref.sh index 73c86a8..1b66658 100755 --- a/tests/cp/link-deref.sh +++ b/tests/cp/link-deref.sh @@ -31,7 +31,7 @@ if grep '^#define HAVE_LINKAT 1' "$CONFIG_HEADER" > /dev/null \ fi mkdir dir || framework_failure_ -: > file || framework_failure_ +> file || framework_failure_ ln -s dir dirlink || framework_failure_ ln -s file filelink || framework_failure_ ln -s nowhere danglink || framework_failure_ diff --git a/tests/cp/reflink-perm.sh b/tests/cp/reflink-perm.sh index 0650065..52f83fc 100755 --- a/tests/cp/reflink-perm.sh +++ b/tests/cp/reflink-perm.sh @@ -20,8 +20,8 @@ print_ver_ cp -: > time_check -: > file +> time_check +> file ts='2009-08-28 19:00' touch -d "$ts" file || framework_failure_ test time_check -nt file || skip_ "The system clock is wrong" diff --git a/tests/id/zero.sh b/tests/id/zero.sh index 939b162..c826ff4 100755 --- a/tests/id/zero.sh +++ b/tests/id/zero.sh @@ -42,7 +42,7 @@ printf '%s\n' $users '' >> users || framework_failure_ # Exercise "id -z" with various options. printf '\n' > exp || framework_failure_ -:> out || framework_failure_ +> out || framework_failure_ while read u ; do for o in g gr G Gr u ur ; do diff --git a/tests/install/install-C.sh b/tests/install/install-C.sh index 6ce4977..9ee1685 100755 --- a/tests/install/install-C.sh +++ b/tests/install/install-C.sh @@ -54,7 +54,7 @@ echo test > a || framework_failure_ echo "'a' -> 'b'" > out_installed_first || framework_failure_ echo "removed 'b' 'a' -> 'b'" > out_installed_second || framework_failure_ -: > out_empty || framework_failure_ +> out_empty || framework_failure_ # destination file does not exist ginstall -Cv -m$mode1 a b > out || fail=1 diff --git a/tests/misc/env.sh b/tests/misc/env.sh index 0987f7f..877a5e3 100755 --- a/tests/misc/env.sh +++ b/tests/misc/env.sh @@ -62,7 +62,7 @@ fi ENV_TEST1=a export ENV_TEST1 -: >out || framework_failure_ +>out || framework_failure_ env ENV_TEST2= > all || fail=1 grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure_ env -u ENV_TEST1 ENV_TEST3=c > all || fail=1 diff --git a/tests/misc/md5sum-bsd.sh b/tests/misc/md5sum-bsd.sh index 77f0a59..f73e062 100755 --- a/tests/misc/md5sum-bsd.sh +++ b/tests/misc/md5sum-bsd.sh @@ -70,7 +70,7 @@ nl=' tab=' ' rm check.md5 for i in 'a\b' 'a\' "a${nl}b" "a${tab}b"; do - :> "$i" + > "$i" md5sum --tag "$i" >> check.md5 done md5sum --strict -c check.md5 || fail=1 diff --git a/tests/misc/runcon-no-reorder.sh b/tests/misc/runcon-no-reorder.sh index 7338ad5..ca8ad5b 100755 --- a/tests/misc/runcon-no-reorder.sh +++ b/tests/misc/runcon-no-reorder.sh @@ -27,7 +27,7 @@ echo "$diag" > exp || framework_failure_ # On such a system it fails with the above diagnostic, which is fine. # Before the no-reorder change, it would have failed with a diagnostic # about -j being an invalid option. -runcon $(id -Z) true -j 2> out && : > exp +runcon $(id -Z) true -j 2> out && > exp # When run on a system with no /selinux/context (i.e., in a chroot), # it chcon fails with this: "runcon: invalid context: \ diff --git a/tests/mv/partition-perm.sh b/tests/mv/partition-perm.sh index 2a25e52..713988f 100755 --- a/tests/mv/partition-perm.sh +++ b/tests/mv/partition-perm.sh @@ -21,11 +21,11 @@ print_ver_ mv cleanup_() { rm -rf "$other_partition_tmpdir"; } . "$abs_srcdir/tests/other-fs-tmpdir" -: > file -chmod a=rwx file +> file || framework_failure_ +chmod a=rwx file || framework_failure_ umask 077 -mv file "$other_partition_tmpdir" +mv file "$other_partition_tmpdir" || framework_failure_ test -f file && fail=1 test -f "$other_partition_tmpdir/file" || fail=1 diff --git a/tests/rm/r-root.sh b/tests/rm/r-root.sh index 04a88eb..e17b85b 100755 --- a/tests/rm/r-root.sh +++ b/tests/rm/r-root.sh @@ -104,7 +104,7 @@ test -d dir && framework_failure_ # rm(1) must succeed as before, but this time both the evidence file "x" # and the test file / directory must still exist afterward. mkdir dir || framework_failure_ -: > file || framework_failure_ +> file || framework_failure_ skip= for file in dir file ; do @@ -168,8 +168,8 @@ done # Exercise "rm -r file1 / file2". # Expect a non-Zero exit status representing failure to remove "/", # yet 'file1' and 'file2' should be removed. -: > file1 || framework_failure_ -: > file2 || framework_failure_ +> file1 || framework_failure_ +> file2 || framework_failure_ # Now that we know that 'rm' won't call the unlinkat() system function for "/", # we could probably execute it without the LD_PRELOAD'ed safety net. diff --git a/tests/split/l-chunk.sh b/tests/split/l-chunk.sh index 066fb01..792c556 100755 --- a/tests/split/l-chunk.sh +++ b/tests/split/l-chunk.sh @@ -71,7 +71,7 @@ DEBUGGING= test "$DEBUGGING" && test "$VERBOSE" && set +x for ELIDE_EMPTY in '' '-e'; do for IO_BLKSIZE in 1 2 5 10 80 100; do - : > out + > out test "$DEBUGGING" && printf "\n---io-blk-size=$IO_BLKSIZE $ELIDE_EMPTY\n" for N in 6 8 12 15 22; do rm -f x* @@ -119,15 +119,15 @@ test "$DEBUGGING" && test "$VERBOSE" && set -x # Check extraction of particular chunks -: > out +> out printf '1\n12345\n' > exp split -n l/13/15 in > out compare exp out || fail=1 -: > out +> out printf '' > exp split -n l/14/15 in > out compare exp out || fail=1 -: > out +> out printf '1\n12345\n1\n' > exp split -n l/15/15 in > out compare exp out || fail=1 diff --git a/tests/split/line-bytes.sh b/tests/split/line-bytes.sh index 9dc06a6..5f6f505 100755 --- a/tests/split/line-bytes.sh +++ b/tests/split/line-bytes.sh @@ -63,8 +63,8 @@ cat <<\EOF > no_eol_splits_exp EOF for b in $(seq 10); do - : > splits - : > no_eol_splits + > splits + > no_eol_splits for s in $(seq 11); do rm x?? split ---io=$b -C$s in || fail=1 diff --git a/tests/tail-2/inotify-rotate.sh b/tests/tail-2/inotify-rotate.sh index a95f4ec..1c942cc 100755 --- a/tests/tail-2/inotify-rotate.sh +++ b/tests/tail-2/inotify-rotate.sh @@ -47,7 +47,7 @@ for i in $(seq 50); do # Normally less than a second is required here, but with heavy load # and a lot of disk activity, even 20 seconds is insufficient, which # leads to this timeout killing tail before the "ok" is written below. - :>k && :>x || framework_failure_ failed to initialize files + >k && >x || framework_failure_ failed to initialize files timeout 40 tail -F k > out 2>&1 & pid=$! sleep .1 diff --git a/tests/tail-2/retry.sh b/tests/tail-2/retry.sh index 5b74b74..dbe66a4 100755 --- a/tests/tail-2/retry.sh +++ b/tests/tail-2/retry.sh @@ -45,7 +45,7 @@ grep -F 'tail: warning: --retry ignored' out || fail=1 # === Test: # Ensure that "tail --retry --follow=name" waits for the file to appear. # Clear 'out' so that we can check its contents without races -:>out || framework_failure_ +>out || framework_failure_ timeout 10 tail -s.1 --follow=name --retry missing >out 2>&1 & pid=$! retry_delay_ wait4lines_ .1 6 1 || fail=1 # Wait for "cannot open" error. echo "X" > missing || fail=1 diff --git a/tests/tail-2/symlink.sh b/tests/tail-2/symlink.sh index 362cb63..b21f9e1 100755 --- a/tests/tail-2/symlink.sh +++ b/tests/tail-2/symlink.sh @@ -32,7 +32,7 @@ wait4lines_ () # Ensure changing targets of cli specified symlinks are handled. # Prior to v8.22, inotify would fail to recognize changes in the targets. # Clear 'out' so that we can check its contents without races. -:>out || framework_failure_ +>out || framework_failure_ ln -nsf target symlink || framework_failure_ timeout 10 tail -s.1 -F symlink >out 2>&1 & pid=$! retry_delay_ wait4lines_ .1 6 1 || fail=1 # Wait for "cannot open..." @@ -50,7 +50,7 @@ rm -f target out || framework_failure_ # Ensure we correctly handle the source symlink itself changing. # I.E. that we don't operate solely on the targets. # Clear 'out' so that we can check its contents without races. -:>out || framework_failure_ +>out || framework_failure_ echo "X1" > target1 || framework_failure_ ln -nsf target1 symlink || framework_failure_ timeout 10 tail -s.1 -F symlink >out 2>&1 & pid=$! diff --git a/tests/tail-2/wait.sh b/tests/tail-2/wait.sh index 42a93bf..13898ac 100755 --- a/tests/tail-2/wait.sh +++ b/tests/tail-2/wait.sh @@ -52,7 +52,7 @@ for inotify in ---disable-inotify ''; do grep -Ev 'inotify (resources exhausted|cannot be used)' tail.err > x mv x tail.err test -s tail.err && fail=1 - :>tail.err + >tail.err tail_F() { diff --git a/tests/touch/read-only.sh b/tests/touch/read-only.sh index 95cd4f7..d239738 100755 --- a/tests/touch/read-only.sh +++ b/tests/touch/read-only.sh @@ -20,7 +20,7 @@ print_ver_ touch skip_if_root_ -: > read-only || framework_failure_ +> read-only || framework_failure_ chmod 444 read-only || framework_failure_ -- 1.7.7.6 --------------070804040007000702090207-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 05 17:02:08 2014 Received: (at 16940) by debbugs.gnu.org; 5 Mar 2014 22:02:08 +0000 Received: from localhost ([127.0.0.1]:52013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLJtA-0004A7-Kr for submit@debbugs.gnu.org; Wed, 05 Mar 2014 17:02:08 -0500 Received: from moutng.kundenserver.de ([212.227.17.24]:51096) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WLJt8-00049w-Kp for 16940@debbugs.gnu.org; Wed, 05 Mar 2014 17:02:07 -0500 Received: from [192.168.1.11] (p57A5D1AD.dip0.t-ipconnect.de [87.165.209.173]) by mrelayeu.kundenserver.de (node=mreue102) with ESMTP (Nemesis) id 0M2dm9-1XAfWL2g4r-00sN2f; Wed, 05 Mar 2014 23:02:04 +0100 Message-ID: <53179EDC.6060801@bernhard-voelker.de> Date: Wed, 05 Mar 2014 23:02:04 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= Subject: Re: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist References: <1393990487-5253-1-git-send-email-tipecaml@gmail.com> <5316A5F4.1080103@draigBrady.com> <5316EB92.1000907@bernhard-voelker.de> <53174101.1060108@draigBrady.com> <53174635.3020101@bernhard-voelker.de> <531754DB.1020201@draigBrady.com> <5317757D.3030307@draigBrady.com> In-Reply-To: <5317757D.3030307@draigBrady.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:l3Cji9zTO3xTpoR5HkEeAyD90W2RBHaU7v4iXRu8u7X jgyoOMZ3Y6wEnFQNG2pxsmgcp80fg6oFCSaXfNsd+Uh8gocRZz LhVNNJD/pgrRQFQEtjIEzTUsbaCMLWXW4jr7btdOWMEfO/vYxm 151G6GMufbyarB5bhYqRz1ss+IRAbX2FJywv6LiPX7ixIqcJdp U7ymUYyZcle5Tig9VgrtNwsP7gEnklpAOtbSnqZcyV7wtLPzGr p3IbuDUOOFY1fvWb1ccrLa4RiuVJiDEAouWHgmw7giB1mptr93 pzdineNOSi5Vv4nVVjPnW+H8TJ4ijrmw/+kIhfmx66N/kvCUxs c++ix7sHpeJsv5wL5kS9/hZ7UJGICEHuHtxwBjyfK X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 16940 Cc: 16940@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 03/05/2014 08:05 PM, PĆ”draig Brady wrote: > On 03/05/2014 04:46 PM, PĆ”draig Brady wrote: >> Note the ':>' is problematic though as the : always returns true. >> Well it does for solaris, freebsd, dash, bash-4.3 at least. >> In ksh and bash<=4.2 it does return an error as you assumed. >> The ':>' construct is only needed for csh anyway I think >> which we don't support. >> >> I notice a few more cases: git grep ": *>.*" >> which I'll fix in a follow up patch with maybe a syntax check. > > Attached. Great, looks good. Thanks & have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 10 11:53:16 2018 Received: (at control) by debbugs.gnu.org; 10 Oct 2018 15:53:16 +0000 Received: from localhost ([127.0.0.1]:43702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gAGnR-0000aZ-Uf for submit@debbugs.gnu.org; Wed, 10 Oct 2018 11:53:16 -0400 Received: from mail-pl1-f176.google.com ([209.85.214.176]:43337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gAGnQ-0000aN-Dj for control@debbugs.gnu.org; Wed, 10 Oct 2018 11:53:12 -0400 Received: by mail-pl1-f176.google.com with SMTP id 30-v6so2728944plb.10 for ; Wed, 10 Oct 2018 08:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=GBwryLuVyf0v48fz8kIG9SeN9dZF9WX518JvUYXRzMs=; b=QYSiDeNW8t0owFlJ28HOKvmPYHzGSWf2nYGxZ8T1HdvbB+IiSs8G7b0o7TvChKAyCp es+SjGkYr9FZPafWGeYCYJR7LRSdLM/UTEWcTztXQUDzjVxUUEwBAiOsUrGmMyIZRW39 Rs2GHVMvRrgHZnnJP7rH6nTnnsxyoD1grbpvPE+MKh8Gw2+YpRjuCPv6RTVSskmQeLr7 S8GqjZ+Lfz5pe1Aoy40EJXZTH9AkbUbq+mpxuvBlvIYHVNe/Wn5FQc/CgOwBPnJG8FUi XZNeHI6sIUk4L8L4m3oOY66RsbOWPx6IDGTn9kN0b6v1gmfNwEb+gOvkJg8cNI099ANH 8esA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=GBwryLuVyf0v48fz8kIG9SeN9dZF9WX518JvUYXRzMs=; b=PqU1gVt9I6HM61N1xSR+ea6A7Hp+Py3CQnde9n0rpIcYhkmqSK9XlEHH6PCwTEilpt 55PyhHW/BxksjObIQ7zf6PGmtdwLpa9ijau67sFhYEo1yFcROElR/gsLCX6mt+xda75R OlkcAqrs+G4gZkWqwYbiuh9lTCnco6pNJwmsfNolmums26YMlmBG/QaXEqeI4R2Ar1Q2 Dlh4d7cpt08BKCZUqVRnmkMRHLztTh3cJg3RhmQpbx3ivq8SrFjXELNbctczhk72iDtK lyqCFNgIYa/By9SXpFMT1V2evSM/12RcVmzMOy95tBQF4cXH83l4vdJoWKh15xa+XDWO x6Bw== X-Gm-Message-State: ABuFfojCxaB3839ouAoYHA/CAWS/F07PKTVvvVUU5cC9jU9mhCcg5C5F eBG9j2eb27aH49af5QOy+05XGZMM+q4= X-Google-Smtp-Source: ACcGV63be+PgrpFXoZPsRxQsyfXfn0CMPG3CQsuaMS6Yy5+2z2tfPnEZ9Vt4BMc8Lkgx/+L/DKzPfQ== X-Received: by 2002:a17:902:b482:: with SMTP id y2-v6mr315322plr.322.1539186785953; Wed, 10 Oct 2018 08:53:05 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id b62-v6sm35892109pfa.159.2018.10.10.08.53.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 08:53:04 -0700 (PDT) To: control@debbugs.gnu.org From: Assaf Gordon Message-ID: <85104995-e015-d1c8-a457-7ac3b4349742@gmail.com> Date: Wed, 10 Oct 2018 09:53:03 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 18062 fixed close 18062 tags 16940 fixed close 16940 tags 17590 fixed close 17590 [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.214.176 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tags 18062 fixed close 18062 tags 16940 fixed close 16940 tags 17590 fixed close 17590 tags 18316 fixed close 18316 tags 18531 fixed close 18531 From unknown Sat Jun 21 12:15:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 08 Nov 2018 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator