s4-param: use "state directory" and "cache directory" options
[Samba/gebeck_regimport.git] / testsuite / server / rename.exp
blob77e7297776bdc8c88315d5545247e38bbc1522c8
2 # Test misc file operations
5 # Initialisation
7 load_lib env-single.exp
8 load_lib smbclient.exp
10 set timeout 10
12 # Spawn a connection
14 if {![spawn_smbclient //$server/$share -U $user]} {
15 perror "error spawning smbclient"
16 return -1
19 # Do wildcard rename test
21 foreach { op } {"!touch /tmp/test.out\r" "lcd /tmp\r" "rm test.out\r" \
22 "put test.out\r"} {
24 set action "doing $op"
25 set output [do_smbclient $op $action]
27 if {[regexp "ERR" $output]} {
28 perror $action
29 puts $output
30 return -1;
34 file delete "/tmp/test.out"
36 # Perform rename
38 set output [do_smbclient "rename *.out *.dat\r" "wildcard rename"]
40 if {[regexp "ERR" $output]} {
41 perror "wildcard rename didn't work"
42 return -1
45 # Check it worked
47 set testname "wildcard match"
48 set output [do_smbclient "dir\r" "wildcard rename check"]
50 if {[regexp "test.dat" $output]} {
51 pass $testname
52 } else {
53 fail $testname
56 # Clean up
58 set op "rm test.dat\r"
59 do_smbclient $op "doing $op"