xref: /openbsd-src/regress/usr.bin/rsync/test11_middlediff.test (revision 3a0ab0b7dc0bc040bcb641a6f2b0af3eb7aa0dc1)
1#! /bin/sh
2
3. ${tstdir-.}/lib.sh
4. ${tstdir-.}/conf.sh
5
6umask 022
7rm -rf dir1 dir2 dir3
8# make the copy-from-here tree
9mkdir dir1
10cd dir1
11generate_tree_1
12rm foo/baz/three.txt
13# make this file again the way we want it.
14dd if=/dev/zero bs=1m count=1 status=none > foo/bar/baz/one.txt
15echo foo >> foo/bar/baz/one.txt
16dd if=/dev/zero bs=1m count=1 status=none >> foo/bar/baz/one.txt
17# make the tree we want to compare to
18mkdir ../dir2
19cd ../dir2
20generate_tree_1
21rm foo/baz/three.txt
22# make this file again the way we want it.
23dd if=/dev/zero bs=1m count=1 status=none > foo/bar/baz/one.txt
24echo foo >> foo/bar/baz/one.txt
25dd if=/dev/zero bs=1m count=1 status=none >> foo/bar/baz/one.txt
26
27mkdir ../dir3
28cd ../dir3
29generate_tree_1
30rm foo/baz/three.txt
31# make this file different in the middle
32dd if=/dev/zero bs=1m count=1 status=none > foo/bar/baz/one.txt
33echo bar >> foo/bar/baz/one.txt
34dd if=/dev/zero bs=1m count=1 status=none >> foo/bar/baz/one.txt
35
36cd ..
37# openrsync needs the --ignore-times here since it doesn't have
38# a flag to force checksumming.
39echo $rsync -a --ignore-times dir1/ dir3
40$rsync --rsync-path openrsync -a --ignore-times dir1/ dir3
41compare_trees dir2 dir3
42