test_cifsdd.sh

来自「samba最新软件」· Shell 代码 · 共 74 行

SH
74
字号
#!/bin/sh# Basic script to make sure that cifsdd can do both local and remote I/O.if [ $# -lt 4 ]; thencat <<EOFUsage: test_cifsdd.sh SERVER USERNAME PASSWORD DOMAINEOFexit 1;fiSERVER=$1USERNAME=$2PASSWORD=$3DOMAIN=$4. `dirname $0`/subunit.shsamba4bindir=`dirname $0`/../../source/binDD=$samba4bindir/cifsddSHARE=tmpDEBUGLEVEL=1runcopy() {	message="$1"	shift		testit "$message" $VALGRIND $DD $CONFIGURATION --debuglevel=$DEBUGLEVEL -W "$DOMAIN" -U "$USERNAME"%"$PASSWORD" \	    "$@" || failed=`expr $failed + 1`}compare() {    testit "$1" cmp "$2" "$3" || failed=`expr $failed + 1`}sourcepath=tempfile.src.$$destpath=tempfile.dst.$$# Create a source file with arbitrary contentsdd if=$DD of=$sourcepath bs=1024 count=50 > /dev/nullls -l $sourcepathfor bs in 512 4k 48k ; doecho "Testing $bs block size ..."# Check whether we can do local IOruncopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bscompare "Checking local differences" $sourcepath $destpath# Check whether we can do a round tripruncopy "Testing local -> remote copy" \	    if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs runcopy "Testing remote -> local copy" \	    if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs compare "Checking differences" $sourcepath $destpath # Check that copying within the remote server worksruncopy "Testing local -> remote copy" \	    if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bsruncopy "Testing remote -> remote copy" \	    if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath bs=$bs runcopy "Testing remote -> local copy" \	    if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bscompare "Checking differences" $sourcepath $destpathdonerm -f $sourcepath $destpathexit $failed

⌨️ 快捷键说明

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