Remove a bunch of direct inbuf references by adding "buf" to smb_request
[Samba.git] / source3 / script / tests / test_smbclient_s3.sh
blobc10aed0ee650ee56eaffcc81fa39f805e8577c74
1 #!/bin/sh
3 # this runs the file serving tests that are expected to pass with samba3
5 if [ $# -lt 2 ]; then
6 cat <<EOF
7 Usage: test_smbclient_s3.sh SERVER SERVER_IP
8 EOF
9 exit 1;
12 SERVER="$1"
13 SERVER_IP="$2"
14 SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"
15 shift 2
16 ADDARGS="$*"
18 incdir=`dirname $0`
19 . $incdir/test_functions.sh
21 failed=0
23 # Test that a noninteractive smbclient does not prompt
24 test_noninteractive_no_prompt()
26 prompt="smb"
28 echo du | \
29 $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I SERVER_IP $ADDARGS 2>&1 | \
30 grep $prompt
32 if [ $? = 0 ] ; then
33 # got a prompt .. fail
34 echo matched interactive prompt in non-interactive mode
35 false
36 else
37 true
41 # Test that an interactive smbclient prompts to stdout
42 test_interactive_prompt_stdout()
44 prompt="smb"
45 tmpfile=/tmp/smbclient.in.$$
47 cat > $tmpfile <<EOF
49 quit
50 EOF
52 CLI_FORCE_INTERACTIVE=yes \
53 $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP \
54 $ADDARGS < $tmpfile 2>/dev/null | \
55 grep $prompt
57 if [ $? = 0 ] ; then
58 # got a prompt .. succeed
59 rm -f $tmpfile
60 true
61 else
62 echo failed to match interactive prompt on stdout
63 rm -f $tmpfile
64 false
68 testit "smbclient -L $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1`
69 testit "smbclient -L $SERVER -I $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER -I $SERVER_IP -N -p 139 || failed=`expr $failed + 1`
71 testit "noninteractive smbclient does not prompt" \
72 test_noninteractive_no_prompt || \
73 failed=`expr $failed + 1`
75 testit "noninteractive smbclient -l does not prompt" \
76 test_noninteractive_no_prompt -l /tmp || \
77 failed=`expr $failed + 1`
79 testit "interactive smbclient prompts on stdout" \
80 test_interactive_prompt_stdout || \
81 failed=`expr $failed + 1`
83 testit "interactive smbclient -l prompts on stdout" \
84 test_interactive_prompt_stdout -l /tmp || \
85 failed=`expr $failed + 1`
87 testok $0 $failed