added new tests and better diagnostic
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 24 Mar 2005 12:42:43 +0000 (12:42 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 24 Mar 2005 12:42:43 +0000 (12:42 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1978 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/lib_internal/testsuite/copy-check

index 7730e41..33af41e 100755 (executable)
@@ -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 <nr> [<dd-args>*]
@@ -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
+}