summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2000-05-24 05:58:58 +0000
committerTim Potter <tpot@samba.org>2000-05-24 05:58:58 +0000
commita9133e2df038c73d3e9f1ffec7628dbde289085c (patch)
treefefcf05e0b23805a10e0de329566e82bd2467478 /testsuite
parent5fd4dbf72e317bc47ab11b0b3f2e15d0c58879c8 (diff)
downloadsamba-a9133e2df038c73d3e9f1ffec7628dbde289085c.tar.gz
samba-a9133e2df038c73d3e9f1ffec7628dbde289085c.tar.xz
samba-a9133e2df038c73d3e9f1ffec7628dbde289085c.zip
Test wildcard rename function.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/server/rename.exp59
1 files changed, 59 insertions, 0 deletions
diff --git a/testsuite/server/rename.exp b/testsuite/server/rename.exp
new file mode 100644
index 00000000000..77e7297776b
--- /dev/null
+++ b/testsuite/server/rename.exp
@@ -0,0 +1,59 @@
+#
+# Test misc file operations
+#
+
+# Initialisation
+
+load_lib env-single.exp
+load_lib smbclient.exp
+
+set timeout 10
+
+# Spawn a connection
+
+if {![spawn_smbclient //$server/$share -U $user]} {
+ perror "error spawning smbclient"
+ return -1
+}
+
+# Do wildcard rename test
+
+foreach { op } {"!touch /tmp/test.out\r" "lcd /tmp\r" "rm test.out\r" \
+ "put test.out\r"} {
+
+ set action "doing $op"
+ set output [do_smbclient $op $action]
+
+ if {[regexp "ERR" $output]} {
+ perror $action
+ puts $output
+ return -1;
+ }
+}
+
+file delete "/tmp/test.out"
+
+# Perform rename
+
+set output [do_smbclient "rename *.out *.dat\r" "wildcard rename"]
+
+if {[regexp "ERR" $output]} {
+ perror "wildcard rename didn't work"
+ return -1
+}
+
+# Check it worked
+
+set testname "wildcard match"
+set output [do_smbclient "dir\r" "wildcard rename check"]
+
+if {[regexp "test.dat" $output]} {
+ pass $testname
+} else {
+ fail $testname
+}
+
+# Clean up
+
+set op "rm test.dat\r"
+do_smbclient $op "doing $op"