1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

Test transfer of large random file w/o corruption.

This commit is contained in:
Tim Potter 0001-01-01 00:00:00 +00:00
parent 6d50bb36a6
commit a9790f1961

48
testsuite/server/xfer.exp Normal file
View File

@ -0,0 +1,48 @@
#
# Test file transfer
#
# Initialisation
load_lib util-defs.exp
load_lib smbclient.exp
load_lib env-single.exp
set timeout 60
# Spawn a connection
if {![spawn_smbclient //$server/$share -U $user]} {
perror "error spawning smbclient"
return -1
}
# Create a big file, store it and fetch it again
foreach { op } { "!dd if=/dev/urandom of=/tmp/file bs=1048576 count=1\r" \
"lcd /tmp\r" "put file\r" "get file /tmp/file2\r" } {
set action "doing $op"
set output [do_smbclient $op $action]
if {[regexp "ERR" $output]} {
error $action
puts $output
return -1
}
}
# Compare the two files
set output [util_start "diff" "/tmp/file /tmp/file2" ""]
if {[regexp "differ" $output]} {
fail "xfertest"
puts $output
} else {
pass "xfertest"
}
# Clean up temporary files
file delete /tmp/file /tmp/file2