01.exp 9.64 KB
Newer Older
Per Cederqvist's avatar
Per Cederqvist committed
1
2
# Check return values for a lot of functions.

3
4
5
6
7
8
9
10
11
12
13
14
set f [open "$top_srcdir/versions"]
while {[gets $f line] >= 0} {
    if {[lindex $line 0] == "PROTOCOL-A-LEVEL:"} {
	set protocol_a_level [lindex $line 1]
    } elseif {[lindex $line 0] == "SERVER-SOFTWARE:"} {
	set server_software [lindex $line 1]
    } elseif {[lindex $line 0] == "SERVER-VERSION:"} {
	set server_version [lindex $line 1]
    } elseif {[lindex $line 0] == "SERVER-COMPAT-VERSION:"} {
	set server_compat_version [lindex $line 1]
    }
}
15
16
close $f

Per Cederqvist's avatar
Per Cederqvist committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
lyskomd_start

client_start 0
talk_to client 0
send "A\n"
send "[holl "DejaGnu test suite"]\n"
simple_expect "LysKOM" "connected"

send "1000 62 5 [holl "bogus"] 0\n"
simple_expect "%1000 4 5"

send "1001 62 4 [holl "nono"] 0\n"
simple_expect "%1001 10 4"

send "1002 62 6 [holl "nono"] 0\n"
simple_expect "%1002 10 6"

send "1003 62 60 [holl "nono"] 0\n"
simple_expect "%1003 10 60"

send "1004 62 0 [holl "zero"] 0\n"
simple_expect "%1004 8 0"

# Turn of async messages
send "1005 80 0 { }\n"
simple_expect "=1005"

# Test that most calls fail when the user isn't logged in.

# 0:login-old may succeed
# 1:logout always succeeds
send "1006 1\n"
simple_expect "=1006"
# 2:change-conference
send "1007 2 4\n"
simple_expect "%1007 6 0"
# 3:change-name
send "1008 3 1 [holl "new name"]\n"
simple_expect "%1008 6 0"
# 4:change-what-i-am-doing
send "1009 4 [holl "testing lyskomd"]\n"
simple_expect "=1009"
# 5:create-person-old
send "1010 5 [holl "new person"] [holl "mypasswd"]\n"
simple_expect "=1010 6"
62
63
64
65
send "1011 39\n"
simple_expect "=1011 1 { 6 0 [holl ""] }"
send "1012 1\n"
simple_expect "=1012"
Per Cederqvist's avatar
Per Cederqvist committed
66
# 6:get-person-stat-old
67
send "1013 6 6 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
68
simple_expect "%1013 6 0"
69
70
# 7:set-priv-bits
send "1014 7 6 0000000000000000\n"
Per Cederqvist's avatar
Per Cederqvist committed
71
simple_expect "%1014 6 0"
72
73
74
# 8:set-passwd
send "1015 8 5 [holl "old"] [holl "new"]\n"
simple_expect "%1015 6 0"
Per Cederqvist's avatar
Per Cederqvist committed
75
# 9:query-read-texts-old
76
77
send "1016 9 6 6\n"
simple_expect "=1016 $any_time 6 255 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
78
# 10:create-conf-old
79
send "1017 10 [holl "no way"] 0000\n"
Per Cederqvist's avatar
Per Cederqvist committed
80
simple_expect "%1017 6 0"
81
82
83
# 11:delete-conf
send "1018 11 1\n"
simple_expect "%1018 6 0"
Per Cederqvist's avatar
Per Cederqvist committed
84
# 12:lookup-name
85
86
87
88
send "1019 12 [holl "pres"]\n"
simple_expect "=1019 2 { 1 2 } { 0000 0000 }"
send "1020 12 [holl "xyzzy does not exist"]\n"
simple_expect "=1020 0 \\* \\*"
Per Cederqvist's avatar
Per Cederqvist committed
89
# 13:get-conf-stat-older
90
91
92
93
send "1021 13 1 0\n"
simple_expect "=1021 0H 0000 $any_time $any_time 0 0 0 0 0 0 77 0 1 0"
send "1022 13 1 1\n"
simple_expect "=1022 [holl "Presentation .av nya. mten"] 0000 $any_time $any_time 0 0 0 0 0 0 77 0 1 0"
Per Cederqvist's avatar
Per Cederqvist committed
94
# 14:add-member-old
95
send "1023 14 4 5 255 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
96
simple_expect "%1023 6 0"
97
98
# 15:sub-member
send "1024 15 4 5\n"
Per Cederqvist's avatar
Per Cederqvist committed
99
simple_expect "%1024 6 0"
100
101
# 16:set-presentation
send "1025 16 4 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
102
simple_expect "%1025 6 0"
103
104
# 17:set-etc-motd
send "1026 17 4 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
105
simple_expect "%1026 6 0"
106
107
# 18:set-supervisor
send "1027 18 4 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
108
simple_expect "%1027 6 0"
109
110
# 19:set-permitted-submitters
send "1028 19 4 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
111
simple_expect "%1028 6 0"
112
113
# 20:set-super-conf
send "1029 20 4 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
114
simple_expect "%1029 6 0"
115
116
# 21:set-conf-type
send "1030 21 4 0000\n"
Per Cederqvist's avatar
Per Cederqvist committed
117
simple_expect "%1030 6 0"
118
send "1031 21 4 00000000\n"
Per Cederqvist's avatar
Per Cederqvist committed
119
simple_expect "%1031 6 0"
120
121
# 22:set-garb-nice
send "1032 22 4 17\n"
Per Cederqvist's avatar
Per Cederqvist committed
122
simple_expect "%1032 6 0"
123
124
# 23:get-marks
send "1033 23\n"
Per Cederqvist's avatar
Per Cederqvist committed
125
simple_expect "%1033 6 0"
126
127
128
# 24:mark-text-old
send "1034 24 1 243\n"
simple_expect "%1034 6 0"
Per Cederqvist's avatar
Per Cederqvist committed
129
# 25:get-text
130
send "1035 25 1 0 999\n"
Per Cederqvist's avatar
Per Cederqvist committed
131
simple_expect "%1035 14 1"
132
133
134
# 26:get-text-stat-old
send "1036 26 1\n"
simple_expect "%1036 14 1"
Per Cederqvist's avatar
Per Cederqvist committed
135
# 27:mark-as-read
136
send "1037 27 3 1 { 1 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
137
simple_expect "%1037 6 0"
138
139
# 28:create-text-old
send "1038 28 [holl "A sample text"] 1 { 0 2 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
140
simple_expect "%1038 6 0"
141
142
# 29:delete-text
send "1039 29 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
143
simple_expect "%1039 6 0"
144
145
# 30:add-recipient
send "1040 30 1 4 0\n"
Per Cederqvist's avatar
Per Cederqvist committed
146
simple_expect "%1040 6 0"
147
148
# 31:sub-recipient
send "1041 31 1 4\n"
149
simple_expect "%1041 6 0"
150
151
# 32:add-comment
send "1042 32 2 1\n"
152
simple_expect "%1042 6 0"
153
154
# 33:sub-comment
send "1043 33 2 1\n"
155
simple_expect "%1043 6 0"
156
157
158
# 34:get-map
send "1044 34 1 0 99\n"
simple_expect "%1044 6 0"
159
# 35:get-time
160
161
send "1045 35\n"
simple_expect "=1045 $any_time"
162
# 36:get-info-old
163
164
send "1046 36\n"
simple_expect "=1046 $server_compat_version 1 2 3 4 0"
165
# 37:add-footnote
166
send "1047 37 1 2\n"
167
simple_expect "%1047 6 0"
168
169
170
# 38:sub-footnote
send "1048 38 1 2\n"
simple_expect "%1048 6 0"
171
# 39:who-is-on-old
172
173
send "1049 39\n"
simple_expect "=1049 0 \\*"
174
# 40:set-unread
175
send "1050 40 1 3\n"
176
simple_expect "%1050 6 0"
177
178
# 41:set-motd-of-lyskom
send "1051 41 1\n"
179
simple_expect "%1051 6 0"
180
181
# 42:enable
send "1052 42 255\n"
182
simple_expect "%1052 6 0"
183
184
# 43:sync-kom
send "1053 43\n"
185
simple_expect "%1053 6 0"
186
187
# 44:shutdown-kom
send "1054 44 2\n"
188
simple_expect "%1054 6 0"
189
190
# 45:broadcast
send "1055 45 [holl "broadcast-message"]\n"
191
simple_expect "%1055 6 0"
192
193
# 46:get-membership-old
send "1056 46 5 1 3 1\n"
194
simple_expect "%1056 6 0"
195
196
197
# 47:get-created-texts
send "1057 47 5 1 3\n"
simple_expect "%1057 6 0"
198
# 48:get-members-old
199
send "1058 48 5 0 1\n"
200
simple_expect "=1058 1 { 5 }"
201
send "1059 48 5 0 2\n"
202
simple_expect "=1059 1 { 5 }"
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
send "1060 48 5 0 10\n"
simple_expect "=1060 1 { 5 }"
send "1061 49 5\n"
simple_expect "=1061 [holl "X.unknown.@localhost"] 1111111111111111 00000000 $any_time 0 482 4 0 0 0 0 0 0 1 0 0 1"
# 50:get-conf-stat-old
send "1062 50 1\n"
simple_expect "=1062 [holl "Presentation .av nya. mten"] 0000 $any_time $any_time 0 0 0 0 0 0 77 0 1 0"
# 51:who-is-on
send "1063 51\n"
simple_expect "=1063 0 \\*"
# 52:get-unread-confs
send "1064 52 5\n"
simple_expect "%1064 6 0"
# 53:send-message
send "1065 53 1 [holl "holler"]\n"
simple_expect "%1065 6 0"
# 54:get-session-info
send "1066 54 1\n"
simple_expect "%1066 6 0"
# 55:disconnect
send "1067 55 2\n"
simple_expect "%1067 6 0"
# 56:who-am-i
send "1068 56\n"
simple_expect "=1068 1"
# 57:set-user-area
send "1069 57 5 2\n"
simple_expect "%1069 6 0"
# 58:get-last-text
send "1070 58 0 0 12 1 0 90 0 0 0\n"
simple_expect "=1070 0"
# 59:create-anonymous-text-old
send "1071 59 [holl "anon-txt"] 1 { 0 2 }\n"
simple_expect "%1071 6 0"
# 60:find-next-text-no
send "1072 60 0\n"
simple_expect "%1072 14 0"
send "1073 60 1\n"
simple_expect "%1073 14 1"
send "1074 60 3\n"
simple_expect "%1074 14 3"
# 61:find-previous-text-no
send "1075 61 18\n"
simple_expect "%1075 14 0"
# 62:login
send "1076 62 0 [holl "broken"] 1\n"
simple_expect "%1076 8 0"
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# 63:who-is-on-ident
send "1077 63\n"
simple_expect "=1077 0 \\*"
# 64:get-session-info-ident
send "1078 64 1\n"
simple_expect "%1078 6 0"
# 65:re-lookup-person
send "1079 65 [holl "."]\n"
simple_expect "=1079 2 { 5 6 }"
# 66:re-lookup-conf
send "1080 66 [holl "Pre.*m.*"]\n"
simple_expect "=1080 2 { 1 2 }"
# 67:lookup-person
send "1081 67 [holl "ad"]\n"
simple_expect "=1081 1 { 5 }"
# 68:lookup-conf
send "1082 68 [holl "n o lys"]\n"
simple_expect "=1082 1 { 4 }"
# 69:set-client-version
send "1083 69 [holl "DejaGnu"] [holl "1.3"]\n"
simple_expect "=1083"
# 70:get-client-name
send "1084 70 1\n"
simple_expect "%1084 6 0"
# 71:get-client-version
send "1085 71 1\n"
simple_expect "%1085 6 0"
# 72:mark-text
send "1086 72 1 239\n"
simple_expect "%1086 6 0"
# 73:unmark-text
send "1087 73 1\n"
simple_expect "%1087 6 0"
# 74:re-z-lookup
send "1088 74 [holl "LysKOM"] 1 1\n"
simple_expect "=1088 2 { [holl "Nyheter om LysKOM"] 0000 4 [holl "Administratr .fr. LysKOM"] 1001 5 }"
# 75:get-version-info
send "1089 75\n"
simple_expect "=1089 $protocol_a_level [holl "$server_software"] [holl "$server_version"]"
# 76:lookup-z-name
send "1090 76 [holl "pre m"] 1 1\n"
simple_expect "=1090 2 { [holl "Presentation .av nya. mten"] 0000 1 [holl "Presentation .av nya. medlemmar"] 0000 2 }"
# 77:set-last-read
send "1091 77 3 4\n"
simple_expect "%1091 6 0"
# 78:get-uconf-stat
send "1092 78 3\n"
simple_expect "=1092 [holl "Lappar .p. drren"] 00001000 0 77"
# 79:set-info
send "1093 79 10901 1 2 3 4 1080\n"
simple_expect "%1093 6 0"
# 80:accept-async
send "1094 80 0 { }\n"
simple_expect "=1094"
# 81:query-async
send "1095 81\n"
simple_expect "=1095 0 \\*"
# 82:user-active
send "1096 82\n"
simple_expect "=1096"
# 83:who-is-on-dynamic
send "1097 83 1 1 0\n"
simple_expect "=1097 1 { 1 0 0 $any_num 11000000 [holl ""] }"
# 84:get-static-session-info
send "1098 84 1\n"
simple_expect "%1098 6 0"
# 85:get-collate-table
send "1099 85\n"
unanchored_expect "^MRK:client0: =1099 256H" "collate-table start"
unanchored_expect "0123456789" "collate digits"
unanchored_expect "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "collate upper"
unanchored_expect "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "collate lower"
unanchored_expect "\377$nl" "collate end"
# 86:create-text
send "1100 86 [holl "some text"] 1 { 0 4 } 0 { }\n"
simple_expect "%1100 6 0"
# 87:create-anonymous-text
send "1101 87 [holl "some text"] 1 { 0 4 } 0 { }\n"
simple_expect "%1101 6 0"
# 88:create-conf
send "1102 88 [holl "new conf"] 0000 0 { }\n"
simple_expect "%1102 6 0"
send "1103 88 [holl "new conf"] 00000000 0 { }\n"
simple_expect "%1103 6 0"
334
335

# finally, check that 55=disconnect actually works without logging in.
336
337
send "1104 55 1\n"
simple_expect "=1104"
338
339
340
341
342
343
344
345
client_death 0

client_start 0
talk_to client 0
send "A\n"
send "[holl "DejaGnu test suite"]\n"
simple_expect "LysKOM" "connected"
# Turn of async messages
346
347
send "1105 80 0 { }\n"
simple_expect "=1105"
Per Cederqvist's avatar
Per Cederqvist committed
348
349

# Log in
350
351
send "1106 62 5 [holl "gazonk"] 0\n"
simple_expect "=1106"
Per Cederqvist's avatar
Per Cederqvist committed
352

353
354
send "1107 9 5 5\n"
simple_expect "=1107 $any_time 5 255 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
355

356
357
send "1108 27 5 0 { }\n"
simple_expect "=1108"
Per Cederqvist's avatar
Per Cederqvist committed
358

359
360
send "1109 9 5 5\n"
simple_expect "=1109 $any_time 5 255 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
361

362
363
364
365
send "1110 6 6 1\n"
simple_expect "=1110 [holl "DejaGnu test suite.unknown.@localhost"] 0000010000000000 00000000 $any_time 0 0 1 0 0 0 0 0 0 1 0 0 1"
send "1111 6 6 0\n"
simple_expect "=1111 0H 0000010000000000 00000000 $any_time 0 0 1 0 0 0 0 0 0 1 0 0 1"
Per Cederqvist's avatar
Per Cederqvist committed
366
367
368

talk_to client 0

369
370
371
372
send "1112 42 255\n"
simple_expect "=1112" "42=enable succeeded"
send "1113 44 0\n"
simple_expect "=1113" "44=shutdown-kom succeeded"
Per Cederqvist's avatar
Per Cederqvist committed
373
374
client_death 0
lyskomd_death