summaryrefslogtreecommitdiff
path: root/regress/usr.bin/rsync/test11_middlediff.test
blob: bef6f23e4e7477d14e49e1610376ddd1cc35916a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /bin/sh

. ${tstdir-.}/lib.sh
. ${tstdir-.}/conf.sh

umask 022
rm -rf dir1 dir2 dir3
# make the copy-from-here tree
mkdir dir1
cd dir1
generate_tree_1
rm foo/baz/three.txt
# make this file again the way we want it.
dd if=/dev/zero bs=1m count=1 status=none > foo/bar/baz/one.txt
echo foo >> foo/bar/baz/one.txt
dd if=/dev/zero bs=1m count=1 status=none >> foo/bar/baz/one.txt
# make the tree we want to compare to
mkdir ../dir2
cd ../dir2
generate_tree_1
rm foo/baz/three.txt
# make this file again the way we want it.
dd if=/dev/zero bs=1m count=1 status=none > foo/bar/baz/one.txt
echo foo >> foo/bar/baz/one.txt
dd if=/dev/zero bs=1m count=1 status=none >> foo/bar/baz/one.txt

mkdir ../dir3
cd ../dir3
generate_tree_1
rm foo/baz/three.txt
# make this file different in the middle
dd if=/dev/zero bs=1m count=1 status=none > foo/bar/baz/one.txt
echo bar >> foo/bar/baz/one.txt
dd if=/dev/zero bs=1m count=1 status=none >> foo/bar/baz/one.txt

cd ..
# openrsync needs the --ignore-times here since it doesn't have
# a flag to force checksumming.
echo $rsync -a --ignore-times dir1/ dir3
$rsync --rsync-path openrsync -a --ignore-times dir1/ dir3
compare_trees dir2 dir3