Allow a local-server copy to use -X and -A even if a --protocol-version
[rsync/rsync.git] / testsuite / acls.test
1 #! /bin/sh
2
3 # This program is distributable under the terms of the GNU GPL (see
4 # COPYING).
5
6 # Test that rsync handles basic ACL preservation.
7
8 . $srcdir/testsuite/rsync.fns
9
10 $RSYNC --version | grep ", ACLs" >/dev/null || test_skipped "Rsync is configured without ACL support"
11
12 case "$setfacl_nodef" in
13 true) test_skipped "I don't know how to use your setfacl command" ;;
14 esac
15
16 makepath "$fromdir/foo"
17 echo something >"$fromdir/file1"
18 echo else >"$fromdir/file2"
19
20 files='foo file1 file2'
21
22 setfacl -m u:0:7 "$fromdir/foo" || test_skipped "Your filesystem has ACLs disabled"
23 setfacl -m u:0:5 "$fromdir/file1"
24 setfacl -m u:0:5 "$fromdir/file2"
25
26 $RSYNC -avvA "$fromdir/" "$todir/"
27
28 cd "$fromdir"
29 getfacl $files >"$scratchdir/acls.txt"
30
31 cd "$todir"
32 getfacl $files | diff $diffopt "$scratchdir/acls.txt" -
33
34 # The script would have aborted on error, so getting here means we've won.
35 exit 0