Subject: [PATCH] gnu: acl: Enable tests.
From: Kei Kebreau <[email-masked]>
To: [email-masked]
Cc: Kei Kebreau <[email-masked]>
Date: Sat, 24 Jun 2017 14:06:06 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/acl.scm (acl)[arguments]: Enable tests. Add 'patch-tests' phase.
---
 gnu/packages/acl.scm | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/acl.scm b/gnu/packages/acl.scm
index ae6764993..34f8c294a 100644
--- a/gnu/packages/acl.scm
+++ b/gnu/packages/acl.scm
@@ -44,19 +44,30 @@
       (patches (search-patches "acl-hurd-path-max.patch"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f   ; FIXME: Investigate test suite failures
-       #:test-target "tests"
+     `(#:test-target "tests"
        #:phases
         (alist-cons-after
          'build 'patch-exec-bin-sh
          (lambda _
            (substitute* "test/run"
              (("/bin/sh") (which "sh"))))
-         (alist-replace
-          'install
+         (alist-cons-before
+          'check 'patch-tests
           (lambda _
-            (zero? (system* "make" "install" "install-lib" "install-dev")))
-          %standard-phases))))
+            ;; The coreutils do not have an ACL bit to remove from their
+            ;; output, so the sed expression that removes the bit is disabled.
+            (substitute* "test/sbits-restore.test"
+              (("\\| sed.*'") ""))
+            ;; These tests require the existence of a user named "bin", but
+            ;; this user does not exist within Guix's build environment.
+            (for-each (lambda (file)
+                        (delete-file (string-append "test/" file)))
+                      '("setfacl-X.test" "cp.test" "misc.test")))
+          (alist-replace
+           'install
+           (lambda _
+             (zero? (system* "make" "install" "install-lib" "install-dev")))
+           %standard-phases)))))
     (inputs `(("attr" ,attr)))
     (native-inputs
      `(("gettext" ,gettext-minimal)
-- 
2.13.1