Subject: bug#62778: closed (Re: bug#62778: continuous integration test failure)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 11 Apr 2023 18:01:02 +0000

Your bug report

#62778: continuous integration test failure

which was filed against the gzip package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
62778: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62778
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#62778: continuous integration test failure
From: Paul Eggert <[email-masked]>
To: Bruno Haible <[email-masked]>
Cc: [email-masked]
Date: Tue, 11 Apr 2023 11:00:24 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks, I installed that.

Subject: continuous integration test failure
From: Bruno Haible <[email-masked]>
To: [email-masked]
Date: Tue, 11 Apr 2023 19:12:49 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Jim,

The continuous integration at https://gitlab.com/gnu-gzip/ci-distcheck/
shows a test failure:

FAIL: write-error
=================
../../../sources/gzip/build-aux/test-driver: line 107: ../../../sources/gzip/tests/write-error: Permission denied
FAIL write-error (exit status: 126)

A simple 'chmod a+x tests/write-error' fixes this one, for non-root
users.

When I run "make check" as root — which happens to be what the CI does —
I get another test failure:

FAIL write-error (exit status: 1)

The reason here is that even after 'chmod a-w d', the directory 'd'
is writable.

This patch fixes both issues. "make check" now passes again, both as a
normal user and as root.

>From 5520631bafe004aead6db710e66de2cf43fc0a80 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email-masked]>
Date: Tue, 11 Apr 2023 19:10:29 +0200
Subject: [PATCH] tests: Fix a test failure.

* tests/write-error: Make executable. Skip the test if we're running as root.
---
 tests/write-error | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 tests/write-error

diff --git a/tests/write-error b/tests/write-error
old mode 100644
new mode 100755
index 150c162..1f3a7f1
--- a/tests/write-error
+++ b/tests/write-error
@@ -24,7 +24,11 @@ fail=0
 mkdir d || framework_failure_
 echo > d/f || framework_failure_
 chmod a-w d || framework_failure_
-
-returns_ 1 gzip d/f > out 2> err || fail=1
+if test -w d; then
+  echo >&2 "$0: being root, skipping this test"
+  fail=77
+else
+  returns_ 1 gzip d/f > out 2> err || fail=1
+fi
 
 Exit $fail
-- 
2.34.1