Touch $tmpdir/do_not_diff_the_files so that checkit does not try
[rsync/rsync.git] / testsuite / chown.test
... / ...
CommitLineData
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. "$suitedir/rsync.fns"
15
16# Build some hardlinks
17
18mkdir "$fromdir"
19name1="$fromdir/name1"
20name2="$fromdir/name2"
21echo "This is the file" > "$name1"
22echo "This is the other file" > "$name2"
23
24chown 5000 "$name1" || test_skipped "Can't chown (probably need root)"
25chown 5001 "$name2" || test_skipped "Can't chown (probably need root)"
26chgrp 5002 "$name1" || test_skipped "Can't chgrp (probably need root)"
27chgrp 5003 "$name2" || test_skipped "Can't chgrp (probably need root)"
28
29checkit "$RSYNC -aHvv \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
30
31# The script would have aborted on error, so getting here means we've won.
32exit 0