rename.exp

来自「samba-3.0.22.tar.gz 编译smb服务器的源码」· EXP 代码 · 共 60 行

EXP
60
字号
## Test misc file operations## Initialisationload_lib env-single.expload_lib smbclient.expset timeout 10# Spawn a connectionif {![spawn_smbclient //$server/$share -U $user]} {    perror "error spawning smbclient"    return -1}# Do wildcard rename testforeach { op } {"!touch /tmp/test.out\r" "lcd /tmp\r" "rm test.out\r" \	"put test.out\r"} {    set action "doing $op"    set output [do_smbclient $op $action]    if {[regexp "ERR" $output]} {  	perror $action	puts $output  	return -1;    }}file delete "/tmp/test.out"# Perform renameset output [do_smbclient "rename *.out *.dat\r" "wildcard rename"]if {[regexp "ERR" $output]} {    perror "wildcard rename didn't work"    return -1}# Check it workedset testname "wildcard match"set output [do_smbclient "dir\r" "wildcard rename check"]if {[regexp "test.dat" $output]} {    pass $testname} else {    fail $testname}# Clean upset op "rm test.dat\r"do_smbclient $op "doing $op"

⌨️ 快捷键说明

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