]> arthur.barton.de Git - ngircd-alex.git/blob - src/testsuite/misc-test.e
0623024da07997fcd9fe3e58a6bf44939b1d77c2
[ngircd-alex.git] / src / testsuite / misc-test.e
1 # $Id: misc-test.e,v 1.2 2008/02/17 13:51:00 alex Exp $
2
3 spawn telnet localhost 6789
4 expect {
5         timeout { exit 1 }
6         "Connected"
7 }
8
9 send "nick nick\r"
10 send "user user . . :User\r"
11 expect {
12         timeout { exit 1 }
13         "376"
14 }
15
16 # RFC 2812 Section 3.4.1
17
18 send "motd\r"
19 expect {
20         timeout { exit 1 }
21         "375"
22 }
23 expect {
24         timeout { exit 1 }
25         "372"
26 }
27 expect {
28         timeout { exit 1 }
29         "376"
30 }
31
32 send "motd ngircd.test.server\r"
33 expect {
34         timeout { exit 1 }
35         "375"
36 }
37 expect {
38         timeout { exit 1 }
39         "372"
40 }
41 expect {
42         timeout { exit 1 }
43         "376"
44 }
45
46 send "motd doesnotexist\r"
47 expect {
48         timeout { exit 1 }
49         "402"
50 # note this is not specified in RFC 2812, but probably should be
51 }
52
53 # RFC 2812 Section 3.4.3
54
55 send "version\r"
56 expect {
57         timeout { exit 1 }
58         "351"
59 }
60
61 send "version ngircd.test.server\r"
62 expect {
63         timeout { exit 1 }
64         "351"
65 }
66
67 send "version doesnotexist\r"
68 expect {
69         timeout { exit 1 }
70         "402"
71 }
72
73 # RFC 2812 Section 3.4.6
74
75 send "time\r"
76 expect {
77         timeout { exit 1 }
78         "391"
79 }
80
81 send "time ngircd.test.server\r"
82 expect {
83         timeout { exit 1 }
84         "391"
85 }
86
87 send "time doesnotexist\r"
88 expect {
89         timeout { exit 1 }
90         "402"
91 }
92
93 # RFC 2812 Section 3.4.10
94
95 send "info\r"
96 expect {
97         timeout { exit 1 }
98         "371"
99 }
100 expect {
101         timeout { exit 1 }
102         "374"
103 }
104
105 # RFC 2812 Section 4.5
106
107 send "summon\r"
108 expect {
109         timeout { exit 1 }
110         "445"
111 }
112
113 # RFC 2812 Section 4.6
114
115 send "users\r"
116 expect {
117         timeout { exit 1 }
118         "446"
119 }
120
121 # RFC 2812 Section 4.8
122
123 send "userhost\r"
124 expect {
125         timeout { exit 1 }
126         "461"
127 }
128
129 send "userhost nick\r"
130 expect {
131         timeout { exit 1 }
132         -re ":ngircd.test.server 302 nick :?nick=+.*@(localhos.*|127.0.0.1)"
133 }
134
135 send "userhost doesnotexist\r"
136 expect {
137         timeout { exit 1 }
138         ":ngircd.test.server 302 nick :\r"
139 }
140
141 send "userhost nick doesnotexist nick doesnotexist\r"
142 expect {
143         timeout { exit 1 }
144         -re ":ngircd.test.server 302 nick :nick=+.*@(localhos.*|127.0.0.1) nick=+.*@(localhos.*|127.0.0.1)"
145 }
146
147 send "away :testing\r"
148 expect {
149         timeout { exit 1 }
150         "306 nick"
151 }
152
153 send "userhost nick nick nick nick nick nick\r"
154 expect {
155         timeout { exit 1 }
156         -re ":ngircd.test.server 302 nick :nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1)\r"
157 }
158
159 send "quit\r"
160 expect {
161         timeout { exit 1 }
162         "ERROR"
163 }
164
165 # -eof-