#!/bin/sh # this runs the file serving tests that are expected to pass with samba3 if [ $# != 2 ]; then cat <&1 | \ grep $prompt if [ $? = 0 ] ; then # got a prompt .. fail echo matched interactive prompt in non-interactive mode false else true fi } # Test that an interactive smbclient prompts to stdout test_interactive_prompt_stdout() { prompt="smb" tmpfile=/tmp/smbclient.in.$$ cat > $tmpfile </dev/null | \ grep $prompt if [ $? = 0 ] ; then # got a prompt .. succeed rm -f $tmpfile true else echo failed to match interactive prompt on stdout rm -f $tmpfile false fi } testit "smbclient -L $SERVER_IP" $SMBCLIENT -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1` testit "smbclient -L $SERVER" $SMBCLIENT -L $SERVER -N -p 139 || failed=`expr $failed + 1` testit "noninteractive smbclient does not prompt" \ test_noninteractive_no_prompt || \ failed=`expr $failed + 1` testit "noninteractive smbclient -l does not prompt" \ test_noninteractive_no_prompt -l /tmp || \ failed=`expr $failed + 1` testit "interactive smbclient prompts on stdout" \ test_interactive_prompt_stdout || \ failed=`expr $failed + 1` testit "interactive smbclient -l prompts on stdout" \ test_interactive_prompt_stdout -l /tmp || \ failed=`expr $failed + 1` testok $0 $failed