~vcs-imports/samba/main

« back to all changes in this revision

Viewing changes to testsuite/server/rename.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 misc file operations
3
 
#
4
 
 
5
 
# Initialisation
6
 
 
7
 
load_lib env-single.exp
8
 
load_lib smbclient.exp
9
 
 
10
 
set timeout 10
11
 
 
12
 
# Spawn a connection
13
 
 
14
 
if {![spawn_smbclient //$server/$share -U $user]} {
15
 
    perror "error spawning smbclient"
16
 
    return -1
17
 
}
18
 
 
19
 
# Do wildcard rename test
20
 
 
21
 
foreach { op } {"!touch /tmp/test.out\r" "lcd /tmp\r" "rm test.out\r" \
22
 
        "put test.out\r"} {
23
 
 
24
 
    set action "doing $op"
25
 
    set output [do_smbclient $op $action]
26
 
 
27
 
    if {[regexp "ERR" $output]} {
28
 
        perror $action
29
 
        puts $output
30
 
        return -1;
31
 
    }
32
 
}
33
 
 
34
 
file delete "/tmp/test.out"
35
 
 
36
 
# Perform rename
37
 
 
38
 
set output [do_smbclient "rename *.out *.dat\r" "wildcard rename"]
39
 
 
40
 
if {[regexp "ERR" $output]} {
41
 
    perror "wildcard rename didn't work"
42
 
    return -1
43
 
}
44
 
 
45
 
# Check it worked
46
 
 
47
 
set testname "wildcard match"
48
 
set output [do_smbclient "dir\r" "wildcard rename check"]
49
 
 
50
 
if {[regexp "test.dat" $output]} {
51
 
    pass $testname
52
 
} else {
53
 
    fail $testname
54
 
}
55
 
 
56
 
# Clean up
57
 
 
58
 
set op "rm test.dat\r"
59
 
do_smbclient $op "doing $op"