Tweaked an error message and a comment.
[rsync/rsync.git] / testsuite / acls.test
CommitLineData
1c3344a1
WD
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
12case "$RSYNC" in
1c53e517 13*protocol=29*) test_skipped "ACL support requires protocol 30" ;;
1c3344a1
WD
14esac
15
16case "$setfacl_nodef" in
17true) test_skipped "I don't know how to use your setfacl command" ;;
18esac
19
20makepath "$fromdir/foo"
21echo something >"$fromdir/file1"
22echo else >"$fromdir/file2"
23
24files='foo file1 file2'
25
26setfacl -m u:0:7 "$fromdir/foo" || test_skipped "Your filesystem has ACLs disabled"
27setfacl -m u:0:5 "$fromdir/file1"
28setfacl -m u:0:5 "$fromdir/file2"
29
30$RSYNC -avvA "$fromdir/" "$todir/"
31
32cd "$fromdir"
33getfacl $files >"$scratchdir/acls.txt"
34
35cd "$todir"
36getfacl $files | diff $diffopt "$scratchdir/acls.txt" -
37
38# The script would have aborted on error, so getting here means we've won.
39exit 0