4 # Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; version 2 of the License.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 dir=$(mktemp -d ${TMP:-/var/tmp}/copy-check.XXXXXX)
22 trap "rm -rf $dir" EXIT
24 COPY=${libinternaltestsuitedir:-$(dirname "$0")}/copy
36 echo $"Test $nr '$msg' failed with code $rc"
45 execWrap "$nr" "copying" $COPY $dir/$nr-in $dir/$nr-out
46 execWrap "$nr" "comparing" cmp $dir/$nr-in $dir/$nr-out
49 ## Usage: execCheck <nr> [<dd-args>*]
55 dd if=/dev/urandom of=$dir/$nr-in "$@" &>/dev/null
62 ### Check 1: small file copy
63 execCheck 01 bs=10 count=1
65 ### Check 2: PAGESIZEd file copy
66 execCheck 02 bs=4096 count=1
68 ### Check 3: PAGESIZE+1 file copy
69 execCheck 03 bs=4097 count=1
71 ### Check 3a: really large file copy
72 test x"$ensc_use_expensive_tests" != xyes ||
73 execCheck 03a bs=$[ 64 * 1024*1024 + 23 ] count=1
75 ### Check 4: small sparse file copy
76 execCheck 04 bs=10 count=1 seek=1
78 ### Check 5: large sparse file copy
79 execCheck 05 bs=4097 count=1 seek=1
81 ### Check 6: large sparse file copy
82 execCheck 06 bs=4098 count=1 seek=1
84 ### Check 7: large sparse file copy
85 execCheck 07 bs=4099 count=1 seek=1
87 ### Check 8: large sparse file copy
88 execCheck 08 bs=4100 count=1 seek=1
90 ### Check 8a: really large sparse file copy
91 test x"$ensc_use_expensive_tests" != xyes ||
92 execCheck 08a bs=$[ 64 * 1024*1024 + 23 ] count=1 seek=1
94 ### Check 9: huge sparse file copy
95 test x"$ensc_use_expensive_tests" != xyes ||
96 execCheck 09 bs=1024 count=1 seek=$[ 1024*1024 * 5 ]
98 test x"$ensc_test_debug" != xyes || {