X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-copy-file.sh;h=ad7da7be1d747a3ee593cb96a19883df38fccf94;hb=9cedf3e1ac7dbdddefb7e172156e9000de7d80c2;hp=26ee17e6c0ee15c94c2a4d36d1eda233c66ac262;hpb=28c952d8555a939d74a4096d63dba5c8e7863a90;p=gnulib.git diff --git a/tests/test-copy-file.sh b/tests/test-copy-file.sh index 26ee17e6c..ad7da7be1 100755 --- a/tests/test-copy-file.sh +++ b/tests/test-copy-file.sh @@ -172,13 +172,15 @@ cd "$builddir" || func_test_copy () { "$builddir"/test-copy-file${EXEEXT} "$1" "$2" || exit 1 - "$builddir"/test-sameacls${EXEEXT} "$1" "$2" || exit 1 - func_test_same_acls "$1" "$2" || exit 1 + if test "$USE_ACL" != 0; then + "$builddir"/test-sameacls${EXEEXT} "$1" "$2" || exit 1 + func_test_same_acls "$1" "$2" || exit 1 + fi } func_test_copy tmpfile0 tmpfile1 - if test $acl_flavor != none; then + if test "$USE_ACL" != 0 && test $acl_flavor != none; then # Use a user and group id different from the current one, to avoid # redundant/ambiguous ACLs. myuid=`id -u` @@ -189,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 @@ -263,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.