From unknown Tue Jun 17 22:29:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70866: panic-tests.sh test fails when run as root Resent-From: Bruno Haible Original-Sender: "Debbugs-submit" Resent-CC: bug-sed@gnu.org Resent-Date: Fri, 10 May 2024 20:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70866 X-GNU-PR-Package: sed X-GNU-PR-Keywords: To: 70866@debbugs.gnu.org X-Debbugs-Original-To: bug-sed@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17153711736520 (code B ref -1); Fri, 10 May 2024 20:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 May 2024 19:59:33 +0000 Received: from localhost ([127.0.0.1]:43830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5WOz-0001h6-1P for submit@debbugs.gnu.org; Fri, 10 May 2024 15:59:33 -0400 Received: from lists.gnu.org ([209.51.188.17]:45250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5WOw-0001h0-Vl for submit@debbugs.gnu.org; Fri, 10 May 2024 15:59:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5WOx-0002UU-LP for bug-sed@gnu.org; Fri, 10 May 2024 15:59:31 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5WOv-0007uW-C5 for bug-sed@gnu.org; Fri, 10 May 2024 15:59:31 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1715371165; cv=none; d=strato.com; s=strato-dkim-0002; b=OHcy0gcAopxcaLmRi0enXMZSKEj4DcSp8jXSJeJT+KZZFRjCoiRnDxaoGCzngKkkp/ 7+KjBembXuFRZvuOOT9LSM0C7Fj/NT9mCDczCbOrY0sKM1I3cchENRE7dehbj74Ldqq1 1zeF3Pkbu//HYHzAQ1XgCLHbss0hbmocVJM3PMGVwzMSmR9/f4Nvx3bPnLQHAdwxe4rh zECPUTKKO6NdDH+3bHqYNWl7VzcrEg4q747TfLAXPGHSnGhm8ygbrHN75BFCI8IY3WNG AcP1wz8+dH+HtFmGTLM/hqk4qALEGyqwJig47SIFUwbfm6J19r8q7cO3AYvDX1/DGxNH kHJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1715371165; s=strato-dkim-0002; d=strato.com; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=nf96piTP5Z3YKFZxyYrjeCul67kcMsyg/PGygPOiWuU=; b=QsIvd5JGnuEtnqNncm6j8WAjzX+C4VHWnZtgf39n4kFXiFOlkMJFGINWUXNTtZDx/3 gMLlkcYeHcUMaE/HWMNZsmJTILWxIL4tOWY+wqlLe9xzuDZFqhdBHWJcw7xZe8wxNx0m X/uYiojfp8ghvqNtxwUc1DpTmbC5X/fVkhDUhIxUmOAMVi5YYWVAH47Sfnus6j7qS1a0 UYn+jiG19xRXweUnYoFQXUdkoOSHWVno6Ea5mRJbeDTuXP0diBmDfntDmkEf2rb96hj5 WU3omtq5HbVq85MedeqsQ5Al2BASqLDrdOzrw+JrLlV0ASdDhn0Up6fqxTebS1uGVmkE DgcA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1715371165; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=nf96piTP5Z3YKFZxyYrjeCul67kcMsyg/PGygPOiWuU=; b=kx2NKdOB4RJcfyk9TgUNU4zTIhZ6xNUXmi9fIlAVNOa/XH8R2y93KWmhUv4rlAJCpv pMBvFfQAihjiJCLWauZuOajk3g30gR0m2z2lbJRj4TNGkTjmgRaK1JgzVC6sP5UJMIwm UbVCoahA3D5Y7HtfncA9FgbCmFt8h/GLoMSGvN2QI2vqWUHsY8Lk5ahrgeB47ql5TiRw UcCXTt9EPHy+OrDy1hXAgfnF7+cKN49R/wNMx3VRrqpR6Lr+KghElvg0sKQsLzP/+yY8 o48QdPejZWISfseMj1BU1Yf3J0teFB12VCwnN7qfBHzJspHZEY5lnWaMzsOD+a/kagAL 7JJw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1715371165; s=strato-dkim-0003; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=nf96piTP5Z3YKFZxyYrjeCul67kcMsyg/PGygPOiWuU=; b=DmbL6J0VZn44J+aFx5DGggHv0YQI2MjPevg/T3Og2W5ts+CUE/7frW5c6R99XKaz5H w8GnB3s0GZEVzm05o2CQ== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPE1fZqMe64aneQ1hJFPysKQo56Vg==" Received: from nimes.localnet by smtp.strato.de (RZmta 50.5.0 AUTH) with ESMTPSA id Ndd2ca04AJxPEmf (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 10 May 2024 21:59:25 +0200 (CEST) From: Bruno Haible Date: Fri, 10 May 2024 21:59:24 +0200 Message-ID: <8771416.UesdLuknzO@nimes> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart13553615.ICPdZLu4VQ" Content-Transfer-Encoding: 7Bit Received-SPF: none client-ip=85.215.255.22; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) 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: -3.3 (---) This is a multi-part message in MIME format. --nextPart13553615.ICPdZLu4VQ Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi, Running "make check" as root produces 1 test failure: FAIL: testsuite/panic-tests.sh This is annoying, because - in many CI situations (for example, when using Docker images), the uid is 0, - in Haiku as well, the uid is 0. The attached patch fixes it. --nextPart13553615.ICPdZLu4VQ Content-Disposition: attachment; filename="0001-tests-avoid-test-failure-when-running-as-root.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="0001-tests-avoid-test-failure-when-running-as-root.patch" >From 109b2126681bb44ca3c1ad74848daa33ca8c7c5f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 10 May 2024 20:40:32 +0200 Subject: [PATCH] tests: avoid test failure when running as root * testsuite/panic-tests.sh: When running as root, skip the test. --- testsuite/panic-tests.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testsuite/panic-tests.sh b/testsuite/panic-tests.sh index 85aeec5..000f515 100644 --- a/testsuite/panic-tests.sh +++ b/testsuite/panic-tests.sh @@ -27,6 +27,9 @@ mkdir a || framework_failure_ touch a/a || framework_failure_ chmod a-w a || framework_failure_ +# skip the test when running as root +test `id -u` != 0 || skip_ 'running as root' + # Expected error message, with actual filename/errno trimmed cat <<\EOF >exp-err-temp || framework_failure_ sed: couldn't open temporary file -- 2.34.1 --nextPart13553615.ICPdZLu4VQ-- From unknown Tue Jun 17 22:29:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70866: panic-tests.sh test fails when run as root Resent-From: Bruno Haible Original-Sender: "Debbugs-submit" Resent-CC: bug-sed@gnu.org Resent-Date: Fri, 10 May 2024 22:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70866 X-GNU-PR-Package: sed X-GNU-PR-Keywords: To: 70866@debbugs.gnu.org X-Debbugs-Original-To: bug-sed@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171537915612243 (code B ref -1); Fri, 10 May 2024 22:13:01 +0000 Received: (at submit) by debbugs.gnu.org; 10 May 2024 22:12:36 +0000 Received: from localhost ([127.0.0.1]:44414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5YTk-0003BP-44 for submit@debbugs.gnu.org; Fri, 10 May 2024 18:12:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:56002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s5YTi-0003BH-2l for submit@debbugs.gnu.org; Fri, 10 May 2024 18:12:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5YTh-0000n2-WF for bug-sed@gnu.org; Fri, 10 May 2024 18:12:34 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5YTf-0004rJ-OA for bug-sed@gnu.org; Fri, 10 May 2024 18:12:33 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1715379148; cv=none; d=strato.com; s=strato-dkim-0002; b=SKWWwVpXT9AdzZeuyY2YWvLsn3eSRf4qCOWDKao4H/xt+Ogjo38EL0JQckjlJ3XQ3x TgnOAXAZH/MwdDYjqKvfnAdykWrhMo2t3tUL98kK+4yJn0KmnO28nvlGQRnTz7GNt7+V g+b2+/84lgC7JWBbX6ZDrLiteCKV66ZIF/VV5SEV/g9OEzc5MWmU01pYimbU2bxJp5sm f9+U9dxV3cr22Ib1J+jxra8XgwG3cIlmzf7a3AWyaI9/OPRm24bQMFKtGq1C8ItSL3Ar 5t6PUg4TekN57r0UQogdF9Tk9gm18pn1oIZShPiE55eQEntqNEmJq+JbbGJ8ESdHd3T3 qkjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1715379148; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=1w5WV1QBqFe/JPqAOqzEyb2PGlVUg1PHPJrGVVr+amc=; b=XWX8C/oP9OuX75kPeseUez773MWitozFwEfDwn4mDT1gmdDwnjDZhKdRPQbZ5fMXm9 YH3UImhz8WBcg/dWc7OA4tcx1U5/ZORs6G3zBdbHvwg18jMVP0R81cfFybI84pxh7tPW zD3oTserr626VK+kHZkiOe24uOKfh5vjAAUl6Z8ArradgI/0tCJ/oSOrAqrKTqiLsS+B VE7/64hfgeUUAbElJe9N0hgMIon6E+o+ur6NTor16zRBKbsNxDnh5YeHyYhY2qR9RQgC 4VaXvQYlHm0ixCks63uYm88yCTPPvtLyofoPTvQlaTY7itpIWzarR5KPFZLhrix7Sofw T55w== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1715379148; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=1w5WV1QBqFe/JPqAOqzEyb2PGlVUg1PHPJrGVVr+amc=; b=LGzFV9OrWdYfZOmb9dSTtXKldDnndZwI52pG2EQ62oRIxy9eeY1qRRswBpx1So6mkt HKZxL0vFSXk64Jte/evn+/g1HEFKp/7OEIgNCivkK+vrfidYKKoNDrmjRL+UZOgTxoYl 3ajkaIdGjDIU5PDUF2+QybciXZhYnXRsOWNXhGJMp2aIvr4LybFMdZBUwhUdfr6CLvWi 1t6XzzR1Dkx2sNxqEPKMy1VXBkOeIBktYTSqGtBSDmX+9mcS1EjlfnL8aDWjS/46D20Y ZN9yjt47OQbJRbtGJ/NzDJAhcziYzcoWlF8psyty+Z+4wj6Ic5W1Ckp2wDoBiOtJzIIG CNiA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1715379148; s=strato-dkim-0003; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=1w5WV1QBqFe/JPqAOqzEyb2PGlVUg1PHPJrGVVr+amc=; b=uIIoaqc0pi/263ZPvLAGLQAQojddAAM0ce8CTbuSXiLfbjfEaKhKy8S7H5n5XJbwo0 ijDMSApTX2CdcAQvkaDg== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPE1fZqMe64aneQ1hJFPysKQo56Vg==" Received: from nimes.localnet by smtp.strato.de (RZmta 50.5.0 AUTH) with ESMTPSA id Ndd2ca04AMCSEwK (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sat, 11 May 2024 00:12:28 +0200 (CEST) From: Bruno Haible Date: Sat, 11 May 2024 00:12:27 +0200 Message-ID: <5934261.FGBNh6B6GM@nimes> In-Reply-To: <8771416.UesdLuknzO@nimes> References: <8771416.UesdLuknzO@nimes> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart5636080.SyXcmblsem" Content-Transfer-Encoding: 7Bit Received-SPF: none client-ip=85.215.255.22; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) 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: -3.3 (---) This is a multi-part message in MIME format. --nextPart5636080.SyXcmblsem Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" I wrote: > The attached patch fixes it. The same problem exists also on Cygwin. Here's a patch that fixes it for both cases (and obsoletes the previous patch). --nextPart5636080.SyXcmblsem Content-Disposition: attachment; filename="0001-tests-avoid-test-failure-when-running-as-root-or-in-.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="0001-tests-avoid-test-failure-when-running-as-root-or-in-.patch" >From f4f6f2086eb602da3a9c528a287156c3f2787145 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 10 May 2024 20:40:32 +0200 Subject: [PATCH] tests: avoid test failure when running as root or in Cygwin * testsuite/panic-tests.sh: When running as root or in Cygwin, skip the test. --- testsuite/panic-tests.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testsuite/panic-tests.sh b/testsuite/panic-tests.sh index 85aeec5..0244d92 100644 --- a/testsuite/panic-tests.sh +++ b/testsuite/panic-tests.sh @@ -27,6 +27,13 @@ mkdir a || framework_failure_ touch a/a || framework_failure_ chmod a-w a || framework_failure_ +# skip the test when running as root or when running in Cygwin +# (because in these cases, the directory is still actually writable) +test `id -u` != 0 || skip_ 'running as root' +case `uname -s` in + CYGWIN*) skip_ 'running in cygwin' ;; +esac + # Expected error message, with actual filename/errno trimmed cat <<\EOF >exp-err-temp || framework_failure_ sed: couldn't open temporary file -- 2.34.1 --nextPart5636080.SyXcmblsem--