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`
44 testit "$message" $VALGRIND $DD $CONFIGURATION --debuglevel=$DEBUGLEVEL -W "$DOMAIN" -U "$USERNAME"%"$PASSWORD" \
49 testit "$1" cmp "$2" "$3"
52 sourcepath=tempfile.src.$$
53 destpath=tempfile.dst.$$
55 # Create a source file with arbitrary contents
56 dd if=$DD of=$sourcepath bs=1024 count=50 > /dev/null
60 for bs in 512 4k 48k ; do
62 echo "Testing $bs block size ..."
64 # Check whether we can do local IO
65 runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs
66 compare "Checking local differences" $sourcepath $destpath
68 # Check whether we can do a round trip
69 runcopy "Testing local -> remote copy" \
70 if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs
71 runcopy "Testing remote -> local copy" \
72 if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs
73 compare "Checking differences" $sourcepath $destpath
75 # Check that copying within the remote server works
76 runcopy "Testing local -> remote copy" \
77 if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs
78 runcopy "Testing remote -> remote copy" \
79 if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath bs=$bs
80 runcopy "Testing remote -> local copy" \
81 if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bs
82 compare "Checking differences" $sourcepath $destpath
86 rm -f $sourcepath $destpath