~vcs-imports/samba/main

« back to all changes in this revision

Viewing changes to testsuite/server/xfer.exp

  • Committer: jerry
  • Date: 2006-07-14 21:48:39 UTC
  • Revision ID: vcs-imports@canonical.com-20060714214839-586d8c489a8fcead
gutting trunk to move to svn:externals

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# Test file transfer
3
 
#
4
 
 
5
 
# Initialisation
6
 
 
7
 
load_lib util-defs.exp
8
 
load_lib smbclient.exp
9
 
load_lib env-single.exp
10
 
 
11
 
set timeout 60
12
 
 
13
 
# Spawn a connection
14
 
 
15
 
if {![spawn_smbclient //$server/$share -U $user]} {
16
 
    perror "error spawning smbclient"
17
 
    return -1
18
 
}
19
 
 
20
 
# Create a big file, store it and fetch it again
21
 
 
22
 
foreach { op } { "!dd if=/dev/urandom of=/tmp/file bs=1048576 count=1\r" \
23
 
        "lcd /tmp\r" "put file\r" "get file /tmp/file2\r" } {
24
 
 
25
 
    set action "doing $op"
26
 
    set output [do_smbclient $op $action]
27
 
 
28
 
    if {[regexp "ERR" $output]} {
29
 
        error $action
30
 
        puts $output
31
 
        return -1
32
 
    }
33
 
}
34
 
 
35
 
# Compare the two files
36
 
 
37
 
set output [util_start "diff" "/tmp/file /tmp/file2" ""]
38
 
 
39
 
if {[regexp "differ" $output]} {
40
 
    fail "xfertest"
41
 
    puts $output
42
 
} else {
43
 
    pass "xfertest"
44
 
}
45
 
 
46
 
# Clean up temporary files
47
 
 
48
 
file delete /tmp/file /tmp/file2