Don't set child->requests to NULL in parent after fork
[Samba/bb.git] / testsuite / lib / smbclient.exp
blobdc55d72139cbfdd7bc24077a446577a602458de0
2 # Utilities for driving smbclient
5 # Variables
7 set smb_prompt "smb: \\\\>"
9 # Spawn smbclient and wait for a prompt
11 proc spawn_smbclient { args } {
12 set result 0
13 global smb_prompt
14 global spawn_id
16 # Spawn smbclient
18 spawn smbclient [lindex $args 0] [lindex $args 1] [lindex $args 2] \
19 [lindex $args 3] [lindex $args 4] [lindex $args 5] \
20 [lindex $args 6]
22 # Wait for prompt
24 expect {
25 $smb_prompt { set result 1 }
26 timeout { perror "timed out spawning smbclient" }
27 eof { perror "end of file spawning smbclient" }
30 return $result
33 # Run a command and wait for a prompt
35 proc do_smbclient { args } {
36 set action [lindex $args 0]
37 set description [lindex $args 1]
38 global smb_prompt
40 # Send command
42 verbose $action
44 send $action
46 expect {
47 $smb_prompt {}
48 timeout { perror "timed out $description"; return -1}
49 eof { perror "end of file $description"; return -1 }
52 verbose $expect_out(buffer)
53 return $expect_out(buffer)