r20747: Move cifsdd to blackbox section
authorJelmer Vernooij <jelmer@samba.org>
Sun, 14 Jan 2007 01:39:34 +0000 (01:39 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:40:36 +0000 (14:40 -0500)
source/script/tests/tests_all.sh
testprogs/blackbox/test_cifsdd.sh [moved from source/script/tests/test_cifsdd.sh with 66% similarity]

index 9fde15f4de86b51d2b7263f5d8e24c429d8411c1..37d37ebd770acce9490925c0cd36d764a43f847c 100755 (executable)
@@ -10,7 +10,6 @@
  $SRCDIR/script/tests/test_echo.sh $SERVER $USERNAME $PASSWORD $DOMAIN || totalfailed=`expr $totalfailed + $?`
  $SRCDIR/script/tests/test_posix.sh //$SERVER/tmp $USERNAME $PASSWORD "" || totalfailed=`expr $totalfailed + $?`
  $SRCDIR/script/tests/test_local.sh || totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_pidl.sh || totalfailed=`expr $totalfailed + $?`
  $SRCDIR/script/tests/test_blackbox.sh $SERVER $USERNAME $PASSWORD $DOMAIN $PREFIX || totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_cifsdd.sh $SERVER $USERNAME $PASSWORD $DOMAIN || totalfailed=`expr $totalfailed + $?`
+ $SRCDIR/script/tests/test_pidl.sh || totalfailed=`expr $totalfailed + $?`
  $SRCDIR/script/tests/test_simple.sh //$SERVER/simple $USERNAME $PASSWORD "" || totalfailed=`expr $totalfailed + $?`
similarity index 66%
rename from source/script/tests/test_cifsdd.sh
rename to testprogs/blackbox/test_cifsdd.sh
index a8cc30a8a65e314ce068e1e163a2e9e0f2a6af6c..d216695821ea3feb50e3f0e156ead6d0a0827ba8 100755 (executable)
@@ -21,10 +21,24 @@ DEBUGLEVEL=1
 
 failed=0
 
-failtest() {
-       failed=`expr $failed + 1`
+testit() {
+       name="$1"
+       shift
+       cmdline="$*"
+       echo "test: $name"
+       $cmdline
+       status=$?
+       if [ x$status = x0 ]; then
+               echo "success: $name"
+       else
+               echo "failure: $name"
+               failed=`expr $failed + 1`
+       fi
+       return $status
 }
 
+
+
 runcopy() {
        message="$1"
        shift
@@ -34,12 +48,9 @@ runcopy() {
 }
 
 compare() {
-    cmp "$1" "$2"
+    tesit "$1" cmp "$2" "$3"
 }
 
-incdir=`dirname $0`
-. $incdir/test_functions.sh
-
 sourcepath=tempfile.src.$$
 destpath=tempfile.dst.$$
 
@@ -53,27 +64,27 @@ for bs in 512 4k 48k ; do
 echo "Testing $bs block size ..."
 
 # Check whether we can do local IO
-runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs || failtest
-compare $sourcepath $destpath || failtest
+runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs
+compare "Checking local differences" $sourcepath $destpath
 
 # Check whether we can do a round trip
 runcopy "Testing local -> remote copy" \
-           if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs || failtest
+           if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs 
 runcopy "Testing remote -> local copy" \
-           if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs || failtest
-compare $sourcepath $destpath || failtest
+           if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs 
+compare "Checking differences" $sourcepath $destpath 
 
 # Check that copying within the remote server works
 runcopy "Testing local -> remote copy" \
-           if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs || failtest
+           if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs
 runcopy "Testing remote -> remote copy" \
-           if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath bs=$bs || failtest
+           if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath bs=$bs 
 runcopy "Testing remote -> local copy" \
-           if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bs || failtest
-compare $sourcepath $destpath || failtest
+           if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bs
+compare "Checking differences" $sourcepath $destpath
 
 done
 
 rm -f $sourcepath $destpath
 
-testok $0 $failed
+exit $failed