Changed dup-detection code to keep the first item in the user's args.
[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
1c3344a1
WD
12case "$setfacl_nodef" in
13true) test_skipped "I don't know how to use your setfacl command" ;;
14esac
15
16makepath "$fromdir/foo"
17echo something >"$fromdir/file1"
18echo else >"$fromdir/file2"
19
20files='foo file1 file2'
21
22setfacl -m u:0:7 "$fromdir/foo" || test_skipped "Your filesystem has ACLs disabled"
fdfc6740
WD
23setfacl -m g:1:5 "$fromdir/foo"
24setfacl -m g:2:1 "$fromdir/foo"
25setfacl -m g:0:7 "$fromdir/foo"
26setfacl -m u:2:1 "$fromdir/foo"
27setfacl -m u:1:5 "$fromdir/foo"
28
1c3344a1 29setfacl -m u:0:5 "$fromdir/file1"
fdfc6740 30
1c3344a1
WD
31setfacl -m u:0:5 "$fromdir/file2"
32
1c3344a1 33cd "$fromdir"
49f7162e
WD
34$RSYNC -avvA $files "$todir/"
35
1c3344a1
WD
36getfacl $files >"$scratchdir/acls.txt"
37
38cd "$todir"
39getfacl $files | diff $diffopt "$scratchdir/acls.txt" -
40
41# The script would have aborted on error, so getting here means we've won.
42exit 0