From: Bruno Haible Date: Mon, 2 Jun 2008 21:55:00 +0000 (+0200) Subject: Use different test code for Cygwin. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee9cc09504e83403c347b501d8fb0f2589ea1037;p=pspp Use different test code for Cygwin. --- diff --git a/ChangeLog b/ChangeLog index b44d8a2b58..6fbc18da52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-02 Bruno Haible + + * 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 * tests/test-file-has-acl.sh: Remove unused code. diff --git a/tests/test-copy-acl.sh b/tests/test-copy-acl.sh index ba81e12da1..6d59702681 100755 --- a/tests/test-copy-acl.sh +++ b/tests/test-copy-acl.sh @@ -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. diff --git a/tests/test-copy-file.sh b/tests/test-copy-file.sh index 26ee17e6c0..58f9df455e 100755 --- a/tests/test-copy-file.sh +++ b/tests/test-copy-file.sh @@ -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. diff --git a/tests/test-file-has-acl.sh b/tests/test-file-has-acl.sh index 7f1c376b6c..e2dbe9d084 100755 --- a/tests/test-file-has-acl.sh +++ b/tests/test-file-has-acl.sh @@ -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. diff --git a/tests/test-set-mode-acl.sh b/tests/test-set-mode-acl.sh index ef468d9f3c..4e58e0be80 100755 --- a/tests/test-set-mode-acl.sh +++ b/tests/test-set-mode-acl.sh @@ -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