]> arthur.barton.de Git - ngircd-alex.git/blob - src/testsuite/message-test.e
ngIRCd Release 22~rc1
[ngircd-alex.git] / src / testsuite / message-test.e
1 # ngIRCd test suite
2 # PRIVMSG and NOTICE test
3
4 spawn telnet localhost 6789
5 expect {
6         timeout { exit 1 }
7         "Connected"
8 }
9
10 send "nick nick\r"
11 send "user user . . :User\r"
12 expect {
13         timeout { exit 1 }
14         "376"
15 }
16
17 send "privmsg nick :test\r"
18 expect {
19         timeout { exit 1 }
20         "@* PRIVMSG nick :test"
21 }
22
23 send "privmsg nick\r"
24 expect {
25         timeout { exit 1 }
26         "412"
27 }
28
29 send "privmsg\r"
30 expect {
31         timeout { exit 1 }
32         "411"
33 }
34
35 send "privmsg nick,nick :test\r"
36 expect {
37         timeout { exit 1 }
38         "@* PRIVMSG nick :test\r*@* PRIVMSG nick :test"
39 }
40
41 send "privmsg Nick,#testChannel,nick :test\r"
42 expect {
43         timeout { exit 1 }
44         "@* PRIVMSG nick :test\r*401*@* PRIVMSG nick :test"
45 }
46
47 send "privmsg doesnotexist :test\r"
48 expect {
49         timeout { exit 1 }
50         "401"
51 }
52
53 send "privmsg ~UsEr@ngIRCd.Test.Server :test\r"
54 expect {
55         timeout { exit 1 }
56         "@* PRIVMSG nick :test"
57 }
58
59 send "mode nick +b\r"
60 expect {
61         timeout { exit 1 }
62         "MODE nick :+b"
63 }
64 send "privmsg nick :test\r"
65 expect {
66         timeout { exit 1 }
67         "486"
68 }
69 send "mode nick -b\r"
70 expect {
71         timeout { exit 1 }
72         "MODE nick :-b"
73 }
74
75 # The following two tests using "localhost" as host name
76 # had to be disabled, because there are operating systems
77 # out there, that use "localhost.<domain>" as host name
78 # for 127.0.0.1 instead of just "localhost".
79 # (for example OpenBSD 4, OpenSolaris, ...)
80 #
81 #send "privmsg ~user\%localhost :test\r"
82 #expect {
83 #       timeout { exit 1 }
84 #       "@* PRIVMSG nick :test"
85 #}
86 #
87 #send "privmsg Nick!~User@LocalHost :test\r"
88 #expect {
89 #       timeout { exit 1 }
90 #       "@* PRIVMSG nick :test"
91 #       "401"
92 #}
93
94 send "away :away\r"
95 expect {
96         timeout { exit 1 }
97         "306"
98 }
99
100 send "privmsg nick :test\r"
101 expect {
102         timeout { exit 1 }
103         "301"
104 }
105
106 send "away\r"
107 expect {
108         timeout { exit 1 }
109         "305"
110 }
111
112 send "privmsg \$ngircd.test.server :test\r"
113 expect {
114         timeout { exit 1 }
115         "481"
116 }
117
118 send "privmsg #*.de :test\r"
119 expect {
120         timeout { exit 1 }
121         "481"
122 }
123
124 send "oper TestOp 123\r"
125
126 send "privmsg \$ngircd.test.server :test\r"
127 expect {
128         timeout { exit 1 }
129         "@* PRIVMSG nick :test"
130 }
131
132 send "privmsg \$*.test*.server :test\r"
133 expect {
134         timeout { exit 1 }
135         "@* PRIVMSG nick :test"
136 }
137
138 send "privmsg \$noDotServer :test\r"
139 expect {
140         timeout { exit 1 }
141         "401"
142 }
143
144 send "quit\r"
145 expect {
146         timeout { exit 1 }
147         "Connection closed"
148 }