samba_kcc: Fix compile failures and correctly implement MS-ADTS 6.2.2.3.1 ISTG selection
[Samba.git] / source3 / script / tests / test_smbclient_posix_large.sh
blob0aee7afcc031d17e89621a76c1b260878f6c738e
1 #!/bin/sh
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: test_smbclient_posix_large.sh ccache smbclient3 server prefix <smbclient args>
6 EOF
7 exit 1;
8 fi
10 KRB5CCNAME=$1
11 export KRB5CCNAME
12 SMBCLIENT3=$2
13 SERVER=$3
14 PREFIX=$4
15 shift 4
16 ADDARGS="$*"
18 # Test that a noninteractive smbclient does not prompt
19 test_large_write_read()
22 cat > $PREFIX/largefile-script <<EOF
23 posix
24 put $PREFIX/largefile largefile
25 get largefile $PREFIX/largefile2
26 rm largefile
27 quit
28 EOF
30 cmd='$SMBCLIENT3 //$SERVER/xcopy_share $ADDARGS < $PREFIX/largefile-script 2>&1'
31 eval echo "$cmd"
32 out=`eval $cmd`
34 if [ $? != 0 ] ; then
35 echo "$out"
36 echo "command failed"
37 false
38 return
41 echo "$out" | grep "getting file" >/dev/null 2>&1
43 if [ $? = 0 ] ; then
44 true
45 else
46 echo did not get success message
47 false
51 rm -f $PREFIX/largefile
52 dd if=/dev/zero of=$PREFIX/largefile skip=$((20*1024*1024)) count=1 bs=1
54 incdir=`dirname $0`/../../../testprogs/blackbox
55 . $incdir/subunit.sh
57 testit "smbclient large posix write read" test_large_write_read || failed=`expr $failed + 1`
59 testit "cmp of read and written files" cmp $PREFIX/largefile $PREFIX/largefile2 || failed=`expr $failed + 1`
60 rm -f $PREFIX/largefile2
62 testok $0 $failed