From: Enrico Scholz Date: Thu, 24 Mar 2005 12:42:43 +0000 (+0000) Subject: added new tests and better diagnostic X-Git-Tag: IPSENTINEL_VERSION_0_12~16 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f9721e4ec95e6b3ba945c498f93d33061ec5bcf;p=util-vserver.git added new tests and better diagnostic git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1978 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/lib_internal/testsuite/copy-check b/util-vserver/lib_internal/testsuite/copy-check index 7730e41..33af41e 100755 --- a/util-vserver/lib_internal/testsuite/copy-check +++ b/util-vserver/lib_internal/testsuite/copy-check @@ -25,10 +25,25 @@ COPY=${libinternaltestsuitedir:-$(dirname "$0")}/copy test -x "$COPY" +function execWrap() +{ + nr=$1 + msg=$2 + shift 2 + + "$@" || { + rc=$? + echo $"Test $nr '$msg' failed with code $rc" + return $rc + } + + return 0 +} + function doit() { - $COPY $dir/$nr-in $dir/$nr-out - LANG=C cmp -s $dir/$nr-in $dir/$nr-out + execWrap "$nr" "copying" $COPY $dir/$nr-in $dir/$nr-out + execWrap "$nr" "comparing" cmp -s $dir/$nr-in $dir/$nr-out } ## Usage: execCheck [*] @@ -42,16 +57,21 @@ function execCheck() doit $nr } +LANG=C + ### Check 1: small file copy execCheck 01 bs=10 count=1 ### Check 2: PAGESIZEd file copy execCheck 02 bs=4096 count=1 - ### Check 3: PAGESIZE+1 file copy execCheck 03 bs=4097 count=1 +### Check 3a: really large file copy +test x"$ensc_use_expensive_tests" != xyes || + execCheck 03a bs=$[ 64 * 1024*1024 + 23 ] count=1 + ### Check 4: small sparse file copy execCheck 04 bs=10 count=1 seek=1 @@ -67,6 +87,10 @@ execCheck 07 bs=4099 count=1 seek=1 ### Check 8: large sparse file copy execCheck 08 bs=4100 count=1 seek=1 +### Check 8a: really large sparse file copy +test x"$ensc_use_expensive_tests" != xyes || + execCheck 08a bs=$[ 64 * 1024*1024 + 23 ] count=1 seek=1 + ### Check 9: huge sparse file copy test x"$ensc_use_expensive_tests" != xyes || execCheck 09 bs=1024 count=1 seek=$[ 1024*1024 * 5 ] @@ -74,4 +98,4 @@ test x"$ensc_use_expensive_tests" != xyes || test x"$ensc_test_debug" != xyes || { ls -l $dir/* du $dir/* -} \ No newline at end of file +}