xref: /openbsd-src/regress/usr.bin/rsync/test8_times.test (revision 3a0ab0b7dc0bc040bcb641a6f2b0af3eb7aa0dc1)
1#! /bin/sh
2
3# testing modification time. This is tricky for two reasons:
4# - BSD find only emits minutes granularity
5# - the test might run less than a second, but the rsync
6#   protocol has 1 second roundoff in times
7# So we set some time older than this software for some
8# parts of the original tree.
9
10. ${tstdir-.}/lib.sh
11. ${tstdir-.}/conf.sh
12
13rm -rf dir1 dir2 dir3
14# make the copy-from-here tree
15mkdir dir1
16cd dir1
17touch -d 1975-10-21T01:01:01 foo
18# make the tree we want to compare to
19mkdir ../dir2
20cd ../dir2
21touch -d 1975-10-21T01:01:01 foo
22
23# test a - we want the time corrected
24mkdir ../dir3
25cd ../dir3
26touch -d 1975-10-21T01:01:01 foo
27
28cd ..
29# call -a
30$rsync -Dgorltp dir1/ dir3
31compare_trees dir2 dir3
32