bug-37-3.exp 30.1 KB
Newer Older
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
# Test suite for lyskomd.
# Copyright (C) 2002  Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
# 
# LysKOM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by 
# the Free Software Foundation; either version 1, or (at your option) 
# any later version.
# 
# LysKOM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
# 
# You should have received a copy of the GNU General Public License
# along with LysKOM; see the file COPYING.  If not, write to
# Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
# or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
# MA 02139, USA.
#
# Please mail bug reports to bug-lyskom@lysator.liu.se. 

# Test bug 37: get_unread_confs does not check that the caller is
# allowed to see the person, and returns the correct result even for
# secret persons, including secret confs!
#
# Variant three: the observer is supervisor of all conferences.
#
30
31
# We also check get-membership, get-membership-10, get-membership-old,
# query-read-texts, query-read-texts-10, and query-read-texts-old.
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
#
# While we are at it, we also test the unread-is-secret personal flag.

#
# Startup and create the players
#

# Start the server.
lyskomd_start

# Create and log in as foo (person 6).
client_start 0
send "A3Hfoo\n"
simple_expect "LysKOM"
send "1000 80 0 { }\n"
simple_expect "=1000"
send "1001 89 [holl "foo"] [holl "p6"] 00000000 0 { }\n"
simple_expect "=1001 6"
send "1002 62 6 [holl "p6"] 0\n"
simple_expect "=1002"

# Create and log in as bar (person 7; secret).
client_start 1
send "A3Hbar\n"
simple_expect "LysKOM"
send "1003 80 0 { }\n"
simple_expect "=1003"
send "1004 89 [holl "bar"] [holl "p7"] 00000000 0 { }\n"
simple_expect "=1004 7"
send "1005 62 7 [holl "p7"] 0\n"
simple_expect "=1005"
send "1006 21 7 10111000\n"
simple_expect "=1006"

# Create and log in as citrus (person 8; has unread-is-secret set).
client_start 2
send "A6Hcitrus\n"
simple_expect "LysKOM"
send "1007 80 0 { }\n"
simple_expect "=1007"
send "1008 89 [holl "citrus"] [holl "p8"] 10000000 0 { }\n"
simple_expect "=1008 8"
send "1009 62 8 [holl "p8"] 0\n"
simple_expect "=1009"

# Create and log in as gazonk (person 9).  This is the observer.
client_start 3
send "A6Hgazonk\n"
simple_expect "LysKOM"
send "1010 80 0 { }\n"
simple_expect "=1010"
send "1011 89 [holl "gazonk"] [holl "p9"] 00000000 0 { }\n"
simple_expect "=1011 9"
send "1012 62 9 [holl "p9"] 0\n"
simple_expect "=1012"

#
# Create conferences.
#

# As gazonk, create secret (conf 10; secret).
talk_to client 3
send "1013 88 [holl "secret"] 10101000 0 { }\n"
simple_expect "=1013 10"

# As gazonk, create rd-prot (conf 11; rd-prot).
send "1014 88 [holl "rd-prot"] 10001000 0 { }\n"
simple_expect "=1014 11"

# As gazonk, create public (conf 12).
send "1015 88 [holl "public"] 00001000 0 { }\n"
simple_expect "=1015 12"

#
# Join conferences
#

# gazonk invites bar to secret, rd-prot and public.
send "1016 100 10 7 200 1 00000000\n"
111
lyskomd_expect "Person 7 added to conference 10 by 9."
112
113
simple_expect "=1016"
send "1017 100 11 7 200 2 00000000\n"
114
lyskomd_expect "Person 7 added to conference 11 by 9."
115
116
simple_expect "=1017"
send "1018 100 12 7 200 3 00000000\n"
117
lyskomd_expect "Person 7 added to conference 12 by 9."
118
119
simple_expect "=1018"
# bar is secret, so gazonk should not be able to do the above.
120
121
# When bug 604 is fixed, this test should be rewritten so that
# bar is temporarily made public while being invited.
122
123
124
125
126
setup_xfail "*-*-*" "Bug 604"
fail "bar could add a secret person to a conference"

# gazonk invites foo to secret, rd-prot and public.
send "1019 100 10 6 200 1 00000000\n"
127
lyskomd_expect "Person 6 added to conference 10 by 9."
128
129
simple_expect "=1019"
send "1020 100 11 6 200 2 00000000\n"
130
lyskomd_expect "Person 6 added to conference 11 by 9."
131
132
simple_expect "=1020"
send "1021 100 12 6 200 3 00000000\n"
133
lyskomd_expect "Person 6 added to conference 12 by 9."
134
135
136
137
simple_expect "=1021"

# gazonk invites citrus to secret, rd-prot and public.
send "1022 100 10 8 200 1 00000000\n"
138
lyskomd_expect "Person 8 added to conference 10 by 9."
139
140
simple_expect "=1022"
send "1023 100 11 8 200 2 00000000\n"
141
lyskomd_expect "Person 8 added to conference 11 by 9."
142
143
simple_expect "=1023"
send "1024 100 12 8 200 3 00000000\n"
144
lyskomd_expect "Person 8 added to conference 12 by 9."
145
146
147
148
149
150
151
152
153
154
155
156
simple_expect "=1024"

#
# foo examines foo.
#

talk_to client 0

# foo does get-unread-confs of foo.  Should return the empty list.
send "1025 52 6\n"
simple_expect "=1025 0 \\*"

157
# foo does get-membership-10 of foo.  Should return 4 { 6 10 11 12 }.
158
159
160
161
162
163
164
send "1026 99 6 0 100 1\n"
simple_expect "=1026 4 { 0 $any_time 6 255 0 0 \\* 6 $any_time 00000000 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000 }"

# foo does get-membership-old of foo.  Should return 4 { 6 10 11 12 }.
send "1027 46 6 0 100 1\n"
simple_expect "=1027 4 { $any_time 6 255 0 0 \\* $any_time 10 200 0 0 \\* $any_time 11 200 0 0 \\* $any_time 12 200 0 0 \\* }"

165
166
167
168
169
# foo does get-membership of foo.  Should return 4 { 6 10 11 12 }.
send "1026 108 6 0 100 1 0\n"
simple_expect "=1026 4 { 0 $any_time 6 255 0 \\* 6 $any_time 00000000 1 $any_time 10 200 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 \\* 9 $any_time 10000000 }"

# foo does query-read-texts-10 on foo and 10, 11 and 12.  Should get results.
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
send "1028 98 6 10\n"
simple_expect "=1028 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000"
send "1029 98 6 11\n"
simple_expect "=1029 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000"
send "1030 98 6 12\n"
simple_expect "=1030 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000"

# foo does query-read-texts-old on foo and 10, 11 and 12.  Should get results.
send "1031 9 6 10\n"
simple_expect "=1031 $any_time 10 200 0 0 \\*"
send "1032 9 6 11\n"
simple_expect "=1032 $any_time 11 200 0 0 \\*"
send "1033 9 6 12\n"
simple_expect "=1033 $any_time 12 200 0 0 \\*"

185
186
187
188
189
190
191
# foo does query-read-texts on foo and 10, 11 and 12.  Should get results.
send "1028 107 6 10 1 0\n"
simple_expect "=1028 1 $any_time 10 200 0 \\* 9 $any_time 10000000"
send "1029 107 6 11 1 0\n"
simple_expect "=1029 2 $any_time 11 200 0 \\* 9 $any_time 10000000"
send "1030 107 6 12 1 0\n"
simple_expect "=1030 3 $any_time 12 200 0 \\* 9 $any_time 10000000"
192
193
194
195
196
197
198
199
200
201
202

#
# gazonk examines foo.
#

talk_to client 3

# gazonk does get-unread-confs of foo.  Should return the empty list.
send "1034 52 6\n"
simple_expect "=1034 0 \\*"

203
# gazonk does get-membership-10 of foo.  Should return 4 { 6 10 11 12 }.
204
205
206
207
send "1035 99 6 0 100 1\n"
simple_expect "=1035 4 { 0 $any_time 6 255 0 0 \\* 6 $any_time 00000000 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000 }"
# (Just a quick check: does the renumber work properly even if we don't
# start from the beginning of the list?)  (Hmm.  No renumber in this
208
# variant.  Oh well.)
209
210
211
212
213
214
215
send "1036 99 6 2 100 1\n"
simple_expect "=1036 2 { 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000 }"

# gazonk does get-membership-old of foo.  Should return 4 { 6 10 11 12 }.
send "1037 46 6 0 100 1\n"
simple_expect "=1037 4 { $any_time 6 255 0 0 \\* $any_time 10 200 0 0 \\* $any_time 11 200 0 0 \\* $any_time 12 200 0 0 \\* }"

216
217
218
219
220
221
222
223
224
225
# gazonk does get-membership of foo.  Should return 4 { 6 10 11 12 }.
send "1035 108 6 0 100 1 0\n"
simple_expect "=1035 4 { 0 $any_time 6 255 0 \\* 6 $any_time 00000000 1 $any_time 10 200 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 \\* 9 $any_time 10000000 }"
# (Just a quick check: does the renumber work properly even if we don't
# start from the beginning of the list?)  (Hmm.  No renumber in this
# variant.  Oh well.)
send "1036 108 6 2 100 1 0\n"
simple_expect "=1036 2 { 2 $any_time 11 200 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 \\* 9 $any_time 10000000 }"

# gazonk does query-read-texts-10 on foo and 10, 11 and 12.
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
send "1038 98 6 10\n"
simple_expect "=1038 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000"
send "1039 98 6 11\n"
simple_expect "=1039 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000"
send "1040 98 6 12\n"
simple_expect "=1040 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000"

# gazonk does query-read-texts-old on foo and 10, 11 and 12.
send "1041 9 6 10\n"
simple_expect "=1041 $any_time 10 200 0 0 \\*"
send "1042 9 6 11\n"
simple_expect "=1042 $any_time 11 200 0 0 \\*"
send "1043 9 6 12\n"
simple_expect "=1043 $any_time 12 200 0 0 \\*"

241
242
243
244
245
246
247
# gazonk does query-read-texts on foo and 10, 11 and 12.
send "1038 107 6 10 1 0\n"
simple_expect "=1038 1 $any_time 10 200 0 \\* 9 $any_time 10000000"
send "1039 107 6 11 1 0\n"
simple_expect "=1039 2 $any_time 11 200 0 \\* 9 $any_time 10000000"
send "1040 107 6 12 1 0\n"
simple_expect "=1040 3 $any_time 12 200 0 \\* 9 $any_time 10000000"
248
249
250
251
252
253
254
255
256

#
# gazonk examines bar.
#

# gazonk does get-unread-confs of bar.  Should return undefined-person.
send "1044 52 7\n"
good_bad_expect "%1044 10 7" "=0 \\*" "Bug 37"

257
# gazonk does get-membership-10 of bar.  Should return undefined-person.
258
259
260
261
262
263
264
send "1045 99 7 0 100 1\n"
simple_expect "%1045 10 7"

# gazonk does get-membership-old of bar.  Should return undefined-person.
send "1046 46 7 0 100 1\n"
simple_expect "%1046 10 7"

265
266
267
268
269
# gazonk does get-membership of bar.  Should return undefined-person.
send "1045 108 7 0 100 1 0\n"
simple_expect "%1045 10 7"

# gazonk does query-read-texts-10 on bar and 10, 11 and 12.  undefined-person.
270
271
# FIXME (bug 703): This should not be censored.  But see Bug 70...
setup_xfail "*-*-*" "Bug 703"
272
fail "query-read-texts-10 returns info about secret persons to admin of conf"
273
274
275
276
277
278
279
280
send "1047 98 7 10\n"
simple_expect "%1047 10 7"
send "1048 98 7 11\n"
simple_expect "%1048 10 7"
send "1049 98 7 12\n"
simple_expect "%1049 10 7"

# gazonk does query-read-texts-old on bar and 10, 11 and 12.  undefined-person.
281
282
283
# FIXME (bug 703): This should not be censored.  But see Bug 70...
setup_xfail "*-*-*" "Bug 703"
fail "query-read-texts-old returns info about secret persons to admin of conf"
284
285
286
287
288
289
290
send "1050 9 7 10\n"
simple_expect "%1050 10 7"
send "1051 9 7 11\n"
simple_expect "%1051 10 7"
send "1052 9 7 12\n"
simple_expect "%1052 10 7"

291
292
293
294
295
296
297
298
299
300
# gazonk does query-read-texts on bar and 10, 11 and 12.  undefined-person.
# FIXME (bug 703): This should not be censored.  But see Bug 70...
setup_xfail "*-*-*" "Bug 703"
fail "query-read-texts returns info about secret persons to admin of conf"
send "1047 107 7 10 1 0\n"
simple_expect "%1047 10 7"
send "1048 107 7 11 1 0\n"
simple_expect "%1048 10 7"
send "1049 107 7 12 1 0\n"
simple_expect "%1049 10 7"
301
302
303
304
305
306
307
308
309

#
# gazonk examines citrus.
#

# gazonk does get-unread-confs of citrus.  Should return the empty list.
send "1053 52 8\n"
simple_expect "=1053 0 \\*"

310
# gazonk does get-membership-10 of citrus.  Should return 4 { 6 10 11 12 }.
311
312
313
314
315
316
317
send "1054 99 8 0 100 1\n"
simple_expect "=1054 4 { 0 $any_time 8 255 0 0 \\* 8 $any_time 00000000 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000 }"

# gazonk does get-membership-old of citrus.  Should return 4 { 6 10 11 12 }.
send "1055 46 8 0 100 1\n"
simple_expect "=1055 4 { $any_time 8 255 0 0 \\* $any_time 10 200 0 0 \\* $any_time 11 200 0 0 \\* $any_time 12 200 0 0 \\* }"

318
319
320
321
322
# gazonk does get-membership of citrus.  Should return 4 { 6 10 11 12 }.
send "1054 108 8 0 100 1 0\n"
simple_expect "=1054 4 { 0 $any_time 8 255 0 \\* 8 $any_time 00000000 1 $any_time 10 200 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 \\* 9 $any_time 10000000 }"

# gazonk does query-read-texts-10 on citrus and 10, 11 and 12.
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
send "1056 98 8 10\n"
simple_expect "=1056 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000"
send "1057 98 8 11\n"
simple_expect "=1057 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000"
send "1058 98 8 12\n"
simple_expect "=1058 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000"

# gazonk does query-read-texts-old on citrus and 10, 11 and 12.
send "1059 9 8 10\n"
simple_expect "=1059 $any_time 10 200 0 0 \\*"
send "1060 9 8 11\n"
simple_expect "=1060 $any_time 11 200 0 0 \\*"
send "1061 9 8 12\n"
simple_expect "=1061 $any_time 12 200 0 0 \\*"

338
339
340
341
342
343
344
# gazonk does query-read-texts on citrus and 10, 11 and 12.
send "1056 107 8 10 1 0\n"
simple_expect "=1056 1 $any_time 10 200 0 \\* 9 $any_time 10000000"
send "1057 107 8 11 1 0\n"
simple_expect "=1057 2 $any_time 11 200 0 \\* 9 $any_time 10000000"
send "1058 107 8 12 1 0\n"
simple_expect "=1058 3 $any_time 12 200 0 \\* 9 $any_time 10000000"
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361

#
# foo writes a text with secret, rd-prot and public as recipients.
#

talk_to client 0
send "1062 86 [holl "foo"] 3 { 0 10 0 11 0 12 } 0 { }\n"
simple_expect "=1062 1"

#
# foo examines foo
#

# foo does get-unread-confs of foo.  Should return 3 { 10 11 12 }.
send "1063 52 6\n"
simple_expect "=1063 3 { 10 11 12 }"

362
# foo does get-membership-10 of foo.  Should return 4 { 6 10 11 12 }.
363
364
365
366
367
368
369
send "1064 99 6 0 100 1\n"
simple_expect "=1064 4 { 0 $any_time 6 255 0 0 \\* 6 $any_time 00000000 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000 }"

# foo does get-membership-old of foo.  Should return 4 { 6 10 11 12 }.
send "1065 46 6 0 100 1\n"
simple_expect "=1065 4 { $any_time 6 255 0 0 \\* $any_time 10 200 0 0 \\* $any_time 11 200 0 0 \\* $any_time 12 200 0 0 \\* }"

370
371
372
373
374
# foo does get-membership of foo.  Should return 4 { 6 10 11 12 }.
send "1064 108 6 0 100 1 0\n"
simple_expect "=1064 4 { 0 $any_time 6 255 0 \\* 6 $any_time 00000000 1 $any_time 10 200 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 \\* 9 $any_time 10000000 }"

# foo does query-read-texts-10 on foo and 10, 11 and 12.  Should get results.
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
send "1066 98 6 10\n"
simple_expect "=1066 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000"
send "1067 98 6 11\n"
simple_expect "=1067 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000"
send "1068 98 6 12\n"
simple_expect "=1068 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000"

# foo does query-read-texts-old on foo and 10, 11 and 12.  Should get results.
send "1069 9 6 10\n"
simple_expect "=1069 $any_time 10 200 0 0 \\*"
send "1070 9 6 11\n"
simple_expect "=1070 $any_time 11 200 0 0 \\*"
send "1071 9 6 12\n"
simple_expect "=1071 $any_time 12 200 0 0 \\*"

390
391
392
393
394
395
396
# foo does query-read-texts on foo and 10, 11 and 12.  Should get results.
send "1066 107 6 10 1 0\n"
simple_expect "=1066 1 $any_time 10 200 0 \\* 9 $any_time 10000000"
send "1067 107 6 11 1 0\n"
simple_expect "=1067 2 $any_time 11 200 0 \\* 9 $any_time 10000000"
send "1068 107 6 12 1 0\n"
simple_expect "=1068 3 $any_time 12 200 0 \\* 9 $any_time 10000000"
397
398
399
400
401
402
403
404
405
406
407
408

#
# gazonk examines foo.
#

talk_to client 3

# gazonk does get-unread-confs of foo.  Should return 3 { 10 11 12 }.
send "1072 52 6\n"
# "Bug 596"
good_bad_expect "=1072 3 { 10 11 12 }" "=1 { 12 }"

409
# gazonk does get-membership-10 of foo.  Should return 4 { 6 10 11 12 }.
410
411
412
413
414
415
416
417
418
419
send "1073 99 6 0 100 1\n"
simple_expect "=1073 4 { 0 $any_time 6 255 0 0 \\* 6 $any_time 00000000 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000 }"
# This is a totally pointless test of renumber--no renumbering here!
send "1074 99 6 3 100 1\n"
simple_expect "=1074 1 { 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000 }"

# gazonk does get-membership-old of foo.  Should return 4 { 6 10 11 12 }.
send "1075 46 6 0 100 1\n"
simple_expect "=1075 4 { $any_time 6 255 0 0 \\* $any_time 10 200 0 0 \\* $any_time 11 200 0 0 \\* $any_time 12 200 0 0 \\* }"

420
421
422
423
424
425
426
427
# gazonk does get-membership of foo.  Should return 4 { 6 10 11 12 }.
send "1073 108 6 0 100 1 0\n"
simple_expect "=1073 4 { 0 $any_time 6 255 0 \\* 6 $any_time 00000000 1 $any_time 10 200 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 \\* 9 $any_time 10000000 }"
# This is a totally pointless test of renumber--no renumbering here!
send "1074 108 6 3 100 1 0\n"
simple_expect "=1074 1 { 3 $any_time 12 200 0 \\* 9 $any_time 10000000 }"

# gazonk does query-read-texts-10 on foo and 10, 11 and 12.
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
send "1076 98 6 10\n"
simple_expect "=1076 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000"
send "1077 98 6 11\n"
simple_expect "=1077 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000"
send "1078 98 6 12\n"
simple_expect "=1078 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000"

# gazonk does query-read-texts-old on foo and 10, 11 and 12.
send "1079 9 6 10\n"
simple_expect "=1079 $any_time 10 200 0 0 \\*"
send "1080 9 6 11\n"
simple_expect "=1080 $any_time 11 200 0 0 \\*"
send "1081 9 6 12\n"
simple_expect "=1081 $any_time 12 200 0 0 \\*"

443
444
445
446
447
448
449
# gazonk does query-read-texts on foo and 10, 11 and 12.
send "1076 107 6 10 1 0\n"
simple_expect "=1076 1 $any_time 10 200 0 \\* 9 $any_time 10000000"
send "1077 107 6 11 1 0\n"
simple_expect "=1077 2 $any_time 11 200 0 \\* 9 $any_time 10000000"
send "1078 107 6 12 1 0\n"
simple_expect "=1078 3 $any_time 12 200 0 \\* 9 $any_time 10000000"
450
451
452
453
454
455
456
457
458
459
460



#
# gazonk examines bar
#

# gazonk does get-unread-confs of bar.  Should return undefined-person.
send "1082 52 7\n"
good_bad_expect "%1082 10 7" "=3 { 10 11 12 }" "Bug 37"

461
# gazonk does get-membership-10 of bar.  Should return undefined-person.
462
463
464
465
466
467
468
send "1083 99 7 0 100 1\n"
simple_expect "%1083 10 7"

# gazonk does get-membership-old of bar.  Should return undefined-person.
send "1084 46 7 0 100 1\n"
simple_expect "%1084 10 7"

469
470
471
472
473
# gazonk does get-membership of bar.  Should return undefined-person.
send "1083 108 7 0 100 1 0\n"
simple_expect "%1083 10 7"

# gazonk does query-read-texts-10 on bar and 10, 11 and 12.  undefined-person.
474
475
476
# FIXME (bug 703): This should not be censored.  But see Bug 70...
setup_xfail "*-*-*" "Bug 703"
fail "query-read-texts returns info about secret persons to admin of conf"
477
478
479
480
481
482
483
484
send "1085 98 7 10\n"
simple_expect "%1085 10 7"
send "1086 98 7 11\n"
simple_expect "%1086 10 7"
send "1087 98 7 12\n"
simple_expect "%1087 10 7"

# gazonk does query-read-texts-old on bar and 10, 11 and 12.  undefined-person.
485
486
487
# FIXME (bug 703): This should not be censored.  But see Bug 70...
setup_xfail "*-*-*" "Bug 703"
fail "query-read-texts-old returns info about secret persons to admin of conf"
488
489
490
491
492
493
494
send "1088 9 7 10\n"
simple_expect "%1088 10 7"
send "1089 9 7 11\n"
simple_expect "%1089 10 7"
send "1090 9 7 12\n"
simple_expect "%1090 10 7"

495
496
497
498
499
500
501
502
503
504
# gazonk does query-read-texts on bar and 10, 11 and 12.  undefined-person.
# FIXME (bug 703): This should not be censored.  But see Bug 70...
setup_xfail "*-*-*" "Bug 703"
fail "query-read-texts returns info about secret persons to admin of conf"
send "1085 107 7 10 1 0\n"
simple_expect "%1085 10 7"
send "1086 107 7 11 1 0\n"
simple_expect "%1086 10 7"
send "1087 107 7 12 1 0\n"
simple_expect "%1087 10 7"
505
506
507
508
509
510
511
512
513
514


#
# gazonk examines citrus.
#

# gazonk does get-unread-confs of citrus.  Should return the empty list.
send "1091 52 8\n"
good_bad_expect "=1091 0 \\*" "=3 { 10 11 12 }" "Bug 595"

515
# gazonk does get-membership-10 of citrus.  Should return 4 { 6 10 11 12 }.
516
517
518
519
520
521
522
send "1092 99 8 0 100 1\n"
simple_expect "=1092 4 { 0 $any_time 8 255 0 0 \\* 8 $any_time 00000000 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000 }"

# gazonk does get-membership-old of citrus.  Should return 4 { 6 10 11 12 }.
send "1093 46 8 0 100 1\n"
simple_expect "=1093 4 { $any_time 8 255 0 0 \\* $any_time 10 200 0 0 \\* $any_time 11 200 0 0 \\* $any_time 12 200 0 0 \\* }"

523
524
525
526
527
# gazonk does get-membership of citrus.  Should return 4 { 6 10 11 12 }.
send "1092 108 8 0 100 1 0\n"
simple_expect "=1092 4 { 0 $any_time 8 255 0 \\* 8 $any_time 00000000 1 $any_time 10 200 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 \\* 9 $any_time 10000000 }"

# gazonk does query-read-texts-10 on citrus and 10, 11 and 12.
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
send "1094 98 8 10\n"
simple_expect "=1094 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000"
send "1095 98 8 11\n"
simple_expect "=1095 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000"
send "1096 98 8 12\n"
simple_expect "=1096 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000"

# gazonk does query-read-texts-old on citrus and 10, 11 and 12.
send "1097 9 8 10\n"
simple_expect "=1097 $any_time 10 200 0 0 \\*"
send "1098 9 8 11\n"
simple_expect "=1098 $any_time 11 200 0 0 \\*"
send "1099 9 8 12\n"
simple_expect "=1099 $any_time 12 200 0 0 \\*"

543
544
545
546
547
548
549
# gazonk does query-read-texts on citrus and 10, 11 and 12.
send "1094 107 8 10 1 0\n"
simple_expect "=1094 1 $any_time 10 200 0 \\* 9 $any_time 10000000"
send "1095 107 8 11 1 0\n"
simple_expect "=1095 2 $any_time 11 200 0 \\* 9 $any_time 10000000"
send "1096 107 8 12 1 0\n"
simple_expect "=1096 3 $any_time 12 200 0 \\* 9 $any_time 10000000"
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


#
# mark as read
#

# foo marks the text as read
talk_to client 0
send "1100 27 10 1 { 1 }\n"
simple_expect "=1100"
send "1101 27 11 1 { 1 }\n"
simple_expect "=1101"
send "1102 27 12 1 { 1 }\n"
simple_expect "=1102"

# bar marks the text as read
talk_to client 1
send "1103 27 10 1 { 1 }\n"
simple_expect "=1103"
send "1104 27 11 1 { 1 }\n"
simple_expect "=1104"
send "1105 27 12 1 { 1 }\n"
simple_expect "=1105"

# citrus marks the text as read
talk_to client 2
send "1106 27 10 1 { 1 }\n"
simple_expect "=1106"
send "1107 27 11 1 { 1 }\n"
simple_expect "=1107"
send "1108 27 12 1 { 1 }\n"
simple_expect "=1108"

#
# foo examines foo.
#

talk_to client 0

# foo does get-unread-confs of foo.  Should return the empty list.
send "1109 52 6\n"
simple_expect "=1109 0 \\*"

593
# foo does get-membership-10 of foo.  Should return 4 { 6 10 11 12 }.
594
595
596
597
598
599
600
send "1110 99 6 0 100 1\n"
simple_expect "=1110 4 { 0 $any_time 6 255 0 0 \\* 6 $any_time 00000000 1 $any_time 10 200 1 0 \\* 9 $any_time 10000000 2 $any_time 11 200 1 0 \\* 9 $any_time 10000000 3 $any_time 12 200 1 0 \\* 9 $any_time 10000000 }"

# foo does get-membership-old of foo.  Should return 4 { 6 10 11 12 }.
send "1111 46 6 0 100 1\n"
simple_expect "=1111 4 { $any_time 6 255 0 0 \\* $any_time 10 200 1 0 \\* $any_time 11 200 1 0 \\* $any_time 12 200 1 0 \\* }"

601
602
603
604
605
# foo does get-membership of foo.  Should return 4 { 6 10 11 12 }.
send "1110 108 6 0 100 1 0\n"
simple_expect "=1110 4 { 0 $any_time 6 255 0 \\* 6 $any_time 00000000 1 $any_time 10 200 1 { 1 1 } 9 $any_time 10000000 2 $any_time 11 200 1 { 1 1 } 9 $any_time 10000000 3 $any_time 12 200 1 { 1 1 } 9 $any_time 10000000 }"

# foo does query-read-texts-10 on foo and 10, 11 and 12.  Should get results.
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
send "1112 98 6 10\n"
simple_expect "=1112 1 $any_time 10 200 1 0 \\* 9 $any_time 10000000"
send "1113 98 6 11\n"
simple_expect "=1113 2 $any_time 11 200 1 0 \\* 9 $any_time 10000000"
send "1114 98 6 12\n"
simple_expect "=1114 3 $any_time 12 200 1 0 \\* 9 $any_time 10000000"

# foo does query-read-texts-old on foo and 10, 11 and 12.  Should get results.
send "1115 9 6 10\n"
simple_expect "=1115 $any_time 10 200 1 0 \\*"
send "1116 9 6 11\n"
simple_expect "=1116 $any_time 11 200 1 0 \\*"
send "1117 9 6 12\n"
simple_expect "=1117 $any_time 12 200 1 0 \\*"

621
622
623
624
625
626
627
# foo does query-read-texts on foo and 10, 11 and 12.  Should get results.
send "1112 107 6 10 1 0\n"
simple_expect "=1112 1 $any_time 10 200 1 { 1 1 } 9 $any_time 10000000"
send "1113 107 6 11 1 0\n"
simple_expect "=1113 2 $any_time 11 200 1 { 1 1 } 9 $any_time 10000000"
send "1114 107 6 12 1 0\n"
simple_expect "=1114 3 $any_time 12 200 1 { 1 1 } 9 $any_time 10000000"
628
629
630
631
632
633
634
635
636
637
638

#
# gazonk examines foo.
#

talk_to client 3

# gazonk does get-unread-confs of foo.  Should return the empty list.
send "1118 52 6\n"
simple_expect "=1118 0 \\*"

639
# gazonk does get-membership-10 of foo.  Should return 4 { 6 10 11 12 }.
640
641
642
643
644
645
646
send "1119 99 6 0 100 1\n"
simple_expect "=1119 4 { 0 $any_time 6 255 0 0 \\* 6 $any_time 00000000 1 $any_time 10 200 1 0 \\* 9 $any_time 10000000 2 $any_time 11 200 1 0 \\* 9 $any_time 10000000 3 $any_time 12 200 1 0 \\* 9 $any_time 10000000 }"

# gazonk does get-membership-old of foo.  Should return 4 { 6 10 11 12 }.
send "1120 46 6 0 100 1\n"
simple_expect "=1120 4 { $any_time 6 255 0 0 \\* $any_time 10 200 1 0 \\* $any_time 11 200 1 0 \\* $any_time 12 200 1 0 \\* }"

647
648
649
650
651
# gazonk does get-membership of foo.  Should return 4 { 6 10 11 12 }.
send "1119 108 6 0 100 1 0\n"
simple_expect "=1119 4 { 0 $any_time 6 255 0 \\* 6 $any_time 00000000 1 $any_time 10 200 1 { 1 1 } 9 $any_time 10000000 2 $any_time 11 200 1 { 1 1 } 9 $any_time 10000000 3 $any_time 12 200 1 { 1 1 } 9 $any_time 10000000 }"

# gazonk does query-read-texts-10 on foo and 10, 11 and 12.
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
send "1121 98 6 10\n"
simple_expect "=1121 1 $any_time 10 200 1 0 \\* 9 $any_time 10000000"
send "1122 98 6 11\n"
simple_expect "=1122 2 $any_time 11 200 1 0 \\* 9 $any_time 10000000"
send "1123 98 6 12\n"
simple_expect "=1123 3 $any_time 12 200 1 0 \\* 9 $any_time 10000000"

# gazonk does query-read-texts-old on foo and 10, 11 and 12.
send "1124 9 6 10\n"
simple_expect "=1124 $any_time 10 200 1 0 \\*"
send "1125 9 6 11\n"
simple_expect "=1125 $any_time 11 200 1 0 \\*"
send "1126 9 6 12\n"
simple_expect "=1126 $any_time 12 200 1 0 \\*"

667
668
669
670
671
672
673
674
# gazonk does query-read-texts on foo and 10, 11 and 12.
send "1121 107 6 10 1 0\n"
simple_expect "=1121 1 $any_time 10 200 1 { 1 1 } 9 $any_time 10000000"
send "1122 107 6 11 1 0\n"
simple_expect "=1122 2 $any_time 11 200 1 { 1 1 } 9 $any_time 10000000"
send "1123 107 6 12 1 0\n"
simple_expect "=1123 3 $any_time 12 200 1 { 1 1 } 9 $any_time 10000000"

675
# gazonk does <FIXME (bug 590)> on foo and 10, 11 and 12.  Should work.
676
677
678
679
680
681
682
683
684

#
# gazonk examines bar.
#

# gazonk does get-unread-confs of bar.  Should return undefined-person.
send "1127 52 7\n"
good_bad_expect "%1127 10 7" "=0 \\*" "Bug 37"

685
# gazonk does get-membership-10 of bar.  Should return undefined-person.
686
687
688
689
690
691
692
send "1128 99 7 0 100 1\n"
simple_expect "%1128 10 7"

# gazonk does get-membership-old of bar.  Should return undefined-person.
send "1129 46 7 0 100 1\n"
simple_expect "%1129 10 7"

693
694
695
696
697
# gazonk does get-membership of bar.  Should return undefined-person.
send "1128 108 7 0 100 1 0\n"
simple_expect "%1128 10 7"

# gazonk does query-read-texts-10 on bar and 10, 11 and 12.  undefined-person.
698
699
# FIXME (bug 703): This should not be censored.  But see Bug 70...
setup_xfail "*-*-*" "Bug 703"
700
fail "query-read-texts-10 returns info about secret persons to admin of conf"
701
702
703
704
705
706
707
708
send "1130 98 7 10\n"
simple_expect "%1130 10 7"
send "1131 98 7 11\n"
simple_expect "%1131 10 7"
send "1132 98 7 12\n"
simple_expect "%1132 10 7"

# gazonk does query-read-texts-old on bar and 10, 11 and 12.  undefined-person.
709
710
711
# FIXME (bug 703): This should not be censored.  But see Bug 70...
setup_xfail "*-*-*" "Bug 703"
fail "query-read-texts-old returns info about secret persons to admin of conf"
712
713
714
715
716
717
718
send "1133 9 7 10\n"
simple_expect "%1133 10 7"
send "1134 9 7 11\n"
simple_expect "%1134 10 7"
send "1135 9 7 12\n"
simple_expect "%1135 10 7"

719
720
721
722
723
724
725
726
727
728
# gazonk does query-read-texts on bar and 10, 11 and 12.  undefined-person.
# FIXME (bug 703): This should not be censored.  But see Bug 70...
setup_xfail "*-*-*" "Bug 703"
fail "query-read-texts returns info about secret persons to admin of conf"
send "1130 107 7 10 1 0\n"
simple_expect "%1130 10 7"
send "1131 107 7 11 1 0\n"
simple_expect "%1131 10 7"
send "1132 107 7 12 1 0\n"
simple_expect "%1132 10 7"
729
730

# FIXME (bug 704): Now, set unread-is-secret for bar, and let gazonk
731
732
# redo the query-read-texts-10, query-read-texts-old, and
# query-read-texts requests.  Check that unread-is-secret is
733
734
# respected.  Then change unread-is-secret back.

735
736
737
738
739
740
741
742
743

#
# gazonk examines citrus.
#

# gazonk does get-unread-confs of citrus.  Should return the empty list.
send "1136 52 8\n"
simple_expect "=1136 0 \\*"

744
# gazonk does get-membership-10 of citrus.  Should return 4 { 6 10 11 12 }.
745
send "1137 99 8 0 100 1\n"
746
simple_expect "=1137 4 { 0 $any_time 8 255 0 0 \\* 8 $any_time 00000000 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000 }"
747
748
749

# gazonk does get-membership-old of citrus.  Should return 4 { 6 10 11 12 }.
send "1138 46 8 0 100 1\n"
750
simple_expect "=1138 4 { $any_time 8 255 0 0 \\* $any_time 10 200 0 0 \\* $any_time 11 200 0 0 \\* $any_time 12 200 0 0 \\* }"
751

752
753
754
755
756
# gazonk does get-membership of citrus.  Should return 4 { 6 10 11 12 }.
send "1137 108 8 0 100 1 0\n"
simple_expect "=1137 4 { 0 $any_time 8 255 0 \\* 8 $any_time 00000000 1 $any_time 10 200 0 \\* 9 $any_time 10000000 2 $any_time 11 200 0 \\* 9 $any_time 10000000 3 $any_time 12 200 0 \\* 9 $any_time 10000000 }"

# gazonk does query-read-texts-10 on citrus and 10, 11 and 12.
757
758
759
760
761
762
763
send "1139 98 8 10\n"
simple_expect "=1139 1 $any_time 10 200 0 0 \\* 9 $any_time 10000000"
send "1140 98 8 11\n"
simple_expect "=1140 2 $any_time 11 200 0 0 \\* 9 $any_time 10000000"
send "1141 98 8 12\n"
simple_expect "=1141 3 $any_time 12 200 0 0 \\* 9 $any_time 10000000"

764
# gazonk does query-read-texts-old on citrus and 10, 11 and 12.
765
766
767
768
769
770
771
send "1142 9 8 10\n"
simple_expect "=1142 $any_time 10 200 0 0 \\*"
send "1143 9 8 11\n"
simple_expect "=1143 $any_time 11 200 0 0 \\*"
send "1144 9 8 12\n"
simple_expect "=1144 $any_time 12 200 0 0 \\*"

772
773
774
775
776
777
778
# gazonk does query-read-texts on citrus and 10, 11 and 12.
send "1139 107 8 10 1 0\n"
simple_expect "=1139 1 $any_time 10 200 0 \\* 9 $any_time 10000000"
send "1140 107 8 11 1 0\n"
simple_expect "=1140 2 $any_time 11 200 0 \\* 9 $any_time 10000000"
send "1141 107 8 12 1 0\n"
simple_expect "=1141 3 $any_time 12 200 0 \\* 9 $any_time 10000000"
779

780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
#
# gazonk examines the conferences
#

# Test get-members-old
send "1145 48 10 0 100\n"
simple_expect "=1145 3 { 7 6 8 }"
send "1146 48 11 0 100\n"
simple_expect "=1146 3 { 7 6 8 }"
send "1147 48 12 0 100\n"
simple_expect "=1147 3 { 7 6 8 }"

# Test get-members.
send "1148 101 10 0 100\n"
simple_expect "=1148 3 { 7 9 $any_time 10000000 6 9 $any_time 10000000 8 9 $any_time 10000000 }"
send "1149 101 11 0 100\n"
simple_expect "=1149 3 { 7 9 $any_time 10000000 6 9 $any_time 10000000 8 9 $any_time 10000000 }"
send "1150 101 12 0 100\n"
simple_expect "=1150 3 { 7 9 $any_time 10000000 6 9 $any_time 10000000 8 9 $any_time 10000000 }"

800
801
802

# Shut down.
talk_to client 3
803
804
805
806
807
808
send "1151 0 5 [holl "gazonk"]\n"
simple_expect "=1151"
send "1152 42 255\n"
simple_expect "=1152"
send "1153 44 0\n"
simple_expect "=1153"
809
810
811
812
813
client_death 3
client_death 2
client_death 1
client_death 0
lyskomd_death