3 # this runs the file serving tests that are expected to pass with samba3
7 Usage: test_smbclient_s3.sh SERVER SERVER_IP
12 BINDIR=`dirname $0`/../../bin
16 SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"
27 if [ x$status = x0 ]; then
35 # Test that a noninteractive smbclient does not prompt
36 test_noninteractive_no_prompt()
41 $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp 2>&1 | \
45 # got a prompt .. fail
46 echo matched interactive prompt in non-interactive mode
53 # Test that an interactive smbclient prompts to stdout
54 test_interactive_prompt_stdout()
57 tmpfile=/tmp/smbclient.in.$$
64 CLI_FORCE_INTERACTIVE=yes \
65 $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp \
66 < $tmpfile 2>/dev/null | \
70 # got a prompt .. succeed
74 echo failed to match interactive prompt on stdout
80 testit "smbclient -L $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1`
81 testit "smbclient -L $SERVER" $SMBCLIENT $CONFIGURATION -L $SERVER -N -p 139 || failed=`expr $failed + 1`
83 testit "noninteractive smbclient does not prompt" \
84 test_noninteractive_no_prompt || \
85 failed=`expr $failed + 1`
87 testit "noninteractive smbclient -l does not prompt" \
88 test_noninteractive_no_prompt -l /tmp || \
89 failed=`expr $failed + 1`
91 testit "interactive smbclient prompts on stdout" \
92 test_interactive_prompt_stdout || \
93 failed=`expr $failed + 1`
95 testit "interactive smbclient -l prompts on stdout" \
96 test_interactive_prompt_stdout -l /tmp || \
97 failed=`expr $failed + 1`