3 # this runs the file serving tests that are expected to pass with samba3
7 Usage: test_smbclient_s3.sh SERVER SERVER_IP
14 SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"
17 . $incdir/test_functions.sh
21 # Test that a noninteractive smbclient does not prompt
22 test_noninteractive_no_prompt()
27 $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp 2>&1 | \
31 # got a prompt .. fail
32 echo matched interactive prompt in non-interactive mode
39 # Test that an interactive smbclient prompts to stdout
40 test_interactive_prompt_stdout()
43 tmpfile=/tmp/smbclient.in.$$
50 CLI_FORCE_INTERACTIVE=yes \
51 $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp \
52 < $tmpfile 2>/dev/null | \
56 # got a prompt .. succeed
60 echo failed to match interactive prompt on stdout
66 testit "smbclient -L $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1`
67 testit "smbclient -L $SERVER" $SMBCLIENT $CONFIGURATION -L $SERVER -N -p 139 || failed=`expr $failed + 1`
69 testit "noninteractive smbclient does not prompt" \
70 test_noninteractive_no_prompt || \
71 failed=`expr $failed + 1`
73 testit "noninteractive smbclient -l does not prompt" \
74 test_noninteractive_no_prompt -l /tmp || \
75 failed=`expr $failed + 1`
77 testit "interactive smbclient prompts on stdout" \
78 test_interactive_prompt_stdout || \
79 failed=`expr $failed + 1`
81 testit "interactive smbclient -l prompts on stdout" \
82 test_interactive_prompt_stdout -l /tmp || \
83 failed=`expr $failed + 1`