03.exp 25.4 KB
Newer Older
1
# Check that all functions do the right thing in their most normal use.
2
3
4
#
# The following objects are created in this test case:
#   Conferences
Per Cederqvist's avatar
Per Cederqvist committed
5
#    7 "(So called) Christian Music", later "PRIMa musik"
Per Cederqvist's avatar
Per Cederqvist committed
6
#    9 "Temporary Sancturay" (immediately deleted)
7
8
9
10
11
12
13
#   Persons
#    6 "Per Cederqvist"
#         Member of 7.
#    8 "Kelly Talisman" (all available aux-infos are set)
#         Member of 7.
#   Texts
#    1 "Old-style text 1"    0 7 6 1
Per Cederqvist's avatar
Per Cederqvist committed
14
15
#    2 "Old-style text 2"    0 7 6 2 (deleted at call 28)
#    3 "Old-style text 3"    0 7 6 3 (; 0 2 6 1 at call 29)
16
17
18
19
20
21
22
23
24
#    4 "New-style text 4"    0 7 6 4; 15 6 6 1
#    5 "New-style text 5"    0 7 6 5; 15 6 6 2
#    6 "New-style text 6"    0 7 6 6; 15 8 6 1
#    7 "New-style text 7"    0 1 6 1; 15 8 6 2
#   Sessions
#    0 logged in as person 6; default asyncs; does not use user_active
#      or set_client_version or any other new and fancy stuff.
#    1 logged in as person 8; all available asyncs; uses user_active;
#      calls set_client_version("dgt03", "sc 1").
Per Cederqvist's avatar
Per Cederqvist committed
25
26
#    2 logged in as person 8 for brief moments.  Logged in invisibly
#      as person 5 from the testing of call 8 and onwards.
Per Cederqvist's avatar
Per Cederqvist committed
27
#      Default asyncs; does not us user_active or set_client_version.
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
62
63
64
65
66
67
68
read_versions

lyskomd_start

# Preamble: create a "typical database" containing some persons and
# texts created with traditional calls, and some created using newer
# calls.

# Client 0 is traditional.  Let it start the race.

client_start 0
talk_to client 0
send "A[holl "ceder@gratia"]\n"
simple_expect "LysKOM" "connected"

send "1000 12 [holl "Per Cederqvist"]\n"
simple_expect "=1000 0 \\* \\*"

# This test was written while listening to Talitha, so it seemd proper
# to use her name as password.
send "1001 5 [holl "Per Cederqvist"] [holl "Talitha"]\n"
simple_expect ":2 9 6 1"
simple_expect "=1001 6"

# Create a conference
send "1002 10 [holl "(So called) Christian Music"] 0000\n"
simple_expect "=1002 7"

send "1003 2 7\n"
simple_expect "%1003 13 7"

send "1004 14 7 6 100 1\n"
simple_expect "=1004"

send "1005 2 7\n"
simple_expect "=1005"

send "1006 28 [holl "Old-style text 1"] 1 { 0 7 }\n"
simple_expect ":16 0 1 $any_time 6 0 16 0 2 { 0 7 6 1 }"
simple_expect "=1006 1"

69
send "1007 28 [holl "Old-style text 2"] 2 { 0 7 6 99 }\n"
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
simple_expect ":16 0 2 $any_time 6 0 16 0 2 { 0 7 6 2 }"
simple_expect "=1007 2"

send "1008 28 [holl "Old-style text 3"] 1 { 0 7 }\n"
simple_expect ":16 0 3 $any_time 6 0 16 0 2 { 0 7 6 3 }"
simple_expect "=1008 3"

# Client 1 is contemporary.  Let it use all the latest fancy stuff.

client_start 1
talk_to client 1
send "A[holl "ic@gratia"]\n"
simple_expect "LysKOM" "client 1 connected"

send "1009 69 [holl "dgt03"] [holl "sc 1"]\n"
simple_expect "=1009"

87
88
89
# This test is written on the assumption that the server knows about
# exactly these aux-items.  It shouldn't be hard to fix the test suite
# when more items are added.
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
send "1010 96\n"
simple_expect "=1010 15 { 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 }"

send "1011 82\n"
simple_expect "=1011"

send "1012 81\n"
simple_expect "=1012 8 { 0 5 7 8 9 11 12 13 }"

send "1013 80 129 { 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 }\n"
simple_expect "%1013 46 0"

send "1014 81\n"
simple_expect "=1014 8 { 0 5 7 8 9 11 12 13 }"

send "1015 80 128 { 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 129 }\n"
simple_expect "%1015 50 1"

send "1016 81\n"
simple_expect "=1016 11 { 0 5 6 7 8 9 11 12 13 14 15 }"

send "1017 80 127 { 0 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 129 }\n"
simple_expect "%1017 50 2"

send "1018 80 126 { 0 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 129 }\n"
simple_expect "%1018 50 3"

send "1019 81\n"
simple_expect "=1019 11 { 0 5 6 7 8 9 11 12 13 14 15 }"

send "1020 80 126 { 0 4 5 6 7 8 9 10 11 12 13 14 15 16 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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 3923 }\n"
simple_expect "%1020 50 4"

send "1021 81\n"
simple_expect "=1021 11 { 0 5 6 7 8 9 11 12 13 14 15 }"

send "1022 80 125 { 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 0 }\n"
simple_expect "%1022 50 128"

send "1023 80 124 { 0 5 6 7 8 9 11 12 13 14 15 16 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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 }\n"
simple_expect "%1023 50 16"

send "1024 81\n"
simple_expect "=1024 11 { 0 5 6 7 8 9 11 12 13 14 15 }"

send "1025 80 12 { 0 5 6 7 8 9 10 11 12 13 14 15 }\n"
simple_expect "%1025 50 10"

138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
send "1026 80 11 { 0 5 6 7 8 9 11 12 13 14 15 }\n"
simple_expect "=1026"

send "1027 81\n"
simple_expect "=1027 11 { 0 5 6 7 8 9 11 12 13 14 15 }"

send "1028 89 [holl "Kelly Talisman"] [holl "the stars"] 7 { 3 00000000 0 [holl "C6 My Creator"] 3 00000000 0 [holl "C7 Slightly offensive name, huh"] 8 00000000 0 [holl "E-mail:kelly@hotbox.com"] 9 00000000 0 [holl "compface must die"] 10 00000000 0 [holl "Air"] 12 00000000 0 [holl "PGP public key"] 13 00000000 0 [holl "kelly@hotbox.com"] }\n"
simple_expect ":2 9 8 2"
simple_expect "=1028 8"
talk_to client 0
simple_expect ":2 9 8 2"
talk_to client 1

send "1029 86 [holl "New-style text 4"] 2 { 0 7 15 6 } 0 { }\n"
# No async message; person 8 isn't a member of the conferences this
# text goes to.
simple_expect "=1029 4"

talk_to client 0
simple_expect ":16 0 4 $any_time 8 0 16 0 4 { 0 7 6 4 1 6 6 1 }"
talk_to client 1

# Join conference 7.
send "1030 100 7 8 100 0 00000000\n"
simple_expect "=1030"

send "1031 86 [holl "New-style text 5"] 2 { 0 7 15 6 } 0 { }\n"
simple_expect ":16 0 5 $any_time 8 0 16 0 2 { 0 7 6 5 }"
simple_expect ":18 15 5 $any_time 8 0 16 0 2 { 0 7 6 5 } 0 \\*"
simple_expect "=1031 5"
168

169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
talk_to client 0
simple_expect ":16 0 5 $any_time 8 0 16 0 4 { 0 7 6 5 1 6 6 2 }"
talk_to client 1

send "1032 86 [holl "New-style text 6"] 2 { 0 7 15 8 } 0 { }\n"
simple_expect ":16 0 6 $any_time 8 0 16 0 4 { 0 7 6 6 1 8 6 1 }"
simple_expect ":18 15 6 $any_time 8 0 16 0 4 { 0 7 6 6 15 8 6 1 } 0 \\*"
simple_expect "=1032 6"

talk_to client 0
simple_expect ":16 0 6 $any_time 8 0 16 0 2 { 0 7 6 6 }"
talk_to client 1

send "1033 86 [holl "New-style text 7"] 2 { 0 1 15 8 } 0 { }\n"
simple_expect ":16 0 7 $any_time 8 0 16 0 4 { 0 1 6 1 1 8 6 2 }"
simple_expect ":18 15 7 $any_time 8 0 16 0 4 { 0 1 6 1 15 8 6 2 } 0 \\*"
simple_expect "=1033 7"

talk_to client 0
# No async for client 0 at this point.
send "1034 35\n"
simple_expect "=1034 $any_time"
talk_to client 1
192

Per Cederqvist's avatar
Per Cederqvist committed
193
194
195
196
197
198
199
200
201
202
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# test call 0 (login)
client_start 2
talk_to client 2
send "A[holl "Foo"]\n"
simple_expect "LysKOM" "client 2 connected"
send "1035 0 3 [holl "gazonk"]\n"
simple_expect "%1035 10 3"
send "1036 0 8 [holl "gazonk"]\n"
simple_expect "%1036 4 8"
talk_to client 0
send "1037 35\n"
simple_expect "=1037 $any_time"
talk_to client 1
send "1038 35\n"
simple_expect "=1038 $any_time"
talk_to client 2
send "1039 0 8 [holl "the stars"]\n"
simple_expect ":2 9 8 3"
simple_expect "=1039"
talk_to client 0
simple_expect ":2 9 8 3"
talk_to client 1
simple_expect ":2 9 8 3"

# test call 1 (logout)
talk_to client 2
send "1040 1\n"
simple_expect ":2 13 8 3"
simple_expect "=1040"
talk_to client 0
simple_expect ":2 13 8 3"
talk_to client 1
simple_expect ":2 13 8 3"

# test call 2 (change-conference)
talk_to client 0
send "1041 2 2\n"
simple_expect "%1041 13 2"
send "1042 2 34\n"
simple_expect "%1042 9 34"
# This session has already changed conference to 7 in the preamble above.
# Check that the failed attempts didn't change that.
send "1043 83 1 0 0\n"
simple_expect "=1043 2 { 2 8 0 $any_num 01000000 0H 1 6 7 $any_num 00000000 0H }"
# Check that we can leave all conferences.
send "1044 2 0\n"
simple_expect "=1044"
talk_to client 1
simple_expect ":5 6 6 0 1 [holl ""] [holl "ceder@gratia@localhost"]"
talk_to client 0
send "1045 83 1 0 0\n"
simple_expect "=1045 2 { 2 8 0 $any_num 01000000 0H 1 6 0 $any_num 00000000 0H }"
# Go to the letterbox and stay there
send "1046 2 6\n"
simple_expect "=1046"
talk_to client 1
simple_expect ":5 6 6 6 1 [holl ""] [holl "ceder@gratia@localhost"]"
talk_to client 0
send "1047 83 1 0 0\n"
simple_expect "=1047 2 { 2 8 0 $any_num 01000000 0H 1 6 6 $any_num 00000000 0H }"

# test call 3 (change-name)
talk_to client 0
send "1048 3 7 [holl "Per Cederqvist"]\n"
simple_expect "%1048 20 0"
send "1049 3 7 [holl "PRIMa musik"]\n"
simple_expect ":3 5 7 [holl ".So called. Christian Music"] [holl "PRIMa musik"]"
simple_expect "=1049"

talk_to client 1
simple_expect ":3 5 7 [holl ".So called. Christian Music"] [holl "PRIMa musik"]"
talk_to client 2
simple_expect ":3 5 7 [holl ".So called. Christian Music"] [holl "PRIMa musik"]"

Per Cederqvist's avatar
Per Cederqvist committed
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
# test call 4 (change-what-i-am-doing)
talk_to client 0
send "1050 4 [holl "Running a test suite"]\n"
simple_expect "=1050"
talk_to client 1
simple_expect ":5 6 6 6 1 [holl "Running a test suite"] [holl "ceder@gratia@localhost"]"
send "1051 4 [holl "Accepting i-am-on"]\n"
simple_expect ":5 6 8 0 2 [holl "Accepting i-am-on"] [holl "ic@gratia@localhost"]"
simple_expect "=1051"

# call 5 (create-person-old) is tested above.
# test call 6 (get-person-stat-old)
send "1052 6 0 0\n"
simple_expect "%1052 8 0"
send "1053 6 3 0\n"
simple_expect "%1053 10 3"
send "1054 6 10 0\n"
simple_expect "%1054 10 10"
send "1055 6 6 0\n"
simple_expect "=1055 [holl ""] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
send "1056 6 6 1\n"
simple_expect "=1056 [holl "ceder@gratia.unknown.@localhost"] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
send "1057 6 6 2\n"
simple_expect "=1057 [holl ""] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
send "1058 6 6 3\n"
simple_expect "=1058 [holl "ceder@gratia.unknown.@localhost"] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
send "1059 6 6 32770\n"
simple_expect "=1059 [holl ""] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
send "1060 6 6 32771\n"
simple_expect "=1060 [holl "ceder@gratia.unknown.@localhost"] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"

# test call 7 (set-priv-bits)
send "1061 7 8 0000000000000000\n"
simple_expect "%1061 12 0"
talk_to client 2
send "1062 62 5 [holl "gazonk"] 1\n"
simple_expect "=1062"
send "1063 7 8 0000000000000000\n"
simple_expect "%1063 12 0"
send "1064 42 255\n"
simple_expect "=1064"
send "1065 6 8 0\n"
Per Cederqvist's avatar
Per Cederqvist committed
309
simple_expect "=1065 [holl ""] 0000010000000000 00000000 $any_time 0 $any_num 2 0 64 0 0 0 0 1 4 0 2"
Per Cederqvist's avatar
Per Cederqvist committed
310
311
312
send "1066 7 8 0000000000000000\n"
simple_expect "=1066"
send "1067 6 8 0\n"
Per Cederqvist's avatar
Per Cederqvist committed
313
simple_expect "=1067 [holl ""] 0000000000000000 00000000 $any_time 0 $any_num 2 0 64 0 0 0 0 1 4 0 2"
Per Cederqvist's avatar
Per Cederqvist committed
314
315
316
send "1068 7 8 1111111111111111\n"
simple_expect "=1068"
send "1069 6 8 0\n"
Per Cederqvist's avatar
Per Cederqvist committed
317
simple_expect "=1069 [holl ""] 1111111111111111 00000000 $any_time 0 $any_num 2 0 64 0 0 0 0 1 4 0 2"
Per Cederqvist's avatar
Per Cederqvist committed
318
319
320
send "1070 7 8 0000010000000000\n"
simple_expect "=1070"
send "1071 6 8 0\n"
Per Cederqvist's avatar
Per Cederqvist committed
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
simple_expect "=1071 [holl ""] 0000010000000000 00000000 $any_time 0 $any_num 2 0 64 0 0 0 0 1 4 0 2"

# test call 8 (set-passwd)
send "1072 8 5 [holl "foo"] [holl "bar"]\n"
simple_expect "%1072 4 5"
send "1073 8 5 [holl "gazonk"] [holl "bar"]\n"
simple_expect "=1073"
send "1074 1\n"
simple_expect "=1074"
send "1075 62 5 [holl "gazonk"] 1\n"
simple_expect "%1075 4 5"
send "1076 62 5 [holl "bar"] 1\n"
simple_expect "=1076"

# test call 9 (query-read-texts-old)
talk_to client 0
send "1077 9 6 7\n"
simple_expect "=1077 $any_time 7 100 0 0 \\*"

# test call 10 (create-conf-old)
send "1078 78 9\n"
simple_expect "%1078 9 9"
send "1079 10 [holl "Temporary Sanctuary"] 1010\n"
simple_expect "=1079 9"
send "1080 78 9\n"
simple_expect "=1080 [holl "Temporary Sanctuary"] 10100000 0 77"

# test call 11 (delete-conf)
send "1081 11 9\n"
simple_expect "=1081"
send "1082 78 9\n"
simple_expect "%1082 9 9"

# test call 12 (lookup-name)
send "1083 12 [holl "p"]\n"
simple_expect "=1083 4 { 1 2 6 7 } { 0000 0000 1001 0000 }"
send "1084 12 [holl "p c"]\n"
simple_expect "=1084 1 { 6 } { 1001 }"
send "1085 12 [holl "xyzzy"]\n"
simple_expect "=1085 0 \\* \\*"

# test call 13 (get-conf-stat-older)
send "1086 13 3 0\n"
simple_expect "=1086 [holl ""] 0000 $any_time $any_time 0 0 0 0 0 0 77 0 1 0"
send "1087 13 3 1\n"
simple_expect "=1087 [holl "Lappar .p. drren"] 0000 $any_time $any_time 0 0 0 0 0 0 77 0 1 0"

# test call 14 (add-member-old)
send "1088 14 3 6 90 2\n"
simple_expect "=1088"
send "1089 13 3 1\n"
simple_expect "=1089 [holl "Lappar .p. drren"] 0000 $any_time $any_time 0 0 0 0 0 0 77 1 1 0"

# test call 15 (sub-member)
send "1090 15 3 6\n"
simple_expect ":1 8 3"
simple_expect "=1090"
send "1091 15 3 6\n"
simple_expect "%1091 13 3"

# test call 16 (set-presentation)
send "1092 16 7 3\n"
simple_expect "=1092"
# We check the result under call 50 below.

# test call 17 (set-etc-motd)
send "1093 17 7 2\n"
simple_expect "=1093"
# We check the result under call 50 below.

# test call 18 (set-supervisor)
send "1094 18 7 7\n"
simple_expect "=1094"
# We check the result under call 50 below.

# test call 19 (set-permitted-submitters)
send "1095 19 7 8\n"
simple_expect "=1095"
# We check the result under call 50 below.

# test call 20 (set-super-conf)
send "1096 20 7 4\n"
simple_expect "=1096"
# We check the result under call 50 below.

# test call 21 (set-conf-type)
send "1097 21 7 0100\n"
simple_expect "=1097"
send "1098 21 7 01001000\n"
simple_expect "=1098"
# We check the result under call 50 below.

# test call 22 (set-garb-nice)
send "1099 22 7 144\n"
simple_expect "=1099"
# We check the result under call 50 below.

# test call 23 (get-marks) and call 24 (mark-text-old)
send "1100 24 2 15\n"
simple_expect "=1100"
send "1101 23\n"
simple_expect "=1101 1 { 2 15 }"
send "1102 24 2 28\n"
simple_expect "=1102"
send "1103 23\n"
simple_expect "=1103 1 { 2 28 }"
send "1104 24 3 9\n"
simple_expect "=1104"
send "1105 23\n"
simple_expect "=1105 2 { 2 28 3 9 }"
send "1106 24 2 0\n"
simple_expect "=1106"
send "1107 23\n"
simple_expect "=1107 1 { 3 9 }"
send "1108 24 3 0\n"
simple_expect "=1108"
send "1109 23\n"
simple_expect "=1109 0 \\*"

# call 25 is tested extensively in 02.exp

# test call 26 (get-text-stat-old)
send "1110 26 1\n"
simple_expect "=1110 $any_time 6 0 16 0 2 { 0 7 6 1 }"

Per Cederqvist's avatar
Per Cederqvist committed
446
# test call 27 (mark-as-read) and 40 (set-unread)
Per Cederqvist's avatar
Per Cederqvist committed
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
send "1111 9 6 7\n"
simple_expect "=1111 $any_time 7 100 0 0 \\*"

send "1112 27 7 1 { 2 }\n"
simple_expect "=1112"
send "1113 9 6 7\n"
simple_expect "=1113 $any_time 7 100 0 1 { 2 }"

send "1114 27 7 1 { 2 }\n"
simple_expect "=1114"
send "1115 46 6 1 1 1\n"
simple_expect "=1115 1 { $any_time 7 100 0 1 { 2 } }"

send "1116 27 7 1 { 4 }\n"
simple_expect "=1116"
send "1117 9 6 7\n"
simple_expect "=1117 $any_time 7 100 0 2 { 2 4 }"

send "1118 27 7 1 { 5 }\n"
simple_expect "=1118"
send "1119 9 6 7\n"
simple_expect "=1119 $any_time 7 100 0 3 { 2 4 5 }"

send "1120 27 7 1 { 6 }\n"
simple_expect "=1120"
send "1121 9 6 7\n"
simple_expect "=1121 $any_time 7 100 0 4 { 2 4 5 6 }"

send "1122 27 7 1 { 1 }\n"
simple_expect "=1122"
send "1123 9 6 7\n"
simple_expect "=1123 $any_time 7 100 2 3 { 4 5 6 }"

send "1124 27 7 1 { 7 }\n"
simple_expect "%1124 16 0"
send "1125 9 6 7\n"
simple_expect "=1125 $any_time 7 100 2 3 { 4 5 6 }"

send "1126 27 7 1 { 3 }\n"
simple_expect "=1126"
send "1127 9 6 7\n"
simple_expect "=1127 $any_time 7 100 6 0 \\*"

Per Cederqvist's avatar
Per Cederqvist committed
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
send "1128 40 7 6\n"
simple_expect "=1128"
send "1129 9 6 7\n"
simple_expect "=1129 $any_time 7 100 0 0 \\*"

send "1130 27 7 6 { 1 2 3 4 5 6 }\n"
simple_expect "=1130"
send "1131 9 6 7\n"
simple_expect "=1131 $any_time 7 100 6 0 \\*"

send "1132 40 7 6\n"
simple_expect "=1132"
send "1133 9 6 7\n"
simple_expect "=1133 $any_time 7 100 0 0 \\*"

send "1134 27 7 6 { 6 5 4 3 2 1 }\n"
simple_expect "=1134"
send "1135 9 6 7\n"
simple_expect "=1135 $any_time 7 100 6 0 \\*"

send "1136 40 7 6\n"
simple_expect "=1136"
send "1137 9 6 7\n"
simple_expect "=1137 $any_time 7 100 0 0 \\*"

send "1138 27 7 6 { 1 3 5 2 4 6 }\n"
simple_expect "=1138"
send "1139 9 6 7\n"
simple_expect "=1139 $any_time 7 100 6 0 \\*"

send "1140 40 7 6\n"
simple_expect "=1140"
send "1141 9 6 7\n"
simple_expect "=1141 $any_time 7 100 0 0 \\*"

send "1142 27 7 6 { 2 4 6 1 3 5 }\n"
simple_expect "=1142"
send "1143 9 6 7\n"
simple_expect "=1143 $any_time 7 100 6 0 \\*"

send "1144 40 7 6\n"
simple_expect "=1144"
send "1145 9 6 7\n"
simple_expect "=1145 $any_time 7 100 0 0 \\*"

send "1146 27 7 1 { 1 }\n"
simple_expect "=1146"
send "1147 9 6 7\n"
simple_expect "=1147 $any_time 7 100 1 0 \\*"

send "1148 27 7 1 { 1 }\n"
simple_expect "=1148"
send "1149 9 6 7\n"
simple_expect "=1149 $any_time 7 100 1 0 \\*"

send "1150 27 7 1 { 2 }\n"
simple_expect "=1150"
send "1151 9 6 7\n"
simple_expect "=1151 $any_time 7 100 2 0 \\*"

send "1152 27 7 1 { 3 }\n"
simple_expect "=1152"
send "1153 9 6 7\n"
simple_expect "=1153 $any_time 7 100 3 0 \\*"

send "1154 27 7 1 { 4 }\n"
simple_expect "=1154"
send "1155 9 6 7\n"
simple_expect "=1155 $any_time 7 100 4 0 \\*"

send "1156 27 7 1 { 5 }\n"
simple_expect "=1156"
send "1157 9 6 7\n"
simple_expect "=1157 $any_time 7 100 5 0 \\*"

send "1158 27 7 1 { 6 }\n"
simple_expect "=1158"
send "1159 9 6 7\n"
simple_expect "=1159 $any_time 7 100 6 0 \\*"

send "1160 40 7 5\n"
simple_expect "=1160"
send "1161 9 6 7\n"
simple_expect "=1161 $any_time 7 100 1 0 \\*"

send "1162 40 7 2\n"
simple_expect "=1162"
send "1163 9 6 7\n"
simple_expect "=1163 $any_time 7 100 4 0 \\*"

send "1164 40 7 1\n"
simple_expect "=1164"
send "1165 9 6 7\n"
simple_expect "=1165 $any_time 7 100 5 0 \\*"

send "1166 40 7 0\n"
simple_expect "=1166"
send "1167 9 6 7\n"
simple_expect "=1167 $any_time 7 100 6 0 \\*"

# call 28 is tested above

# test call 29 (delete-text)
Per Cederqvist's avatar
Per Cederqvist committed
593
594
595
596
597
send "1168 98 6 7\n"
simple_expect "=1168 .*"
send "1169 29 2\n"
# No new'n'fancy async message here.
simple_expect "=1169"
Per Cederqvist's avatar
Per Cederqvist committed
598
599

talk_to client 1
Per Cederqvist's avatar
Per Cederqvist committed
600
# The text is marked since it is motd of conference 7.
Per Cederqvist's avatar
Per Cederqvist committed
601
602
603
simple_expect ":18 14 2 $any_time 6 0 16 1 2 { 0 7 6 2 } 0 \\*"
talk_to client 0

Per Cederqvist's avatar
Per Cederqvist committed
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
send "1170 40 7 6\n"
simple_expect "=1170"
send "1171 9 6 7\n"
simple_expect "=1171 $any_time 7 100 0 0 \\*"

send "1172 27 7 1 { 1 }\n"
simple_expect "=1172"
send "1173 9 6 7\n"
simple_expect "=1173 $any_time 7 100 2 0 \\*"

# test call 30 (add-recipient)
send "1174 30 3 2 0\n"
simple_expect "=1174"
send "1175 26 3\n"
# This is marked since text 3 is presentation of conf 7.
simple_expect "=1175 $any_time 6 0 16 1 5 { 0 7 6 3 0 2 6 1 9 $any_time }"

# test call 31 (sub-recipient)
send "1176 31 3 2\n"
simple_expect "=1176"
send "1177 26 3\n"
# This is marked since text 3 is presentation of conf 7.
simple_expect "=1177 $any_time 6 0 16 1 2 { 0 7 6 3 }"

# test call 32 (add-comment)
send "1178 32 3 1\n"
simple_expect "=1178"
send "1179 26 3\n"
# This is marked since text 3 is presentation of conf 7.
simple_expect "=1179 $any_time 6 0 16 1 4 { 0 7 6 3 2 1 9 $any_time }"
send "1180 26 1\n"
simple_expect "=1180 $any_time 6 0 16 0 3 { 0 7 6 1 3 3 }"

# test call 33 (sub-comment)
send "1181 33 3 1\n"
simple_expect "=1181"
send "1182 26 3\n"
# This is marked since text 3 is presentation of conf 7.
simple_expect "=1182 $any_time 6 0 16 1 2 { 0 7 6 3 }"
send "1183 26 1\n"
simple_expect "=1183 $any_time 6 0 16 0 2 { 0 7 6 1 }"

# test call 34 (get-map)
send "1184 34 7 1 50\n"
simple_expect "=1184 1 6 { 1 0 3 4 5 6 }"

# test call 35 (get-time)
send "1185 35\n"
simple_expect "=1185 $any_time"

# test call 36 (get-info-old)
send "1186 36\n"
simple_expect "=1186 $server_compat_version 1 2 3 4 0"

# test call 37 (add-footnote)
send "1187 37 3 1\n"
simple_expect "=1187"
send "1188 26 3\n"
# This is marked since text 3 is presentation of conf 7.
simple_expect "=1188 $any_time 6 0 16 1 4 { 0 7 6 3 4 1 9 $any_time }"
send "1189 26 1\n"
simple_expect "=1189 $any_time 6 0 16 0 3 { 0 7 6 1 5 3 }"

# test call 38 (sub-footnote)
send "1190 38 3 1\n"
simple_expect "=1190"
send "1191 26 3\n"
# This is marked since text 3 is presentation of conf 7.
simple_expect "=1191 $any_time 6 0 16 1 2 { 0 7 6 3 }"
send "1192 26 1\n"
simple_expect "=1192 $any_time 6 0 16 0 2 { 0 7 6 1 }"

# test call 39 (who-is-on-old)
send "1193 39\n"
simple_expect "=1193 2 { 8 0 [holl "Accepting i-am-on"] 6 6 [holl "Running a test suite"] }"

# call 40 (set-unread) is tested above

# test call 41 (set-motd-of-lyskom)
talk_to client 2
send "1194 42 255\n"
simple_expect "=1194"
send "1195 41 7\n"
simple_expect "=1195"
send "1196 42 0\n"
simple_expect "=1196"

send "1197 36\n"
simple_expect "=1197 $server_compat_version 1 2 3 4 7"

# call 42 (enable) is tested above

# test call 43 (sync-kom)
send "1198 43\n"
simple_expect "%1198 12 0"
send "1199 42 255\n"
simple_expect "=1199"
send "1200 43\n"
simple_expect ":0 7"
simple_expect ":0 7"
simple_expect "=1200"
talk_to client 0
simple_expect ":0 7"
simple_expect ":0 7"
talk_to client 1
simple_expect ":0 7"
simple_expect ":0 7"
talk_to client 2
send "1201 42 0\n"
simple_expect "=1201"

# test call 44 (shutdown-kom) is tested below

# test call 45 (broadcast)
send "1202 45 [holl "a broadcast message"]\n"
simple_expect ":3 12 0 5 [holl "a broadcast message"]"
simple_expect "=1202"
talk_to client 1
simple_expect ":3 12 0 5 [holl "a broadcast message"]"
talk_to client 0
simple_expect ":3 12 0 5 [holl "a broadcast message"]"

726
727
728
729
# FIXME: test call 46
# FIXME: test call 47
# FIXME: test call 48
# FIXME: test call 49
Per Cederqvist's avatar
Per Cederqvist committed
730
# test call 50 (get-conf-stat-old)
Per Cederqvist's avatar
Per Cederqvist committed
731
732
send "1203 50 7\n"
simple_expect "=1203 [holl "PRIMa musik"] 0100 $any_time $any_time 6 3 7 8 4 2 144 2 1 6"
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
# FIXME: test call 51
# FIXME: test call 52
# FIXME: test call 53
# FIXME: test call 54
# FIXME: test call 55
# FIXME: test call 56
# FIXME: test call 57
# FIXME: test call 58
# FIXME: test call 59
# FIXME: test call 60
# FIXME: test call 61
# FIXME: test call 62
# FIXME: test call 63
# FIXME: test call 64
# FIXME: test call 65
# FIXME: test call 66
# FIXME: test call 67
# FIXME: test call 68
# FIXME: test call 69
# FIXME: test call 70
# FIXME: test call 71
# FIXME: test call 72
# FIXME: test call 73
# FIXME: test call 74
# FIXME: test call 75
# FIXME: test call 76
# FIXME: test call 77
Per Cederqvist's avatar
Per Cederqvist committed
760
# test call 78 (get-uconf-stat)
Per Cederqvist's avatar
Per Cederqvist committed
761
762
send "1204 78 7\n"
simple_expect "=1204 [holl "PRIMa musik"] 01001000 6 144"
Per Cederqvist's avatar
Per Cederqvist committed
763

764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
# FIXME: test call 79
# call 80 is tested during startup of client 1.
# call 81 is tested during startup of client 1.
# FIXME: test call 82
# FIXME: test call 83
# FIXME: test call 84
# FIXME: test call 85
# FIXME: test call 86
# FIXME: test call 87
# FIXME: test call 88
# FIXME: test call 89
# FIXME: test call 90
# FIXME: test call 91
# FIXME: test call 92
# FIXME: test call 93
# FIXME: test call 94
# FIXME: test call 95
# FIXME: test call 96
# FIXME: test call 97
# FIXME: test call 98
# FIXME: test call 99
# FIXME: test call 100
# FIXME: test call 101
# FIXME: test call 102
# FIXME: test call 103
# FIXME: test call 104

# There is no call 105--yet.
Per Cederqvist's avatar
Per Cederqvist committed
792
793
send "1205 105\n"
simple_expect "%1205 2 0"
794
795

# There is no call 106--yet.
Per Cederqvist's avatar
Per Cederqvist committed
796
797
send "1206 106\n"
simple_expect "%1206 2 0"
798
799

# There is no call 107--yet.
Per Cederqvist's avatar
Per Cederqvist committed
800
801
send "1207 107\n"
simple_expect "%1207 2 0"
802
803

# There is no call 108--yet.
Per Cederqvist's avatar
Per Cederqvist committed
804
805
send "1208 108\n"
simple_expect "%1208 2 0"
806
807

# There is no call 109--yet.
Per Cederqvist's avatar
Per Cederqvist committed
808
809
send "1209 109\n"
simple_expect "%1209 2 0"
810
811

# There is no call 110--yet.
Per Cederqvist's avatar
Per Cederqvist committed
812
813
send "1210 110\n"
simple_expect "%1210 2 0"
814

815
talk_to client 1
Per Cederqvist's avatar
Per Cederqvist committed
816
817
send "1211 55 2\n"
simple_expect "=1211"
818
819
simple_expect ":2 13 8 2"
client_death 1
820
821
822

# Shut everything down
talk_to client 0
823
simple_expect ":2 13 8 2"
824

Per Cederqvist's avatar
Per Cederqvist committed
825
send "1212 62 5 [holl "bar"] 0\n"
826
827
simple_expect ":2 13 6 1"
simple_expect ":2 9 5 1"
Per Cederqvist's avatar
Per Cederqvist committed
828
simple_expect "=1212"
829

Per Cederqvist's avatar
Per Cederqvist committed
830
831
832
833
send "1213 42 255\n"
simple_expect "=1213" "42=enable succeeded"
send "1214 44 0\n"
simple_expect "=1214" "44=shutdown-kom succeeded"
834
835
simple_expect ":2 13 5 1"
client_death 0
Per Cederqvist's avatar
Per Cederqvist committed
836
837
838
839
# FIXME: There are enqueued logout/disconnect messages to this client.
# Don't fix that now; we probably will disconnect this client before
# this time anyhow.
client_death 2
840
lyskomd_death