Change all relevant occurrences of ``rsync'' and ``$rsync_bin'' to the
[rsync/rsync.git] / testsuite / chown.test
CommitLineData
b0d4f4c1
MP
1#! /bin/sh
2
3# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
4
5# This program is distributable under the terms of the GNU GPL (see
6# COPYING).
7
8# Test that when rsync is running as root and has -a it correctly sets
9# the ownership of the destination.
10
11# We don't know what users will be present on this system, so we just
12# use random numeric uids and gids.
13
14. $srcdir/testsuite/rsync.fns
15
16set -x
17
18# Build some hardlinks
19
20fromdir="$scratchdir/from"
21todir="$scratchdir/to"
22
23mkdir "$fromdir"
24name1="$fromdir/name1"
25name2="$fromdir/name2"
26echo "This is the file" > "$name1"
27echo "This is the other file" > "$name2"
28
79c9d8a1
MP
29chown 5000 "$name1" || test_skipped "Can't chown (probably need root)"
30chown 5001 "$name2" || test_skipped "Can't chown (probably need root)"
31chgrp 5002 "$name1" || test_skipped "Can't chgrp (probably need root)"
32chgrp 5003 "$name2" || test_skipped "Can't chgrp (probably need root)"
b0d4f4c1 33
06464f55 34checkit "$RSYNC -aHvv \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
b0d4f4c1
MP
35
36exit 0
37# last [] may have failed but if we get here then we've won
38