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 samba4bindir=`dirname $0`/../../source/bin
18 DD=$samba4bindir/cifsdd
32 if [ x$status = x0 ]; then
36 failed=`expr $failed + 1`
45 testit "$message" $VALGRIND $DD $CONFIGURATION --debuglevel=$DEBUGLEVEL -W "$DOMAIN" -U "$USERNAME"%"$PASSWORD" \
50 testit "$1" cmp "$2" "$3"
53 sourcepath=tempfile.src.$$
54 destpath=tempfile.dst.$$
56 # Create a source file with arbitrary contents
57 dd if=$DD of=$sourcepath bs=1024 count=50 > /dev/null
61 for bs in 512 4k 48k ; do
63 echo "Testing $bs block size ..."
65 # Check whether we can do local IO
66 runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs
67 compare "Checking local differences" $sourcepath $destpath
69 # Check whether we can do a round trip
70 runcopy "Testing local -> remote copy" \
71 if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs
72 runcopy "Testing remote -> local copy" \
73 if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs
74 compare "Checking differences" $sourcepath $destpath
76 # Check that copying within the remote server works
77 runcopy "Testing local -> remote copy" \
78 if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs
79 runcopy "Testing remote -> remote copy" \
80 if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath bs=$bs
81 runcopy "Testing remote -> local copy" \
82 if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bs
83 compare "Checking differences" $sourcepath $destpath
87 rm -f $sourcepath $destpath