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 "ls -l $dir; rm -rf $dir" EXIT
24 COPY=${libinternaltestsuitedir:-$(dirname "$0")}/copy
30 $COPY $dir/$nr-in $dir/$nr-out
31 cmp -s $dir/$nr-in $dir/$nr-out
34 ## Usage: execCheck <nr> [<dd-args>*]
40 dd if=/dev/urandom of=$dir/$nr-in "$@" &>/dev/null
45 ### Check 1: small file copy
46 execCheck 01 bs=10 count=1
48 ### Check 2: PAGESIZEd file copy
49 execCheck 02 bs=4096 count=1
52 ### Check 3: PAGESIZE+1 file copy
53 execCheck 03 bs=4097 count=1
55 ### Check 4: small sparse file copy
56 execCheck 04 bs=10 count=1 seek=1
58 ### Check 5: large sparse file copy
59 execCheck 05 bs=4097 count=1 seek=1
61 ### Check 6: large sparse file copy
62 execCheck 06 bs=4098 count=1 seek=1
64 ### Check 7: large sparse file copy
65 execCheck 07 bs=4099 count=1 seek=1
67 ### Check 8: large sparse file copy
68 execCheck 08 bs=4100 count=1 seek=1
70 ### Check 9: huge sparse file copy
71 execCheck 09 bs=1024 count=1 seek=$[ 1024*1024 * 5 ]