Blob


1 spawn telnet localhost 6789
2 expect {
3 timeout { exit 1 }
4 "Connected"
5 }
7 send "nick nick\r"
8 send "user user . . :User\r"
9 expect {
10 timeout { exit 1 }
11 "376"
12 }
14 send "privmsg nick :test\r"
15 expect {
16 timeout { exit 1 }
17 "@* PRIVMSG nick :test"
18 }
20 send "privmsg nick\r"
21 expect {
22 timeout { exit 1 }
23 "412"
24 }
26 send "privmsg\r"
27 expect {
28 timeout { exit 1 }
29 "411"
30 }
32 send "privmsg nick,nick :test\r"
33 expect {
34 timeout { exit 1 }
35 "@* PRIVMSG nick :test\r*@* PRIVMSG nick :test"
36 }
38 send "privmsg nick,#testChannel,nick :test\r"
39 expect {
40 timeout { exit 1 }
41 "@* PRIVMSG nick :test\r*401*@* PRIVMSG nick :test"
42 }
44 send "privmsg doesnotexist :test\r"
45 expect {
46 timeout { exit 1 }
47 "401"
48 }
50 send "privmsg ~user@ngircd.test.server :test\r"
51 expect {
52 timeout { exit 1 }
53 "@* PRIVMSG nick :test"
54 }
56 # The following two tests using "localhost" as host name
57 # had to be disabled, because there are operating systems
58 # out there, that use "localhost.<domain>" as host name
59 # for 127.0.0.1 instead of just "localhost".
60 # (for example OpenBSD 4, OpenSolaris, ...)
61 #
62 #send "privmsg ~user\%localhost :test\r"
63 #expect {
64 # timeout { exit 1 }
65 # "@* PRIVMSG nick :test"
66 #}
67 #
68 #send "privmsg nick!~user@localhost :test\r"
69 #expect {
70 # timeout { exit 1 }
71 # "@* PRIVMSG nick :test"
72 # "401"
73 #}
75 send "away :away\r"
76 expect {
77 timeout { exit 1 }
78 "306"
79 }
81 send "privmsg nick :test\r"
82 expect {
83 timeout { exit 1 }
84 "301"
85 }
87 send "away\r"
88 expect {
89 timeout { exit 1 }
90 "305"
91 }
93 send "privmsg \$ngircd.test.server :test\r"
94 expect {
95 timeout { exit 1 }
96 "481"
97 }
99 send "privmsg #*.de :test\r"
100 expect {
101 timeout { exit 1 }
102 "481"
105 send "oper TestOp 123\r"
107 send "privmsg \$ngircd.test.server :test\r"
108 expect {
109 timeout { exit 1 }
110 "@* PRIVMSG nick :test"
113 send "privmsg \$*.test*.server :test\r"
114 expect {
115 timeout { exit 1 }
116 "@* PRIVMSG nick :test"
119 send "privmsg \$noDotServer :test\r"
120 expect {
121 timeout { exit 1 }
122 "401"
125 #cannot test host mask since localhost has no '.' as RFC requires
127 send "quit\r"
128 expect {
129 timeout { exit 1 }
130 "Connection closed"
133 # -eof-