From: Wayne Davison Date: Sat, 29 Sep 2007 02:26:23 +0000 (+0000) Subject: Added support for OS X testing using chmod +a and ls. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/c50a9076e120e1600823cc8e901dbefd89f1f5d7 Added support for OS X testing using chmod +a and ls. --- diff --git a/testsuite/acls.test b/testsuite/acls.test index 9d9288f8..fe827ba7 100644 --- a/testsuite/acls.test +++ b/testsuite/acls.test @@ -9,34 +9,54 @@ $RSYNC --version | grep ", ACLs" >/dev/null || test_skipped "Rsync is configured without ACL support" -case "$setfacl_nodef" in -true) test_skipped "I don't know how to use your setfacl command" ;; -esac - makepath "$fromdir/foo" echo something >"$fromdir/file1" echo else >"$fromdir/file2" files='foo file1 file2' -setfacl -m u:0:7 "$fromdir/foo" || test_skipped "Your filesystem has ACLs disabled" -setfacl -m g:1:5 "$fromdir/foo" -setfacl -m g:2:1 "$fromdir/foo" -setfacl -m g:0:7 "$fromdir/foo" -setfacl -m u:2:1 "$fromdir/foo" -setfacl -m u:1:5 "$fromdir/foo" - -setfacl -m u:0:5 "$fromdir/file1" - -setfacl -m u:0:5 "$fromdir/file2" +case "$setfacl_nodef" in +true) + if ! chmod --help 2>&1 | fgrep +a >/dev/null; then + test_skipped "I don't know how to use setfacl or chmod for ACLs" + fi + chmod +a "root allow read,write,execute" "$fromdir/foo" || test_skipped "Your filesystem has ACLs disabled" + chmod +a "root allow read,execute" "$fromdir/file1" + chmod +a "admin allow read" "$fromdir/file1" + chmod +a "daemon allow read,write" "$fromdir/file1" + chmod +a "root allow read,execute" "$fromdir/file2" + + see_acls() { + ls -le "${@}" + } + ;; +*) + setfacl -m u:0:7 "$fromdir/foo" || test_skipped "Your filesystem has ACLs disabled" + setfacl -m g:1:5 "$fromdir/foo" + setfacl -m g:2:1 "$fromdir/foo" + setfacl -m g:0:7 "$fromdir/foo" + setfacl -m u:2:1 "$fromdir/foo" + setfacl -m u:1:5 "$fromdir/foo" + + setfacl -m u:0:5 "$fromdir/file1" + setfacl -m g:0:4 "$fromdir/file1" + setfacl -m u:1:6 "$fromdir/file1" + + setfacl -m u:0:5 "$fromdir/file2" + + see_acls() { + getfacl "${@}" + } + ;; +esac cd "$fromdir" $RSYNC -avvA $files "$todir/" -getfacl $files >"$scratchdir/acls.txt" +see_acls $files >"$scratchdir/acls.txt" cd "$todir" -getfacl $files | diff $diffopt "$scratchdir/acls.txt" - +see_acls $files | diff $diffopt "$scratchdir/acls.txt" - # The script would have aborted on error, so getting here means we've won. exit 0