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
17 .
`dirname $0`/..
/..
/..
/testprogs
/blackbox
/subunit.sh
19 samba4bindir
="$BINDIR"
20 DD
="$samba4bindir/cifsdd"
29 testit
"$message" $VALGRIND $DD $CONFIGURATION --debuglevel=$DEBUGLEVEL -W "$DOMAIN" -U "$USERNAME"%"$PASSWORD" \
30 "$@" || failed
=`expr $failed + 1`
34 testit
"$1" cmp "$2" "$3" || failed
=`expr $failed + 1`
37 sourcepath
=tempfile.src.$$
38 destpath
=tempfile.dst.$$
40 # Create a source file with arbitrary contents
41 dd if=$DD of
=$sourcepath bs
=1024 count
=50 > /dev
/null
45 for bs
in 512 4k
48k
; do
47 echo "Testing $bs block size ..."
49 # Check whether we can do local IO
50 runcopy
"Testing local -> local copy" if=$sourcepath of
=$destpath bs
=$bs
51 compare
"Checking local differences" $sourcepath $destpath
53 # Check whether we can do a round trip
54 runcopy
"Testing local -> remote copy" \
55 if=$sourcepath of
=//$SERVER/$SHARE/$sourcepath bs
=$bs
56 runcopy
"Testing remote -> local copy" \
57 if=//$SERVER/$SHARE/$sourcepath of
=$destpath bs
=$bs
58 compare
"Checking differences" $sourcepath $destpath
60 # Check that copying within the remote server works
61 runcopy
"Testing local -> remote copy" \
62 if=//$SERVER/$SHARE/$sourcepath of
=//$SERVER/$SHARE/$sourcepath bs
=$bs
63 runcopy
"Testing remote -> remote copy" \
64 if=//$SERVER/$SHARE/$sourcepath of
=//$SERVER/$SHARE/$destpath bs
=$bs
65 runcopy
"Testing remote -> local copy" \
66 if=//$SERVER/$SHARE/$destpath of
=$destpath bs
=$bs
67 compare
"Checking differences" $sourcepath $destpath
71 rm -f $sourcepath $destpath