diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-01-27 15:20:17 +1100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-01-28 00:13:56 +0100 |
commit | 965b83158d12dc9fabe96471162c51529206d8e1 (patch) | |
tree | 8dcfa8880feb1f7f93b3363a590caf4de994c519 /source3/script | |
parent | 7d14f89e29ac96227aca9af5f3deba38182618ce (diff) | |
download | samba-965b83158d12dc9fabe96471162c51529206d8e1.tar.gz samba-965b83158d12dc9fabe96471162c51529206d8e1.tar.bz2 samba-965b83158d12dc9fabe96471162c51529206d8e1.zip |
s3-selftest: Add test for posix large reads and writes
This includes encrypted reads and writes, both NTLM and kerberos.
Andrew Bartlett
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Jan 28 00:13:57 CET 2012 on sn-devel-104
Diffstat (limited to 'source3/script')
-rwxr-xr-x | source3/script/tests/test_smbclient_posix_large.sh | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/source3/script/tests/test_smbclient_posix_large.sh b/source3/script/tests/test_smbclient_posix_large.sh new file mode 100755 index 0000000000..a5fdbba3ac --- /dev/null +++ b/source3/script/tests/test_smbclient_posix_large.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then +cat <<EOF +Usage: test_smbclient_posix_large.sh ccache smbclient3 server prefix <smbclient args> +EOF +exit 1; +fi + +KRB5CCNAME=$1 +export KRB5CCNAME +SMBCLIENT3=$2 +SERVER=$3 +PREFIX=$4 +shift 4 +ADDARGS="$*" + +# Test that a noninteractive smbclient does not prompt +test_large_write_read() +{ + + cat > $PREFIX/largefile-script <<EOF +posix +put $PREFIX/largefile largefile +get largefile $PREFIX/largefile2 +rm largefile +quit +EOF + + cmd='$SMBCLIENT3 //$SERVER/xcopy_share $ADDARGS < $PREFIX/largefile-script 2>&1' + eval echo "$cmd" + out=`eval $cmd` + + if [ $? != 0 ] ; then + echo "$out" + echo "command failed" + false + return + fi + + echo "$out" | grep "getting file" >/dev/null 2>&1 + + if [ $? = 0 ] ; then + true + else + echo did not get success message + false + fi +} + +rm -f $PREFIX/largefile +dd if=/dev/zero of=$PREFIX/largefile skip=20M count=1 bs=1 + +incdir=`dirname $0`/../../../testprogs/blackbox +. $incdir/subunit.sh + +testit "smbclient large posix write read" test_large_write_read || failed=`expr $failed + 1` + +testit "cmp of read and written files" cmp $PREFIX/largefile $PREFIX/largefile2 || failed=`expr $failed + 1` +rm -f $PREFIX/largefile2 + +testok $0 $failed |