don't use /dev/null for a smbpasswd file
[ira/wip.git] / testsuite / server / rename.exp
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"