3 # Basic script to make sure that cifsdd can do both local and remote I/O.
7 Usage: test_cifsdd.sh SERVER USERNAME PASSWORD DOMAIN
31 if [ x$status = x0 ]; then
35 failed=`expr $failed + 1`
46 testit "$message" $VALGRIND $DD $CONFIGURATION --debuglevel=$DEBUGLEVEL -W "$DOMAIN" -U "$USERNAME"%"$PASSWORD" \
51 tesit "$1" cmp "$2" "$3"
54 sourcepath=tempfile.src.$$
55 destpath=tempfile.dst.$$
57 # Create a source file with arbitrary contents
58 dd if=$DD of=$sourcepath bs=1024 count=50 > /dev/null
62 for bs in 512 4k 48k ; do
64 echo "Testing $bs block size ..."
66 # Check whether we can do local IO
67 runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs
68 compare "Checking local differences" $sourcepath $destpath
70 # Check whether we can do a round trip
71 runcopy "Testing local -> remote copy" \
72 if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs
73 runcopy "Testing remote -> local copy" \
74 if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs
75 compare "Checking differences" $sourcepath $destpath
77 # Check that copying within the remote server works
78 runcopy "Testing local -> remote copy" \
79 if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs
80 runcopy "Testing remote -> remote copy" \
81 if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath bs=$bs
82 runcopy "Testing remote -> local copy" \
83 if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bs
84 compare "Checking differences" $sourcepath $destpath
88 rm -f $sourcepath $destpath