⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_smbclient_s3.sh

📁 samba服务器!
💻 SH
字号:
#!/bin/sh# this runs the file serving tests that are expected to pass with samba3if [ $# != 2 ]; thencat <<EOFUsage: test_smbclient_s3.sh SERVER SERVER_IPEOFexit 1;fiSERVER="$1"SERVER_IP="$2"SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"incdir=`dirname $0`. $incdir/test_functions.shfailed=0# Test that a noninteractive smbclient does not prompttest_noninteractive_no_prompt(){    prompt="smb"    echo du | \	$SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp 2>&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 stdouttest_interactive_prompt_stdout(){    prompt="smb"    tmpfile=/tmp/smbclient.in.$$    cat > $tmpfile <<EOFduquitEOF    CLI_FORCE_INTERACTIVE=yes \    $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp \	< $tmpfile 2>/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 $CONFIGURATION -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1`testit "smbclient -L $SERVER" $SMBCLIENT $CONFIGURATION -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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -