Use different test code for Cygwin.
authorBruno Haible <bruno@clisp.org>
Mon, 2 Jun 2008 21:55:00 +0000 (23:55 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 2 Jun 2008 21:55:00 +0000 (23:55 +0200)
ChangeLog
tests/test-copy-acl.sh
tests/test-copy-file.sh
tests/test-file-has-acl.sh
tests/test-set-mode-acl.sh

index b44d8a2b580be24343d7bf9bfc5a27eacf828326..6fbc18da528e6b5922aaec28012aa5d748df50cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index ba81e12da11387ea4d738538ac7ebc1400d66000..6d59702681362eebd76a70af694762b277a81636 100755 (executable)
@@ -191,7 +191,7 @@ cd "$builddir" ||
     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 @@ cd "$builddir" ||
 
         ;;
 
+      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.
index 26ee17e6c0ee15c94c2a4d36d1eda233c66ac262..58f9df455e35f791b8684af065475df3f159080b 100755 (executable)
@@ -189,7 +189,7 @@ cd "$builddir" ||
     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 @@ cd "$builddir" ||
 
         ;;
 
+      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.
index 7f1c376b6ca2fe9614f180a46b9a533fed1cff22..e2dbe9d084df3d3c93068756e552a99e8b7b0482 100755 (executable)
@@ -188,7 +188,7 @@ cd "$builddir" ||
     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 @@ cd "$builddir" ||
         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.
index ef468d9f3cbe4d7b505290f245bea5890163b332..4e58e0be8085588832dcf0e6de156690d8ab7e98 100755 (executable)
@@ -148,11 +148,14 @@ cd "$builddir" ||
         # 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