changeset 10149:2f94bd2a861d

Use different test code for Cygwin.
author Bruno Haible <bruno@clisp.org>
date Mon, 02 Jun 2008 23:55:00 +0200
parents 193862d1f436
children 0c9f7838132c
files ChangeLog tests/test-copy-acl.sh tests/test-copy-file.sh tests/test-file-has-acl.sh tests/test-set-mode-acl.sh
diffstat 5 files changed, 104 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jun 02 16:47:54 2008 +0200
+++ b/ChangeLog	Mon Jun 02 23:55:00 2008 +0200
@@ -1,3 +1,10 @@
+2008-06-02  Bruno Haible  <bruno@clisp.org>
+
+	* tests/test-file-has-acl.sh: Use different code for Cygwin.
+	* tests/test-set-mode-acl.sh: Likewise.
+	* tests/test-copy-acl.sh: Likewise.
+	* tests/test-copy-file.sh: Likewise.
+
 2008-06-02  Bruno Haible  <bruno@clisp.org>
 
 	* tests/test-file-has-acl.sh: Remove unused code.
--- a/tests/test-copy-acl.sh	Mon Jun 02 16:47:54 2008 +0200
+++ b/tests/test-copy-acl.sh	Mon Jun 02 23:55:00 2008 +0200
@@ -191,7 +191,7 @@
     if test "$agid" = "$mygid"; then agid=2; fi
 
     case $acl_flavor in
-      linux | cygwin | freebsd | solaris)
+      linux | freebsd | solaris)
 
         # Set an ACL for a user.
         setfacl -m user:$auid:1 tmpfile0
@@ -265,6 +265,43 @@
 
         ;;
 
+      cygwin)
+
+        # Set an ACL for a group.
+        setfacl -m group:0:1 tmpfile0
+
+        func_test_copy tmpfile0 tmpfile2
+
+        # Set an ACL for other.
+        setfacl -m other:4 tmpfile0
+
+        func_test_copy tmpfile0 tmpfile4
+
+        # Remove the ACL for the group.
+        setfacl -d group:0 tmpfile0
+
+        func_test_copy tmpfile0 tmpfile5
+
+        # Remove the ACL for other.
+        setfacl -d other:4 tmpfile0
+
+        func_test_copy tmpfile0 tmpfile6
+
+        # Delete all optional ACLs.
+        setfacl -s user::6,group::0,other:0 tmpfile0
+
+        func_test_copy tmpfile0 tmpfile8
+
+        # Copy ACLs from a file that has no ACLs.
+        echo > tmpfile9
+        chmod a+x tmpfile9
+        getfacl tmpfile9 | setfacl -f - tmpfile0
+        rm -f tmpfile9
+
+        func_test_copy tmpfile0 tmpfile9
+
+        ;;
+
       hpux)
 
         # Set an ACL for a user.
--- a/tests/test-copy-file.sh	Mon Jun 02 16:47:54 2008 +0200
+++ b/tests/test-copy-file.sh	Mon Jun 02 23:55:00 2008 +0200
@@ -189,7 +189,7 @@
     if test "$agid" = "$mygid"; then agid=2; fi
 
     case $acl_flavor in
-      linux | cygwin | freebsd | solaris)
+      linux | freebsd | solaris)
 
         # Set an ACL for a user.
         setfacl -m user:$auid:1 tmpfile0
@@ -263,6 +263,43 @@
 
         ;;
 
+      cygwin)
+
+        # Set an ACL for a group.
+        setfacl -m group:0:1 tmpfile0
+
+        func_test_copy tmpfile0 tmpfile2
+
+        # Set an ACL for other.
+        setfacl -m other:4 tmpfile0
+
+        func_test_copy tmpfile0 tmpfile4
+
+        # Remove the ACL for the group.
+        setfacl -d group:0 tmpfile0
+
+        func_test_copy tmpfile0 tmpfile5
+
+        # Remove the ACL for other.
+        setfacl -d other:4 tmpfile0
+
+        func_test_copy tmpfile0 tmpfile6
+
+        # Delete all optional ACLs.
+        setfacl -s user::6,group::0,other:0 tmpfile0
+
+        func_test_copy tmpfile0 tmpfile8
+
+        # Copy ACLs from a file that has no ACLs.
+        echo > tmpfile9
+        chmod a+x tmpfile9
+        getfacl tmpfile9 | setfacl -f - tmpfile0
+        rm -f tmpfile9
+
+        func_test_copy tmpfile0 tmpfile9
+
+        ;;
+
       hpux)
 
         # Set an ACL for a user.
--- a/tests/test-file-has-acl.sh	Mon Jun 02 16:47:54 2008 +0200
+++ b/tests/test-file-has-acl.sh	Mon Jun 02 23:55:00 2008 +0200
@@ -188,7 +188,7 @@
     if test "$agid" = "$mygid"; then agid=2; fi
 
     case $acl_flavor in
-      linux | cygwin | freebsd | solaris)
+      linux | freebsd | solaris)
 
         # Set an ACL for a user.
         if setfacl -m user:$auid:1 tmpfile0; then
@@ -220,6 +220,21 @@
         fi
         ;;
 
+      cygwin)
+
+        # Set an ACL for a group.
+        if setfacl -m group:0:1 tmpfile0; then
+
+          func_test_has_acl tmpfile0 yes
+
+          # Remove the ACL for the group.
+          setfacl -d group:0 tmpfile0
+
+          func_test_has_acl tmpfile0 no
+
+        fi
+        ;;
+
       hpux)
 
         # Set an ACL for a user.
--- a/tests/test-set-mode-acl.sh	Mon Jun 02 16:47:54 2008 +0200
+++ b/tests/test-set-mode-acl.sh	Mon Jun 02 23:55:00 2008 +0200
@@ -148,11 +148,14 @@
         # Prepare a file with an ACL.
         echo "Special contents" > tmpfile2
         chmod 600 tmpfile2
-        # Set an ACL for a user.
+        # Set an ACL for a user (or group).
         case $acl_flavor in
-          linux | cygwin | freebsd | solaris)
+          linux | freebsd | solaris)
             setfacl -m user:$auid:1 tmpfile0
             ;;
+          cygwin)
+            setfacl -m group:0:1 tmpfile0
+            ;;
           hpux)
             orig=`lsacl tmpfile0 | sed -e 's/ tmpfile0$//'`
             chacl -r "${orig}($auid.%,--x)" tmpfile0