summaryrefslogtreecommitdiffstats
path: root/testsuite/lib
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2000-05-24 05:51:52 +0000
committerTim Potter <tpot@samba.org>2000-05-24 05:51:52 +0000
commit8af41e021f1847c7e7a2283a81863c23c11fe90d (patch)
tree85b732934059378ea3a36c0b9e9f10325f419935 /testsuite/lib
parent7fd62a26f77258f6a1eb621d2514e33380888cf0 (diff)
downloadsamba-8af41e021f1847c7e7a2283a81863c23c11fe90d.tar.gz
samba-8af41e021f1847c7e7a2283a81863c23c11fe90d.tar.xz
samba-8af41e021f1847c7e7a2283a81863c23c11fe90d.zip
Routines for driving smbclient from DejaGnu.
(This used to be commit fa6a360abeb324d6b4383dbb1bb717fc270aff81)
Diffstat (limited to 'testsuite/lib')
-rw-r--r--testsuite/lib/smbclient.exp52
1 files changed, 52 insertions, 0 deletions
diff --git a/testsuite/lib/smbclient.exp b/testsuite/lib/smbclient.exp
new file mode 100644
index 0000000000..e137ebd6c8
--- /dev/null
+++ b/testsuite/lib/smbclient.exp
@@ -0,0 +1,52 @@
+#
+# Utilities for driving smbclient
+#
+
+# Variables
+
+set smb_prompt "smb: \\\\>"
+
+# Spawn smbclient and wait for a prompt
+
+proc spawn_smbclient { args } {
+ set result 0
+ global smb_prompt
+ global spawn_id
+
+ # Spawn smbclient
+
+ spawn smbclient [lindex $args 0] [lindex $args 1] [lindex $args 2]
+
+ # Wait for prompt
+
+ expect {
+ $smb_prompt { set result 1 }
+ timeout { perror "timed out spawning smbclient" }
+ eof { perror "end of file spawning smbclient" }
+ }
+
+ return $result
+}
+
+# Run a command and wait for a prompt
+
+proc do_smbclient { args } {
+ set action [lindex $args 0]
+ set description [lindex $args 1]
+ global smb_prompt
+
+ # Send command
+
+ verbose $action
+
+ send $action
+
+ expect {
+ $smb_prompt { set output $expect_out(0,string) }
+ timeout { perror "timed out $description"; return -1}
+ eof { perror "end of file description"; return -1 }
+ }
+
+ verbose $output
+ return $output
+}