1#
2# Test operations on IPC$ share
3#
4
5# Initialisation
6
7load_lib env-single.exp
8load_lib smbclient.exp
9
10set timeout 10
11
12# Spawn a smbclient
13
14if {![spawn_smbclient //$server/ipc\$ -U $user]} {
15    perror "error spawning smbclient"
16    return -1
17}
18
19#
20# Start performing tests
21#
22
23global smb_prompt
24
25do_smbclient "lcd /tmp\r" "lcd /tmp"
26do_smbclient "!touch test.out\r" "touch test.out"
27
28foreach { op } { "dir\r" "put test.out\r" "get test.out\r" \
29	"get /etc/passwd\r" "mkdir foo\r" "print test.out\r" } {
30
31    set action "doing $op"
32    set output [do_smbclient $op $action]
33
34    if {![regexp "ERR" $output]} {
35	fail $action
36	puts $output
37    } else {
38	pass $action
39    }
40}
41
42# Clean up
43
44file delete test.out
45