03.exp 43.3 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)
Per Cederqvist's avatar
Per Cederqvist committed
7 8
#   10 "aux in general" (created at call 88)
#   11 "aux non anon" (created at call 88)
9 10 11 12 13
#   Persons
#    6 "Per Cederqvist"
#         Member of 7.
#    8 "Kelly Talisman" (all available aux-infos are set)
#         Member of 7.
Per Cederqvist's avatar
Per Cederqvist committed
14
#   12 "aux person"
15 16
#   Texts
#    1 "Old-style text 1"    0 7 6 1
Per Cederqvist's avatar
Per Cederqvist committed
17
#    2 "Old-style text 2"    0 7 6 2 (deleted at call 28)
18
#    3 "Old-style text 3"    0 7 6 3 (; 0 2 6 1 during 29..31)
19 20 21 22
#    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
Per Cederqvist's avatar
Per Cederqvist committed
23
#    8 "Anon text 8"         0 1 6 2
Per Cederqvist's avatar
Per Cederqvist committed
24 25
#    9 "aux-style text 9"    0 7 6 7
#   10 "aux-style anon 10"   0 7 6 7 (FAQ for conf 10 and 11 after call 88)
26
#   Sessions
Per Cederqvist's avatar
Per Cederqvist committed
27
#    1 logged in as person 6; default asyncs; does not use user_active
28
#      or set_client_version or any other new and fancy stuff.
Per Cederqvist's avatar
Per Cederqvist committed
29 30
#      (This is client 0)
#    2 logged in as person 8; all available asyncs; uses user_active;
31
#      calls set_client_version("dgt03", "sc 1").
Per Cederqvist's avatar
Per Cederqvist committed
32 33
#      (This is client 1)
#    3 logged in as person 8 for brief moments.  Logged in invisibly
Per Cederqvist's avatar
Per Cederqvist committed
34
#      as person 5 from the testing of call 8 and onwards.
Per Cederqvist's avatar
Per Cederqvist committed
35
#      Default asyncs; does not us user_active or set_client_version.
Per Cederqvist's avatar
Per Cederqvist committed
36 37 38 39
#      (This is client 2)
#    4 logged in invisibly as person 5 from call 79.
#      Default asyncs; does not us user_active or set_client_version.
#      (This is client 2)
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
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 \\* \\*"

Per Cederqvist's avatar
Per Cederqvist committed
58
# This test was written while listening to Talitha, so it seemed proper
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
# 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"
Per Cederqvist's avatar
Per Cederqvist committed
78
extracting_expect ":16 0 1 ($any_time) 6 0 16 0 2 { 0 7 6 1 }" time_1 1
79 80
simple_expect "=1006 1"

Per Cederqvist's avatar
Per Cederqvist committed
81 82 83 84 85 86 87
set post_1 $time_1
while {"$post_1" == "$time_1"} {
    sleep 0.1
    send "999 35\n"
    extracting_expect "=999 ($any_time)" post_1 1
}

88
send "1007 28 [holl "Old-style text 2"] 2 { 0 7 6 99 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
89
extracting_expect ":16 0 2 ($any_time) 6 0 16 0 2 { 0 7 6 2 }" time_2 1
90 91
simple_expect "=1007 2"

Per Cederqvist's avatar
Per Cederqvist committed
92 93 94 95 96 97 98
set post_2 $time_2
while {"$post_2" == "$time_2"} {
    sleep 0.1
    send "999 35\n"
    extracting_expect "=999 ($any_time)" post_2 1
}

99
send "1008 28 [holl "Old-style text 3"] 1 { 0 7 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
100
extracting_expect ":16 0 3 ($any_time) 6 0 16 0 2 { 0 7 6 3 }" time_3 1
101 102 103 104 105 106 107 108 109 110 111 112
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"

113 114 115
# 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.
116 117 118 119 120 121
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"

Per Cederqvist's avatar
Per Cederqvist committed
122 123
send "1012 35\n"
extracting_expect "=1012 ($any_time)" user_active_0 1
124

Per Cederqvist's avatar
Per Cederqvist committed
125 126
send "1013 81\n"
simple_expect "=1013 8 { 0 5 7 8 9 11 12 13 }"
127

Per Cederqvist's avatar
Per Cederqvist committed
128 129
send "1014 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 "%1014 46 0"
130

Per Cederqvist's avatar
Per Cederqvist committed
131 132
send "1015 81\n"
simple_expect "=1015 8 { 0 5 7 8 9 11 12 13 }"
133

Per Cederqvist's avatar
Per Cederqvist committed
134 135
send "1016 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 "%1016 50 1"
136

Per Cederqvist's avatar
Per Cederqvist committed
137 138
send "1017 81\n"
simple_expect "=1017 11 { 0 5 6 7 8 9 11 12 13 14 15 }"
139

Per Cederqvist's avatar
Per Cederqvist committed
140 141
send "1018 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 "%1018 50 2"
142

Per Cederqvist's avatar
Per Cederqvist committed
143 144
send "1019 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 "%1019 50 3"
145

Per Cederqvist's avatar
Per Cederqvist committed
146 147
send "1020 81\n"
simple_expect "=1020 11 { 0 5 6 7 8 9 11 12 13 14 15 }"
148

Per Cederqvist's avatar
Per Cederqvist committed
149 150
send "1021 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 "%1021 50 4"
151

Per Cederqvist's avatar
Per Cederqvist committed
152 153
send "1022 81\n"
simple_expect "=1022 11 { 0 5 6 7 8 9 11 12 13 14 15 }"
154

Per Cederqvist's avatar
Per Cederqvist committed
155 156
send "1023 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 "%1023 50 128"
157

Per Cederqvist's avatar
Per Cederqvist committed
158 159
send "1024 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 "%1024 50 16"
160

Per Cederqvist's avatar
Per Cederqvist committed
161 162
send "1025 81\n"
simple_expect "=1025 11 { 0 5 6 7 8 9 11 12 13 14 15 }"
163

Per Cederqvist's avatar
Per Cederqvist committed
164 165
send "1026 80 12 { 0 5 6 7 8 9 10 11 12 13 14 15 }\n"
simple_expect "%1026 50 10"
166

Per Cederqvist's avatar
Per Cederqvist committed
167 168
send "1027 80 11 { 0 5 6 7 8 9 11 12 13 14 15 }\n"
simple_expect "=1027"
169

Per Cederqvist's avatar
Per Cederqvist committed
170 171 172 173
send "1028 81\n"
simple_expect "=1028 11 { 0 5 6 7 8 9 11 12 13 14 15 }"

send "1029 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"
174
simple_expect ":2 9 8 2"
Per Cederqvist's avatar
Per Cederqvist committed
175
simple_expect "=1029 8"
176 177 178 179
talk_to client 0
simple_expect ":2 9 8 2"
talk_to client 1

Per Cederqvist's avatar
Per Cederqvist committed
180
send "1030 86 [holl "New-style text 4"] 2 { 0 7 15 6 } 0 { }\n"
181 182
# No async message; person 8 isn't a member of the conferences this
# text goes to.
Per Cederqvist's avatar
Per Cederqvist committed
183
simple_expect "=1030 4"
184 185 186 187 188 189

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.
Per Cederqvist's avatar
Per Cederqvist committed
190 191
send "1031 100 7 8 100 0 00000000\n"
simple_expect "=1031"
192

Per Cederqvist's avatar
Per Cederqvist committed
193
send "1032 86 [holl "New-style text 5"] 2 { 0 7 15 6 } 0 { }\n"
194 195
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 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
196
simple_expect "=1032 5"
197

198 199 200 201
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

Per Cederqvist's avatar
Per Cederqvist committed
202
send "1033 86 [holl "New-style text 6"] 2 { 0 7 15 8 } 0 { }\n"
203 204
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 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
205
simple_expect "=1033 6"
206 207 208 209 210

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

Per Cederqvist's avatar
Per Cederqvist committed
211 212 213 214
send "1034 86 [holl "New-style text 7"] 2 { 0 1 15 8 } 0 { }\n"
extracting_expect ":16 0 7 ($any_time) 8 0 16 0 4 { 0 1 6 1 1 8 6 2 }" time_7 1
simple_expect ":18 15 7 $time_7 8 0 16 0 4 { 0 1 6 1 15 8 6 2 } 0 \\*"
simple_expect "=1034 7"
215 216 217

talk_to client 0
# No async for client 0 at this point.
Per Cederqvist's avatar
Per Cederqvist committed
218 219
send "1035 35\n"
simple_expect "=1035 $any_time"
220
talk_to client 1
221

Per Cederqvist's avatar
Per Cederqvist committed
222 223 224 225 226
# test call 0 (login)
client_start 2
talk_to client 2
send "A[holl "Foo"]\n"
simple_expect "LysKOM" "client 2 connected"
Per Cederqvist's avatar
Per Cederqvist committed
227 228 229 230
send "1036 0 3 [holl "gazonk"]\n"
simple_expect "%1036 10 3"
send "1037 0 8 [holl "gazonk"]\n"
simple_expect "%1037 4 8"
Per Cederqvist's avatar
Per Cederqvist committed
231 232 233
talk_to client 0
send "1038 35\n"
simple_expect "=1038 $any_time"
Per Cederqvist's avatar
Per Cederqvist committed
234 235 236
talk_to client 1
send "1039 35\n"
simple_expect "=1039 $any_time"
Per Cederqvist's avatar
Per Cederqvist committed
237
talk_to client 2
Per Cederqvist's avatar
Per Cederqvist committed
238
send "1040 0 8 [holl "the stars"]\n"
Per Cederqvist's avatar
Per Cederqvist committed
239
simple_expect ":2 9 8 3"
Per Cederqvist's avatar
Per Cederqvist committed
240
simple_expect "=1040"
Per Cederqvist's avatar
Per Cederqvist committed
241 242 243 244 245 246 247
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
Per Cederqvist's avatar
Per Cederqvist committed
248
send "1041 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
249
simple_expect ":2 13 8 3"
Per Cederqvist's avatar
Per Cederqvist committed
250
simple_expect "=1041"
Per Cederqvist's avatar
Per Cederqvist committed
251 252 253 254 255 256 257
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
Per Cederqvist's avatar
Per Cederqvist committed
258 259 260 261
send "1042 2 2\n"
simple_expect "%1042 13 2"
send "1043 2 34\n"
simple_expect "%1043 9 34"
Per Cederqvist's avatar
Per Cederqvist committed
262 263
# This session has already changed conference to 7 in the preamble above.
# Check that the failed attempts didn't change that.
Per Cederqvist's avatar
Per Cederqvist committed
264 265
send "1044 83 1 0 0\n"
simple_expect "=1044 2 { 2 8 0 $any_num 01000000 0H 1 6 7 $any_num 00000000 0H }"
Per Cederqvist's avatar
Per Cederqvist committed
266
# Check that we can leave all conferences.
Per Cederqvist's avatar
Per Cederqvist committed
267 268
send "1045 2 0\n"
simple_expect "=1045"
Per Cederqvist's avatar
Per Cederqvist committed
269 270 271
talk_to client 1
simple_expect ":5 6 6 0 1 [holl ""] [holl "ceder@gratia@localhost"]"
talk_to client 0
Per Cederqvist's avatar
Per Cederqvist committed
272 273
send "1046 83 1 0 0\n"
simple_expect "=1046 2 { 2 8 0 $any_num 01000000 0H 1 6 0 $any_num 00000000 0H }"
Per Cederqvist's avatar
Per Cederqvist committed
274
# Go to the letterbox and stay there
Per Cederqvist's avatar
Per Cederqvist committed
275 276
send "1047 2 6\n"
simple_expect "=1047"
Per Cederqvist's avatar
Per Cederqvist committed
277 278 279
talk_to client 1
simple_expect ":5 6 6 6 1 [holl ""] [holl "ceder@gratia@localhost"]"
talk_to client 0
Per Cederqvist's avatar
Per Cederqvist committed
280 281
send "1048 83 1 0 0\n"
simple_expect "=1048 2 { 2 8 0 $any_num 01000000 0H 1 6 6 $any_num 00000000 0H }"
Per Cederqvist's avatar
Per Cederqvist committed
282 283 284

# test call 3 (change-name)
talk_to client 0
Per Cederqvist's avatar
Per Cederqvist committed
285 286 287
send "1049 3 7 [holl "Per Cederqvist"]\n"
simple_expect "%1049 20 0"
send "1050 3 7 [holl "PRIMa musik"]\n"
Per Cederqvist's avatar
Per Cederqvist committed
288
simple_expect ":3 5 7 [holl ".So called. Christian Music"] [holl "PRIMa musik"]"
Per Cederqvist's avatar
Per Cederqvist committed
289
simple_expect "=1050"
Per Cederqvist's avatar
Per Cederqvist committed
290 291 292 293 294 295

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
296 297
# test call 4 (change-what-i-am-doing)
talk_to client 0
Per Cederqvist's avatar
Per Cederqvist committed
298 299
send "1051 4 [holl "Running a test suite"]\n"
simple_expect "=1051"
Per Cederqvist's avatar
Per Cederqvist committed
300 301
talk_to client 1
simple_expect ":5 6 6 6 1 [holl "Running a test suite"] [holl "ceder@gratia@localhost"]"
Per Cederqvist's avatar
Per Cederqvist committed
302
send "1052 4 [holl "Accepting i-am-on"]\n"
Per Cederqvist's avatar
Per Cederqvist committed
303
simple_expect ":5 6 8 0 2 [holl "Accepting i-am-on"] [holl "ic@gratia@localhost"]"
Per Cederqvist's avatar
Per Cederqvist committed
304
simple_expect "=1052"
Per Cederqvist's avatar
Per Cederqvist committed
305 306 307

# call 5 (create-person-old) is tested above.
# test call 6 (get-person-stat-old)
Per Cederqvist's avatar
Per Cederqvist committed
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325
send "1053 6 0 0\n"
simple_expect "%1053 8 0"
send "1054 6 3 0\n"
simple_expect "%1054 10 3"
send "1055 6 10 0\n"
simple_expect "%1055 10 10"
send "1056 6 6 0\n"
simple_expect "=1056 [holl ""] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
send "1057 6 6 1\n"
simple_expect "=1057 [holl "ceder@gratia.unknown.@localhost"] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
send "1058 6 6 2\n"
simple_expect "=1058 [holl ""] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
send "1059 6 6 3\n"
simple_expect "=1059 [holl "ceder@gratia.unknown.@localhost"] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
send "1060 6 6 32770\n"
simple_expect "=1060 [holl ""] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
send "1061 6 6 32771\n"
simple_expect "=1061 [holl "ceder@gratia.unknown.@localhost"] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 1 1 3 0 2"
Per Cederqvist's avatar
Per Cederqvist committed
326 327

# test call 7 (set-priv-bits)
Per Cederqvist's avatar
Per Cederqvist committed
328 329
send "1062 7 8 0000000000000000\n"
simple_expect "%1062 12 0"
Per Cederqvist's avatar
Per Cederqvist committed
330
talk_to client 2
Per Cederqvist's avatar
Per Cederqvist committed
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
send "1063 62 5 [holl "gazonk"] 1\n"
simple_expect "=1063"
send "1064 7 8 0000000000000000\n"
simple_expect "%1064 12 0"
send "1065 42 255\n"
simple_expect "=1065"
send "1066 6 8 0\n"
simple_expect "=1066 [holl ""] 0000010000000000 00000000 $any_time 0 $any_num 2 0 64 0 0 0 0 1 4 0 2"
send "1067 7 8 0000000000000000\n"
simple_expect "=1067"
send "1068 6 8 0\n"
simple_expect "=1068 [holl ""] 0000000000000000 00000000 $any_time 0 $any_num 2 0 64 0 0 0 0 1 4 0 2"
send "1069 7 8 1111111111111111\n"
simple_expect "=1069"
send "1070 6 8 0\n"
simple_expect "=1070 [holl ""] 1111111111111111 00000000 $any_time 0 $any_num 2 0 64 0 0 0 0 1 4 0 2"
send "1071 7 8 0000010000000000\n"
simple_expect "=1071"
send "1072 6 8 0\n"
simple_expect "=1072 [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
351 352

# test call 8 (set-passwd)
Per Cederqvist's avatar
Per Cederqvist committed
353 354 355
send "1073 8 5 [holl "foo"] [holl "bar"]\n"
simple_expect "%1073 4 5"
send "1074 8 5 [holl "gazonk"] [holl "bar"]\n"
Per Cederqvist's avatar
Per Cederqvist committed
356
simple_expect "=1074"
Per Cederqvist's avatar
Per Cederqvist committed
357 358 359 360 361 362
send "1075 1\n"
simple_expect "=1075"
send "1076 62 5 [holl "gazonk"] 1\n"
simple_expect "%1076 4 5"
send "1077 62 5 [holl "bar"] 1\n"
simple_expect "=1077"
Per Cederqvist's avatar
Per Cederqvist committed
363 364 365

# test call 9 (query-read-texts-old)
talk_to client 0
Per Cederqvist's avatar
Per Cederqvist committed
366 367
send "1078 9 6 7\n"
simple_expect "=1078 $any_time 7 100 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
368 369

# test call 10 (create-conf-old)
Per Cederqvist's avatar
Per Cederqvist committed
370 371 372 373 374
send "1079 78 9\n"
simple_expect "%1079 9 9"
send "1080 10 [holl "Temporary Sanctuary"] 1010\n"
simple_expect "=1080 9"
send "1081 78 9\n"
375
simple_expect "=1081 [holl "Temporary Sanctuary"] 10101000 0 77"
Per Cederqvist's avatar
Per Cederqvist committed
376 377

# test call 11 (delete-conf)
Per Cederqvist's avatar
Per Cederqvist committed
378 379 380 381
send "1082 11 9\n"
simple_expect "=1082"
send "1083 78 9\n"
simple_expect "%1083 9 9"
Per Cederqvist's avatar
Per Cederqvist committed
382 383

# test call 12 (lookup-name)
Per Cederqvist's avatar
Per Cederqvist committed
384 385 386 387 388 389
send "1084 12 [holl "p"]\n"
simple_expect "=1084 4 { 1 2 6 7 } { 0000 0000 1001 0000 }"
send "1085 12 [holl "p c"]\n"
simple_expect "=1085 1 { 6 } { 1001 }"
send "1086 12 [holl "xyzzy"]\n"
simple_expect "=1086 0 \\* \\*"
Per Cederqvist's avatar
Per Cederqvist committed
390 391

# test call 13 (get-conf-stat-older)
Per Cederqvist's avatar
Per Cederqvist committed
392 393 394 395
send "1087 13 3 0\n"
simple_expect "=1087 [holl ""] 0000 $any_time $any_time 0 0 0 0 0 0 77 0 1 0"
send "1088 13 3 1\n"
simple_expect "=1088 [holl "Lappar .p. drren"] 0000 $any_time $any_time 0 0 0 0 0 0 77 0 1 0"
Per Cederqvist's avatar
Per Cederqvist committed
396 397

# test call 14 (add-member-old)
Per Cederqvist's avatar
Per Cederqvist committed
398 399 400 401
send "1089 14 3 6 90 2\n"
simple_expect "=1089"
send "1090 13 3 1\n"
simple_expect "=1090 [holl "Lappar .p. drren"] 0000 $any_time $any_time 0 0 0 0 0 0 77 1 1 0"
Per Cederqvist's avatar
Per Cederqvist committed
402 403 404

# test call 15 (sub-member)
send "1091 15 3 6\n"
Per Cederqvist's avatar
Per Cederqvist committed
405 406 407 408
simple_expect ":1 8 3"
simple_expect "=1091"
send "1092 15 3 6\n"
simple_expect "%1092 13 3"
Per Cederqvist's avatar
Per Cederqvist committed
409 410

# test call 16 (set-presentation)
Per Cederqvist's avatar
Per Cederqvist committed
411 412
send "1093 16 7 3\n"
simple_expect "=1093"
Per Cederqvist's avatar
Per Cederqvist committed
413 414 415
# We check the result under call 50 below.

# test call 17 (set-etc-motd)
Per Cederqvist's avatar
Per Cederqvist committed
416 417
send "1094 17 7 2\n"
simple_expect "=1094"
Per Cederqvist's avatar
Per Cederqvist committed
418 419 420
# We check the result under call 50 below.

# test call 18 (set-supervisor)
Per Cederqvist's avatar
Per Cederqvist committed
421 422
send "1095 18 7 7\n"
simple_expect "=1095"
Per Cederqvist's avatar
Per Cederqvist committed
423 424 425
# We check the result under call 50 below.

# test call 19 (set-permitted-submitters)
Per Cederqvist's avatar
Per Cederqvist committed
426 427
send "1096 19 7 8\n"
simple_expect "=1096"
Per Cederqvist's avatar
Per Cederqvist committed
428 429 430
# We check the result under call 50 below.

# test call 20 (set-super-conf)
Per Cederqvist's avatar
Per Cederqvist committed
431 432
send "1097 20 7 4\n"
simple_expect "=1097"
Per Cederqvist's avatar
Per Cederqvist committed
433 434 435
# We check the result under call 50 below.

# test call 21 (set-conf-type)
Per Cederqvist's avatar
Per Cederqvist committed
436
send "1098 21 7 0100\n"
Per Cederqvist's avatar
Per Cederqvist committed
437
simple_expect "=1098"
Per Cederqvist's avatar
Per Cederqvist committed
438 439
send "1099 21 7 01001000\n"
simple_expect "=1099"
Per Cederqvist's avatar
Per Cederqvist committed
440 441 442
# We check the result under call 50 below.

# test call 22 (set-garb-nice)
Per Cederqvist's avatar
Per Cederqvist committed
443 444
send "1100 22 7 144\n"
simple_expect "=1100"
Per Cederqvist's avatar
Per Cederqvist committed
445 446 447
# We check the result under call 50 below.

# test call 23 (get-marks) and call 24 (mark-text-old)
Per Cederqvist's avatar
Per Cederqvist committed
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
send "1101 24 2 15\n"
simple_expect "=1101"
send "1102 23\n"
simple_expect "=1102 1 { 2 15 }"
send "1103 24 2 28\n"
simple_expect "=1103"
send "1104 23\n"
simple_expect "=1104 1 { 2 28 }"
send "1105 24 3 9\n"
simple_expect "=1105"
send "1106 23\n"
simple_expect "=1106 2 { 2 28 3 9 }"
send "1107 24 2 0\n"
simple_expect "=1107"
send "1108 23\n"
simple_expect "=1108 1 { 3 9 }"
send "1109 24 3 0\n"
simple_expect "=1109"
send "1110 23\n"
simple_expect "=1110 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
468 469 470

# call 25 is tested extensively in 02.exp

Per Cederqvist's avatar
Per Cederqvist committed
471 472 473 474 475 476 477 478 479 480
# This is approximately halfway between the call to user-active and
# the use where we want two seconds to have passed.  Wait for one tick.
send "1111 35\n"
extracting_expect "=1111 ($any_time)" user_active_1 1
while {"$user_active_1" == "$user_active_0"} {
    sleep 0.1
    send "999 35\n"
    extracting_expect "=999 ($any_time)" user_active_1 1
}

Per Cederqvist's avatar
Per Cederqvist committed
481
# test call 26 (get-text-stat-old)
Per Cederqvist's avatar
Per Cederqvist committed
482 483
send "1112 26 1\n"
simple_expect "=1112 $any_time 6 0 16 0 2 { 0 7 6 1 }"
Per Cederqvist's avatar
Per Cederqvist committed
484

Per Cederqvist's avatar
Per Cederqvist committed
485
# test call 27 (mark-as-read) and 40 (set-unread)
Per Cederqvist's avatar
Per Cederqvist committed
486
send "1113 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
487
simple_expect "=1113 $any_time 7 100 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
488 489 490

send "1114 27 7 1 { 2 }\n"
simple_expect "=1114"
Per Cederqvist's avatar
Per Cederqvist committed
491 492
send "1115 9 6 7\n"
simple_expect "=1115 $any_time 7 100 0 1 { 2 }"
Per Cederqvist's avatar
Per Cederqvist committed
493

Per Cederqvist's avatar
Per Cederqvist committed
494
send "1116 27 7 1 { 2 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
495
simple_expect "=1116"
Per Cederqvist's avatar
Per Cederqvist committed
496 497
send "1117 46 6 1 1 1\n"
simple_expect "=1117 1 { $any_time 7 100 0 1 { 2 } }"
Per Cederqvist's avatar
Per Cederqvist committed
498

Per Cederqvist's avatar
Per Cederqvist committed
499
send "1118 27 7 1 { 4 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
500 501
simple_expect "=1118"
send "1119 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
502
simple_expect "=1119 $any_time 7 100 0 2 { 2 4 }"
Per Cederqvist's avatar
Per Cederqvist committed
503

Per Cederqvist's avatar
Per Cederqvist committed
504
send "1120 27 7 1 { 5 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
505 506
simple_expect "=1120"
send "1121 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
507
simple_expect "=1121 $any_time 7 100 0 3 { 2 4 5 }"
Per Cederqvist's avatar
Per Cederqvist committed
508

Per Cederqvist's avatar
Per Cederqvist committed
509
send "1122 27 7 1 { 6 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
510 511
simple_expect "=1122"
send "1123 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
512
simple_expect "=1123 $any_time 7 100 0 4 { 2 4 5 6 }"
Per Cederqvist's avatar
Per Cederqvist committed
513

Per Cederqvist's avatar
Per Cederqvist committed
514 515
send "1124 27 7 1 { 1 }\n"
simple_expect "=1124"
Per Cederqvist's avatar
Per Cederqvist committed
516 517 518
send "1125 9 6 7\n"
simple_expect "=1125 $any_time 7 100 2 3 { 4 5 6 }"

Per Cederqvist's avatar
Per Cederqvist committed
519 520
send "1126 27 7 1 { 7 }\n"
simple_expect "%1126 16 0"
Per Cederqvist's avatar
Per Cederqvist committed
521
send "1127 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
522
simple_expect "=1127 $any_time 7 100 2 3 { 4 5 6 }"
Per Cederqvist's avatar
Per Cederqvist committed
523

Per Cederqvist's avatar
Per Cederqvist committed
524
send "1128 27 7 1 { 3 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
525 526
simple_expect "=1128"
send "1129 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
527
simple_expect "=1129 $any_time 7 100 6 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
528

Per Cederqvist's avatar
Per Cederqvist committed
529
send "1130 40 7 6\n"
Per Cederqvist's avatar
Per Cederqvist committed
530 531
simple_expect "=1130"
send "1131 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
532
simple_expect "=1131 $any_time 7 100 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
533

Per Cederqvist's avatar
Per Cederqvist committed
534
send "1132 27 7 6 { 1 2 3 4 5 6 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
535 536
simple_expect "=1132"
send "1133 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
537
simple_expect "=1133 $any_time 7 100 6 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
538

Per Cederqvist's avatar
Per Cederqvist committed
539
send "1134 40 7 6\n"
Per Cederqvist's avatar
Per Cederqvist committed
540 541
simple_expect "=1134"
send "1135 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
542
simple_expect "=1135 $any_time 7 100 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
543

Per Cederqvist's avatar
Per Cederqvist committed
544
send "1136 27 7 6 { 6 5 4 3 2 1 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
545 546
simple_expect "=1136"
send "1137 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
547
simple_expect "=1137 $any_time 7 100 6 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
548

Per Cederqvist's avatar
Per Cederqvist committed
549
send "1138 40 7 6\n"
Per Cederqvist's avatar
Per Cederqvist committed
550 551
simple_expect "=1138"
send "1139 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
552
simple_expect "=1139 $any_time 7 100 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
553

Per Cederqvist's avatar
Per Cederqvist committed
554
send "1140 27 7 6 { 1 3 5 2 4 6 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
555 556
simple_expect "=1140"
send "1141 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
557
simple_expect "=1141 $any_time 7 100 6 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
558

Per Cederqvist's avatar
Per Cederqvist committed
559
send "1142 40 7 6\n"
Per Cederqvist's avatar
Per Cederqvist committed
560 561
simple_expect "=1142"
send "1143 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
562
simple_expect "=1143 $any_time 7 100 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
563

Per Cederqvist's avatar
Per Cederqvist committed
564
send "1144 27 7 6 { 2 4 6 1 3 5 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
565 566
simple_expect "=1144"
send "1145 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
567
simple_expect "=1145 $any_time 7 100 6 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
568

Per Cederqvist's avatar
Per Cederqvist committed
569
send "1146 40 7 6\n"
Per Cederqvist's avatar
Per Cederqvist committed
570 571
simple_expect "=1146"
send "1147 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
572
simple_expect "=1147 $any_time 7 100 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
573 574 575 576 577 578

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 \\*"

Per Cederqvist's avatar
Per Cederqvist committed
579
send "1150 27 7 1 { 1 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
580 581
simple_expect "=1150"
send "1151 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
582
simple_expect "=1151 $any_time 7 100 1 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
583

Per Cederqvist's avatar
Per Cederqvist committed
584
send "1152 27 7 1 { 2 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
585 586
simple_expect "=1152"
send "1153 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
587
simple_expect "=1153 $any_time 7 100 2 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
588

Per Cederqvist's avatar
Per Cederqvist committed
589
send "1154 27 7 1 { 3 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
590 591
simple_expect "=1154"
send "1155 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
592
simple_expect "=1155 $any_time 7 100 3 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
593

Per Cederqvist's avatar
Per Cederqvist committed
594
send "1156 27 7 1 { 4 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
595 596
simple_expect "=1156"
send "1157 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
597
simple_expect "=1157 $any_time 7 100 4 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
598

Per Cederqvist's avatar
Per Cederqvist committed
599
send "1158 27 7 1 { 5 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
600 601
simple_expect "=1158"
send "1159 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
602
simple_expect "=1159 $any_time 7 100 5 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
603

Per Cederqvist's avatar
Per Cederqvist committed
604
send "1160 27 7 1 { 6 }\n"
Per Cederqvist's avatar
Per Cederqvist committed
605 606
simple_expect "=1160"
send "1161 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
607
simple_expect "=1161 $any_time 7 100 6 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
608

Per Cederqvist's avatar
Per Cederqvist committed
609
send "1162 40 7 5\n"
Per Cederqvist's avatar
Per Cederqvist committed
610 611
simple_expect "=1162"
send "1163 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
612
simple_expect "=1163 $any_time 7 100 1 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
613

Per Cederqvist's avatar
Per Cederqvist committed
614
send "1164 40 7 2\n"
Per Cederqvist's avatar
Per Cederqvist committed
615 616
simple_expect "=1164"
send "1165 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
617
simple_expect "=1165 $any_time 7 100 4 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
618

Per Cederqvist's avatar
Per Cederqvist committed
619
send "1166 40 7 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
620 621
simple_expect "=1166"
send "1167 9 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
622 623 624 625 626 627
simple_expect "=1167 $any_time 7 100 5 0 \\*"

send "1168 40 7 0\n"
simple_expect "=1168"
send "1169 9 6 7\n"
simple_expect "=1169 $any_time 7 100 6 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
628 629 630 631

# call 28 is tested above

# test call 29 (delete-text)
Per Cederqvist's avatar
Per Cederqvist committed
632 633 634 635 636
# (First, check that get_last_text gives a proper result before the
# text is deleted.)
send "1170 58 $time_3\n"
simple_expect "=1170 2"
send "1171 98 6 7\n"
Per Cederqvist's avatar
Per Cederqvist committed
637
simple_expect "=1171 $any_time 7 100 6 0 \\* 6 $any_time 00000000"
Per Cederqvist's avatar
Per Cederqvist committed
638
send "1172 29 2\n"
Per Cederqvist's avatar
Per Cederqvist committed
639
# No new'n'fancy async message here.
Per Cederqvist's avatar
Per Cederqvist committed
640
simple_expect "=1172"
Per Cederqvist's avatar
Per Cederqvist committed
641 642

talk_to client 1
Per Cederqvist's avatar
Per Cederqvist committed
643
# The text is marked since it is motd of conference 7.
Per Cederqvist's avatar
Per Cederqvist committed
644 645 646
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
647 648 649 650 651 652
# Test that mark-as-read of local text number 1 steps past local text
# 2 when it doesn't exist.
send "1173 40 7 6\n"
simple_expect "=1173"
send "1174 9 6 7\n"
simple_expect "=1174 $any_time 7 100 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
653

Per Cederqvist's avatar
Per Cederqvist committed
654 655 656 657
send "1175 27 7 1 { 1 }\n"
simple_expect "=1175"
send "1176 9 6 7\n"
simple_expect "=1176 $any_time 7 100 2 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
658 659

# test call 30 (add-recipient)
Per Cederqvist's avatar
Per Cederqvist committed
660 661 662
send "1177 30 3 2 0\n"
simple_expect "=1177"
send "1178 26 3\n"
Per Cederqvist's avatar
Per Cederqvist committed
663
# This is marked since text 3 is presentation of conf 7.
Per Cederqvist's avatar
Per Cederqvist committed
664
simple_expect "=1178 $any_time 6 0 16 1 5 { 0 7 6 3 0 2 6 1 9 $any_time }"
Per Cederqvist's avatar
Per Cederqvist committed
665 666

# test call 31 (sub-recipient)
Per Cederqvist's avatar
Per Cederqvist committed
667 668 669
send "1179 31 3 2\n"
simple_expect "=1179"
send "1180 26 3\n"
Per Cederqvist's avatar
Per Cederqvist committed
670
# This is marked since text 3 is presentation of conf 7.
Per Cederqvist's avatar
Per Cederqvist committed
671
simple_expect "=1180 $any_time 6 0 16 1 2 { 0 7 6 3 }"
Per Cederqvist's avatar
Per Cederqvist committed
672 673

# test call 32 (add-comment)
Per Cederqvist's avatar
Per Cederqvist committed
674
send "1181 32 3 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
675 676 677
simple_expect "=1181"
send "1182 26 3\n"
# This is marked since text 3 is presentation of conf 7.
Per Cederqvist's avatar
Per Cederqvist committed
678
simple_expect "=1182 $any_time 6 0 16 1 4 { 0 7 6 3 2 1 9 $any_time }"
Per Cederqvist's avatar
Per Cederqvist committed
679
send "1183 26 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
680 681 682 683 684 685 686 687 688 689
simple_expect "=1183 $any_time 6 0 16 0 3 { 0 7 6 1 3 3 }"

# test call 33 (sub-comment)
send "1184 33 3 1\n"
simple_expect "=1184"
send "1185 26 3\n"
# This is marked since text 3 is presentation of conf 7.
simple_expect "=1185 $any_time 6 0 16 1 2 { 0 7 6 3 }"
send "1186 26 1\n"
simple_expect "=1186 $any_time 6 0 16 0 2 { 0 7 6 1 }"
Per Cederqvist's avatar
Per Cederqvist committed
690 691

# test call 34 (get-map)
Per Cederqvist's avatar
Per Cederqvist committed
692 693
send "1187 34 7 1 50\n"
simple_expect "=1187 1 6 { 1 0 3 4 5 6 }"
Per Cederqvist's avatar
Per Cederqvist committed
694 695

# test call 35 (get-time)
Per Cederqvist's avatar
Per Cederqvist committed
696 697
send "1188 35\n"
simple_expect "=1188 $any_time"
Per Cederqvist's avatar
Per Cederqvist committed
698 699

# test call 36 (get-info-old)
Per Cederqvist's avatar
Per Cederqvist committed
700 701
send "1189 36\n"
simple_expect "=1189 $server_compat_version 1 2 3 4 0"
Per Cederqvist's avatar
Per Cederqvist committed
702 703

# test call 37 (add-footnote)
Per Cederqvist's avatar
Per Cederqvist committed
704
send "1190 37 3 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
705 706 707
simple_expect "=1190"
send "1191 26 3\n"
# This is marked since text 3 is presentation of conf 7.
Per Cederqvist's avatar
Per Cederqvist committed
708
simple_expect "=1191 $any_time 6 0 16 1 4 { 0 7 6 3 4 1 9 $any_time }"
Per Cederqvist's avatar
Per Cederqvist committed
709
send "1192 26 1\n"
Per Cederqvist's avatar
Per Cederqvist committed
710 711 712 713 714 715 716 717 718 719
simple_expect "=1192 $any_time 6 0 16 0 3 { 0 7 6 1 5 3 }"

# test call 38 (sub-footnote)
send "1193 38 3 1\n"
simple_expect "=1193"
send "1194 26 3\n"
# This is marked since text 3 is presentation of conf 7.
simple_expect "=1194 $any_time 6 0 16 1 2 { 0 7 6 3 }"
send "1195 26 1\n"
simple_expect "=1195 $any_time 6 0 16 0 2 { 0 7 6 1 }"
Per Cederqvist's avatar
Per Cederqvist committed
720 721

# test call 39 (who-is-on-old)
Per Cederqvist's avatar
Per Cederqvist committed
722 723
send "1196 39\n"
simple_expect "=1196 2 { 8 0 [holl "Accepting i-am-on"] 6 6 [holl "Running a test suite"] }"
Per Cederqvist's avatar
Per Cederqvist committed
724 725 726 727 728

# call 40 (set-unread) is tested above

# test call 41 (set-motd-of-lyskom)
talk_to client 2
Per Cederqvist's avatar
Per Cederqvist committed
729 730 731 732 733 734
send "1197 42 255\n"
simple_expect "=1197"
send "1198 41 7\n"
simple_expect "=1198"
send "1199 42 0\n"
simple_expect "=1199"
Per Cederqvist's avatar
Per Cederqvist committed
735

Per Cederqvist's avatar
Per Cederqvist committed
736 737
send "1200 36\n"
simple_expect "=1200 $server_compat_version 1 2 3 4 7"
Per Cederqvist's avatar
Per Cederqvist committed
738 739 740 741

# call 42 (enable) is tested above

# test call 43 (sync-kom)
Per Cederqvist's avatar
Per Cederqvist committed
742 743 744 745 746
send "1201 43\n"
simple_expect "%1201 12 0"
send "1202 42 255\n"
simple_expect "=1202"
send "1203 43\n"
Per Cederqvist's avatar
Per Cederqvist committed
747 748
simple_expect ":0 7"
simple_expect ":0 7"
Per Cederqvist's avatar
Per Cederqvist committed
749
simple_expect "=1203"
Per Cederqvist's avatar
Per Cederqvist committed
750 751 752 753 754 755 756
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
Per Cederqvist's avatar
Per Cederqvist committed
757 758
send "1204 42 0\n"
simple_expect "=1204"
Per Cederqvist's avatar
Per Cederqvist committed
759 760 761 762

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

# test call 45 (broadcast)
Per Cederqvist's avatar
Per Cederqvist committed
763
send "1205 45 [holl "a broadcast message"]\n"
Per Cederqvist's avatar
Per Cederqvist committed
764
simple_expect ":3 12 0 5 [holl "a broadcast message"]"
Per Cederqvist's avatar
Per Cederqvist committed
765
simple_expect "=1205"
Per Cederqvist's avatar
Per Cederqvist committed
766 767 768 769 770
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"]"

Per Cederqvist's avatar
Per Cederqvist committed
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786
# test call 46 (get-membership-old)
send "1206 46 6 0 100 1\n"
simple_expect "=1206 2 { $any_time 6 255 0 0 \\* $any_time 7 100 2 0 \\* }"

# test call 47 (get-created-texts)
send "1207 47 6 1 100\n"
simple_expect "=1207 1 3 { 1 0 3 }"

# test call 48 (get-members-old)
send "1208 48 7 0 100\n"
simple_expect "=1208 2 { 6 8 }"

# test call 49 (get-person-stat)
send "1209 49 6\n"
simple_expect "=1209 [holl "ceder@gratia.unknown.@localhost"] 0000010000000000 00000000 $any_time 0 0 1 0 48 0 0 0 2 1 3 0 2"

Per Cederqvist's avatar
Per Cederqvist committed
787
# test call 50 (get-conf-stat-old)
Per Cederqvist's avatar
Per Cederqvist committed
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051
send "1210 50 7\n"
simple_expect "=1210 [holl "PRIMa musik"] 0100 $any_time $any_time 6 3 7 8 4 2 144 2 1 6"
# test call 51 (who-is-on)
send "1211 51\n"
simple_expect "=1211 2 { 8 0 2 [holl "Accepting i-am-on"] [holl "ic@gratia@localhost"] 6 6 1 [holl "Running a test suite"] [holl "ceder@gratia@localhost"] }"

# test call 52 (get-unread-confs)
send "1212 52 6\n"
simple_expect "=1212 2 { 6 7 }"

# test call 53 (send-message)
send "1213 53 8 [holl "hullo eight"]\n"
simple_expect "=1213"
talk_to client 1
simple_expect ":3 12 8 6 [holl "hullo eight"]"
talk_to client 0
send "1214 53 7 [holl "seven"]\n"
simple_expect ":3 12 7 6 [holl "seven"]"
simple_expect "=1214"
talk_to client 1
simple_expect ":3 12 7 6 [holl "seven"]"
talk_to client 0
send "1215 53 0 [holl "all"]\n"
simple_expect ":3 12 0 6 [holl "all"]"
simple_expect "=1215"
talk_to client 1
simple_expect ":3 12 0 6 [holl "all"]"
talk_to client 2
simple_expect ":3 12 0 6 [holl "all"]"
talk_to client 0

# test call 54 (get-session-info)
send "1216 54 2\n"
simple_expect "=1216 8 0 2 [holl "Accepting i-am-on"] [holl "ic@gratia@localhost"] $any_num $any_time"

# test call 55 (disconnect)
talk_to client 2
send "1217 55 3\n"
simple_expect "=1217"
client_death 2

# test call 56 (who-am-i)
talk_to client 0
send "1218 56\n"
simple_expect "=1218 1"

# test call 57 (set-user-area)
send "1219 57 6 3\n"
simple_expect "=1219"
send "1220 49 6\n"
simple_expect "=1220 [holl "ceder@gratia.unknown.@localhost"] 0000010000000000 00000000 $any_time 3 0 1 0 48 0 0 0 2 1 3 0 2"

# test call 58 (get-last-text)
send "1221 58 0 0 0 1 0 98 0 0 0\n"
simple_expect "=1221 0"

send "1222 35\n"
extracting_expect "=1222 ($any_time)" post_7 1
while {"$post_7" == "$time_7"} {
    sleep 0.1
    send "999 35\n"
    extracting_expect "=999 ($any_time)" post_7 1
}

send "1223 58 $time_1\n"
simple_expect "=1223 0"
send "1224 58 $time_2\n"
simple_expect "=1224 1"
send "1225 58 $time_3\n"
simple_expect "=1225 1"
send "1226 58 $post_7\n"
simple_expect "=1226 7"

# test call 59 (create-anonymous-text-old)
send "1227 59 [holl "Anon text 8"] 1 { 0 2 }\n"
simple_expect "=1227 8"
# check that the number of created texts/bytes does not increase
send "1228 49 6\n"
simple_expect "=1228 [holl "ceder@gratia.unknown.@localhost"] 0000010000000000 00000000 $any_time 3 0 1 0 48 0 0 0 2 1 3 0 2"

# test call 60 (find-next-text-no)
send "1229 60 0\n"
simple_expect "=1229 1"
send "1230 60 1\n"
simple_expect "=1230 3"
send "1231 60 2\n"
simple_expect "=1231 3"
send "1232 60 3\n"
simple_expect "=1232 4"
send "1233 60 4\n"
simple_expect "=1233 5"
send "1234 60 5\n"
simple_expect "=1234 6"
send "1235 60 6\n"
simple_expect "=1235 7"
send "1236 60 7\n"
simple_expect "=1236 8"
send "1237 60 8\n"
simple_expect "%1237 14 8"

# test call 61 (find-previous-text-no)
send "1238 61 0\n"
simple_expect "%1238 14 0"
send "1239 61 1\n"
simple_expect "%1239 14 1"
send "1240 61 2\n"
simple_expect "=1240 1"
send "1241 61 3\n"
simple_expect "=1241 1"
send "1242 61 4\n"
simple_expect "=1242 3"
send "1243 61 5\n"
simple_expect "=1243 4"
send "1244 61 6\n"
simple_expect "=1244 5"
send "1245 61 7\n"
simple_expect "=1245 6"
send "1246 61 8\n"
simple_expect "=1246 7"
send "1247 61 9\n"
simple_expect "=1247 8"
send "1248 61 10\n"
simple_expect "=1248 8"
send "1249 61 1000\n"
simple_expect "=1249 8"

# call 62 is tested above

# test call 63 (who-is-on-ident)
send "1250 63\n"
simple_expect "=1250 2 { 8 0 2 [holl "Accepting i-am-on"] [holl "ic@gratia"] [holl "localhost"] [holl "unknown"] 6 6 1 [holl "Running a test suite"] [holl "ceder@gratia"] [holl "localhost"] [holl "unknown"] }"

# test call 64 (get-session-info-ident)
send "1251 64 2\n"
simple_expect "=1251 8 0 2 [holl "Accepting i-am-on"] [holl "ic@gratia"] [holl "localhost"] [holl "unknown"] $any_num $any_time"

# test call 65 (re-lookup-person)
send "1252 65 [holl "nya"]\n"
simple_expect "=1252 0 \\*"
send "1253 65 [holl "el*y"]\n"
simple_expect "=1253 1 { 8 }"

# test call 66 (re-lookup-conf)
send "1254 66 [holl "nya"]\n"
simple_expect "=1254 2 { 1 2 }"

# test call 67 (lookup-person)
send "1255 67 [holl "k t"]\n"
simple_expect "=1255 1 { 8 }"

# test call 68 (lookup-conf)
send "1256 68 [holl "p m"]\n"
simple_expect "=1256 3 { 1 2 7 }"

# test call 69 (set-client-version)
talk_to client 1
send "1257 69 [holl "i changed my mind"] [holl "99.9"]\n"
simple_expect "%1257 41 0"
talk_to client 0

# test call 70 (get-client-name)
send "1258 70 2\n"
simple_expect "=1258 [holl "dgt03"]"

# test call 71 (get-client-version)
send "1259 71 2\n"
simple_expect "=1259 [holl "sc 1"]"

# test call 72 (mark-text)
send "1260 72 1 92\n"
simple_expect "=1260"
send "1261 72 3 0\n"
simple_expect "=1261"
send "1262 72 4 91\n"
simple_expect "=1262"
send "1263 72 4 98\n"
simple_expect "=1263"
send "1264 23\n"
simple_expect "=1264 3 { 1 92 3 0 4 98 }"

# test call 73 (unmark-text)
send "1265 73 4\n"
simple_expect "=1265"
send "1266 73 1\n"
simple_expect "=1266"
send "1267 23\n"
simple_expect "=1267 1 { 3 0 }"
send "1268 73 1\n"
simple_expect "%1268 44 1"
send "1269 23\n"
simple_expect "=1269 1 { 3 0 }"
send "1270 73 3\n"
simple_expect "=1270"
send "1271 23\n"
simple_expect "=1271 0 \\*"

# test call 74 (re-z-lookup)
send "1272 74 [holl "P.*r"] 1 1\n"
simple_expect "=1272 3 { [holl "Presentation .av nya. mten"] 0000 1 [holl "Presentation .av nya. medlemmar"] 0000 2 [holl "Per Cederqvist"] 1001 6 }"
send "1273 74 [holl "P.*r"] 0 1\n"
simple_expect "=1273 2 { [holl "Presentation .av nya. mten"] 0000 1 [holl "Presentation .av nya. medlemmar"] 0000 2 }"
send "1274 74 [holl "P.*r"] 1 0\n"
simple_expect "=1274 1 { [holl "Per Cederqvist"] 1001 6 }"
# This is a meaningless combination, so test it.
send "1275 74 [holl "P.*r"] 0 0\n"
simple_expect "=1275 0 \\*"

# test call 75 (get-version-info)
send "1276 75\n"
simple_expect "=1276 $protocol_a_level [holl "$server_software"] [holl "$server_version"]"

# test call 76 (lookup-z-name)
send "1277 76 [holl "P r"] 1 1\n"
simple_expect "=1277 0 \\*"
send "1278 76 [holl "P"] 1 1\n"
simple_expect "=1278 4 { [holl "Presentation .av nya. mten"] 0000 1 [holl "Presentation .av nya. medlemmar"] 0000 2 [holl "Per Cederqvist"] 1001 6 [holl "PRIMa musik"] 0100 7 }"
send "1279 76 [holl "P"] 0 1\n"
simple_expect "=1279 3 { [holl "Presentation .av nya. mten"] 0000 1 [holl "Presentation .av nya. medlemmar"] 0000 2 [holl "PRIMa musik"] 0100 7 }"
send "1280 76 [holl "P"] 1 0\n"
simple_expect "=1280 1 { [holl "Per Cederqvist"] 1001 6 }"
send "1281 76 [holl "P"] 0 0\n"
simple_expect "=1281 0 \\*"

# test call 77 (set-last-read)
send "1282 77 7 0\n"
simple_expect "=1282"
send "1283 9 6 7\n"
simple_expect "=1283 $any_time 7 100 0 0 \\*"

send "1284 77 7 1\n"
simple_expect "=1284"
send "1285 9 6 7\n"
# It would be proper for the implementation to return "2 0 \\*"
# instead of "1 0 \\*" since text 2 no longer exists.
simple_expect "=1285 $any_time 7 100 1 0 \\*"

# Local text number 2 no longer exists
send "1286 77 7 2\n"
simple_expect "=1286"
send "1287 9 6 7\n"
simple_expect "=1287 $any_time 7 100 2 0 \\*"

send "1288 77 7 4\n"
simple_expect "=1288"
send "1289 9 6 7\n"
simple_expect "=1289 $any_time 7 100 4 0 \\*"

send "1290 77 7 5\n"
simple_expect "=1290"
send "1291 9 6 7\n"
simple_expect "=1291 $any_time 7 100 5 0 \\*"

send "1292 77 7 6\n"
simple_expect "=1292"
send "1293 9 6 7\n"
simple_expect "=1293 $any_time 7 100 6 0 \\*"

# Check what happens when we try to set last-text-read to a local text
# number that doesn't yet exist.
send "1294 77 7 7\n"
simple_expect "=1294"
send "1295 9 6 7\n"
simple_expect "=1295 $any_time 7 100 6 0 \\*"

Per Cederqvist's avatar
Per Cederqvist committed
1052
# test call 78 (get-uconf-stat)
Per Cederqvist's avatar
Per Cederqvist committed
1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084
send "1296 78 7\n"
simple_expect "=1296 [holl "PRIMa musik"] 01001000 6 144"

# test call 79 (set-info)
client_start 2
send "A3Hfoo\n"
simple_expect "LysKOM"
send "1297 62 5 [holl "bar"] 1\n"
simple_expect "=1297"
send "1298 42 255\n"
simple_expect "=1298"
send "1299 79 32 7 1 2 8 3\n"
simple_expect "=1299"
send "1300 94\n"
simple_expect "=1300 $server_compat_version 7 1 2 8 3 0 \\*"
send "1301 36\n"
simple_expect "=1301 $server_compat_version 7 1 2 8 3"
send "1302 79 $server_compat_version 1 2 3 4 0\n"
simple_expect "=1302"
send "1303 94\n"
simple_expect "=1303 $server_compat_version 1 2 3 4 0 0 \\*"
send "1304 36\n"
simple_expect "=1304 $server_compat_version 1 2 3 4 0"
send "1305 79 $server_compat_version 4 3 2 1 2\n"
simple_expect "%1305 14 2"
send "1306 36\n"
simple_expect "=1306 $server_compat_version 1 2 3 4 0"
send "1307 79 $server_compat_version 1 2 3 9 0\n"
simple_expect "%1307 9 9"
send "1308 36\n"
simple_expect "=1308 $server_compat_version 1 2 3 4 0"
talk_to client 1
Per Cederqvist's avatar
Per Cederqvist committed
1085

1086 1087
# call 80 is tested during startup of client 1.
# call 81 is tested during startup of client 1.
Per Cederqvist's avatar
Per Cederqvist committed
1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133

# test call 82 (user-active) and call 83 (who-is-on-dynamic)
# Wait for the second tick.
send "1309 35\n"
extracting_expect "=1309 ($any_time)" user_active_2 1
while {"$user_active_2" == "$user_active_1"} {
    sleep 0.1
    send "999 35\n"
    extracting_expect "=999 ($any_time)" user_active_2 1
}
send "1310 83 1 1 0\n"
simple_expect "=1310 3 { 4 5 0 $any_num 10000000 [holl ""] 2 8 0 $any_num 01000000 [holl "Accepting i-am-on"] 1 6 6 $any_num 00000000 [holl "Running a test suite"] }"
send "1311 83 1 1 2\n"
simple_expect "=1311 2 { 4 5 0 $any_num 10000000 [holl ""] 1 6 6 $any_num 00000000 [holl "Running a test suite"] }"
send "1312 83 1 0 2\n"
simple_expect "=1312 1 { 1 6 6 $any_num 00000000 [holl "Running a test suite"] }"
send "1313 83 0 1 2\n"
simple_expect "=1313 1 { 4 5 0 $any_num 10000000 [holl ""] }"
send "1314 83 0 0 2\n"
simple_expect "=1314 0 \\*"
send "1315 83 0 0 0\n"
simple_expect "=1315 0 \\*"

send "1316 82\n"
simple_expect "=1316"
send "1317 83 1 1 2\n"
simple_expect "=1317 3 { 4 5 0 $any_num 10000000 [holl ""] 2 8 0 $any_num 01000000 [holl "Accepting i-am-on"] 1 6 6 $any_num 00000000 [holl "Running a test suite"] }"

send "1318 83 1 1 2\n"
simple_expect "=1318 3 { 4 5 0 $any_num 10000000 [holl ""] 2 8 0 $any_num 01000000 [holl "Accepting i-am-on"] 1 6 6 $any_num 00000000 [holl "Running a test suite"] }"

send "1319 83 1 0 2\n"
simple_expect "=1319 2 { 2 8 0 $any_num 01000000 [holl "Accepting i-am-on"] 1 6 6 $any_num 00000000 [holl "Running a test suite"] }"

# test call 84 (get-static-session-info)
send "1320 84 2\n"
simple_expect "=1320 [holl "ic@gratia"] [holl "localhost"] [holl "unknown"] $any_time"

# test call 85 (get-collate-table)
send "1321 85\n"
unanchored_expect "^MRK:client1: =1321 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"

Per Cederqvist's avatar
Per Cederqvist committed
1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179
# test call 86 (create-text)
send "1322 86 [holl "aux-style text 9"] 2 { 0 7 6 7 } 1 { 1 11111111 7 [holl "text/plain"] }\n"
extracting_expect ":16 0 9 ($any_time) 8 0 16 0 2 { 0 7 6 7 }" time_9 1
# The last three bits in aux-flags had no defined meaning when this
# test was written.
simple_expect ":18 15 9 $time_9 8 0 16 0 2 { 0 7 6 7 } 1 { 1 1 8 $time_9 00000111 1 [holl "text/plain"] }"
simple_expect "=1322 9"

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

# test call 87 (create-anonymous-text)
send "1323 87 [holl "aux-style anon 10"] 2 { 0 7 6 7 } 1 { 1 11111111 7 [holl "text/plain"] }\n"
extracting_expect ":16 0 10 ($any_time) 0 0 17 0 2 { 0 7 6 8 }" time_10 1
# The last three bits in aux-flags had no defined meaning when this
# test was written.
simple_expect ":18 15 10 $time_10 0 0 17 0 2 { 0 7 6 8 } 1 { 1 1 0 $time_10 00000111 1 [holl "text/plain"] }"
simple_expect "=1323 10"

talk_to client 0
simple_expect ":16 0 10 $time_10 0 0 17 0 2 { 0 7 6 8 }"
talk_to client 1

# test call 88 (create-conf)
send "1324 88 [holl "aux in general"] 0100 1 { 14 00000000 1 [holl "10"] }\n"
simple_expect "=1324 10"
send "1325 88 [holl "aux non anon"] 01000000 1 { 14 00000000 1 [holl "10"] }\n"
simple_expect "=1325 11"

# test call 89 (create-person)
send "1326 89 [holl "aux person"] [holl "secret"] 1 { 12 00000000 1 [holl "public"] }\n"
simple_expect "=1326 12"

# test call 90 (get-text-stat)
send "1327 90 10\n"
# Text 10 should have two marks since it is the FAQ of conferences 10 and 11.
extracting_expect "=1327 $time_10 0 0 17 (0|2) 2 { 0 7 6 8 } 1 { 1 1 0 $time_10 00000111 1 [holl "text/plain"] }" n_marks 1

setup_xfail "*"
if {$n_marks == 2} {
    pass "correct number of marks on text 10"
} else {
    fail "correct number of marks on text 10"
}

Per Cederqvist's avatar
Per Cederqvist committed
1180 1181
# test call 91 (get-conf-stat)
send "1328 91 10\n"
1182
extracting_expect "=1328 [holl "aux in general"] 01001000 ($any_time) $any_time 8 0 8 0 8 0 77 0 1 0 0 1 { 1 14 8 $any_time 00000000 1 [holl "10"] }" time_c_10 1
Per Cederqvist's avatar
Per Cederqvist committed
1183
send "1329 91 10\n"
1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225
simple_expect "=1329 [holl "aux in general"] 01001000 $time_c_10 $time_c_10 8 0 8 0 8 0 77 0 1 0 0 1 { 1 14 8 $time_c_10 00000000 1 [holl "10"] }"

# test call 92 (modify-text-info)

# Add a short notice.
send "1330 92 3 0 { } 1 { 2 00000000 1 [holl "Du har fel"] }\n"
simple_expect "=1330"
send "1331 90 3\n"
# This text is marked twice: user area of person 6, presentation for 7.
simple_expect "=1331 $time_3 6 0 16 2 2 { 0 7 6 3 } 1 { 1 2 8 $any_time 00000000 1 [holl "Du har fel"] }"

# Remove it.
# FIXME: should we really be allowed to see the value?
send "1332 92 3 1 { 1 } 0 { }\n"
simple_expect "=1332"
send "1333 90 3\n"
# This text is marked twice: user area of person 6, presentation for 7.
simple_expect "=1333 $time_3 6 0 16 2 2 { 0 7 6 3 } 1 { 1 2 8 $any_time 10000000 1 [holl "Du har fel"] }"

# Add a couple of more comments
send "1334 92 3 0 { } 2 { 2 00000000 1 [holl "Du har massor fel"] 2 00000000 1 [holl "Du har felast av alla"] }\n"
simple_expect "=1334"
send "1335 90 3\n"
# This text is marked twice: user area of person 6, presentation for 7.
simple_expect "=1335 $time_3 6 0 16 2 2 { 0 7 6 3 } 3 { 1 2 8 $any_time 10000000 1 [holl "Du har fel"] 2 2 8 $any_time 00000000 1 [holl "Du har massor fel"] 3 2 8 $any_time 00000000 1 [holl "Du har felast av alla"] }"

# test call 93 (modify-conf-info)
send "1336 91 8\n"
# FIXME: should 8:redirect be inheritable?
# FIXME: should 10:alternate-name be inheritable?
extracting_expect "=1336 [holl "Kelly Talisman"] 10011000 ($any_time) $any_time 8 0 8 0 0 0 77 1 1 2 0 7 { 1 3 8 $any_time 00000000 1 [holl "C6 My Creator"] 2 3 8 $any_time 00000000 1 [holl "C7 Slightly offensive name, huh"] 3 8 8 $any_time 00000000 0 [holl "E-mail:kelly@hotbox.com"] 4 9 8 $any_time 00000000 1 [holl "compface must die"] 5 10 8 $any_time 00000000 0 [holl "Air"] 6 12 8 $any_time 00000000 1 [holl "PGP public key"] 7 13 8 $any_time 00000000 1 [holl "kelly@hotbox.com"] }" time_c_8 1
send "1337 91 8\n"
simple_expect "=1337 [holl "Kelly Talisman"] 10011000 $time_c_8 $time_7 8 0 8 0 0 0 77 1 1 2 0 7 { 1 3 8 $time_c_8 00000000 1 [holl "C6 My Creator"] 2 3 8 $time_c_8 00000000 1 [holl "C7 Slightly offensive name, huh"] 3 8 8 $time_c_8 00000000 0 [holl "E-mail:kelly@hotbox.com"] 4 9 8 $time_c_8 00000000 1 [holl "compface must die"] 5 10 8 $time_c_8 00000000 0 [holl "Air"] 6 12 8 $time_c_8 00000000 1 [holl "PGP public key"] 7 13 8 $time_c_8 00000000 1 [holl "kelly@hotbox.com"] }"

send "1338 93 8 2 { 7 1 } 1 { 13 00000000 1 [holl "kelly@lysator.liu.se"] }\n"
simple_expect "=1338"
send "1339 91 8\n"
simple_expect "=1339 [holl "Kelly Talisman"] 10011000 $time_c_8 $time_7 8 0 8 0 0 0 77 1 1 2 0 8 { 1 3 8 $time_c_8 10000000 1 [holl "C6 My Creator"] 2 3 8 $time_c_8 00000000 1 [holl "C7 Slightly offensive name, huh"] 3 8 8 $time_c_8 00000000 0 [holl "E-mail:kelly@hotbox.com"] 4 9 8 $time_c_8 00000000 1 [holl "compface must die"] 5 10 8 $time_c_8 00000000 0 [holl "Air"] 6 12 8 $time_c_8 00000000 1 [holl "PGP public key"] 7 13 8 $time_c_8 10000000 1 [holl "kelly@hotbox.com"] 8 13 8 $any_time 00000000 1 [holl "kelly@lysator.liu.se"] }"

# test call 94 (get-info)
send "1340 94\n"
simple_expect "=1340 $server_compat_version 1 2 3 4 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
1226

Per Cederqvist's avatar
Per Cederqvist committed
1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267
# test call 95 (modify-system-info)
talk_to client 2
send "1341 95 0 { } 2 { 9 00000000 1 [holl "compface must die"] 13 00000000 1 [holl "maint@kom"] }\n"
simple_expect "=1341"
# Attempt to set a nonexisting text as faq for the server.
# FIXME: this should fail, since there is no way we can ensure that
# the text is marked when text 999 is finally created.  If this item
# is later removed an inconsistency may appear.
send "1342 95 0 { } 1 { 14 00000000 1 [holl "999"] }\n"
simple_expect "=1342"
setup_xfail "*"
fail "was able to set nonexisting text as faq"

send "1343 94\n"
simple_expect "=1343 $server_compat_version 1 2 3 4 0 3 { 1 9 5 $any_time 00000000 1 [holl "compface must die"] 2 13 5 $any_time 00000000 1 [holl "maint@kom"] 3 14 5 $any_time 00000000 1 [holl "999"] }"

send "1344 95 1 { 2 } 0 { }\n"
simple_expect "=1344"

send "1345 94\n"
# This test assumes that the deleted bit is set, but the item is still
# visible.
simple_expect "=1345 $server_compat_version 1 2 3 4 0 3 { 1 9 5 $any_time 00000000 1 [holl "compface must die"] 2 13 5 $any_time 10000000 1 [holl "maint@kom"] 3 14 5 $any_time 00000000 1 [holl "999"] }"
setup_xfail "*"
fail "the deleted bit is used on a global aux-item"

# test call 96 (query-predefined-aux-items)
talk_to client 1
send "1346 96\n"
simple_expect "=1346 15 { 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 }"

# test call 97 (set-expire)
send "1347 97 10 7123123\n"
simple_expect "=1347"
send "1348 91 10\n"
simple_expect "=1348 [holl "aux in general"] 01001000 $time_c_10 $time_c_10 8 0 8 0 8 0 77 0 1 0 7123123 1 { 1 14 8 $time_c_10 00000000 1 [holl "10"] }"

# test call 98 (query-read-texts)
send "1349 98 6 7\n"
simple_expect "=1349 $any_time 7 100 6 0 \\* 6 $any_time 00000000"

1268 1269 1270 1271 1272 1273 1274 1275
# 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
1276 1277
send "1350 105\n"
simple_expect "%1350 2 0"
1278 1279

# There is no call 106--yet.
Per Cederqvist's avatar
Per Cederqvist committed
1280 1281
send "1351 106\n"
simple_expect "%1351 2 0"
1282 1283

# There is no call 107--yet.
Per Cederqvist's avatar
Per Cederqvist committed
1284 1285
send "1352 107\n"
simple_expect "%1352 2 0"
1286 1287

# There is no call 108--yet.
Per Cederqvist's avatar
Per Cederqvist committed
1288 1289
send "1353 108\n"
simple_expect "%1353 2 0"
1290 1291

# There is no call 109--yet.
Per Cederqvist's avatar
Per Cederqvist committed
1292 1293
send "1354 109\n"
simple_expect "%1354 2 0"
1294 1295

# There is no call 110--yet.
Per Cederqvist's avatar
Per Cederqvist committed
1296 1297
send "1355 110\n"
simple_expect "%1355 2 0"
Per Cederqvist's avatar
Per Cederqvist committed
1298 1299 1300

# Disconnect all but the first session
talk_to client 2
Per Cederqvist's avatar
Per Cederqvist committed
1301 1302
send "1356 55 4\n"
simple_expect "=1356"
Per Cederqvist's avatar
Per Cederqvist committed
1303
client_death 2
1304

1305
talk_to client 1
Per Cederqvist's avatar
Per Cederqvist committed
1306 1307
send "1357 55 2\n"
simple_expect "=1357"
1308 1309
simple_expect ":2 13 8 2"
client_death 1
1310 1311 1312

# Shut everything down
talk_to client 0
1313
simple_expect ":2 13 8 2"
1314

Per Cederqvist's avatar
Per Cederqvist committed
1315
send "1358 62 5 [holl "bar"] 0\n"
1316 1317
simple_expect ":2 13 6 1"
simple_expect ":2 9 5 1"
Per Cederqvist's avatar
Per Cederqvist committed
1318
simple_expect "=1358"
Per Cederqvist's avatar
Per Cederqvist committed
1319

Per Cederqvist's avatar
Per Cederqvist committed
1320 1321 1322
send "1359 42 255\n"
simple_expect "=1359" "42=enable succeeded"
send "1360 43\n"
Per Cederqvist's avatar
Per Cederqvist committed
1323 1324
simple_expect ":0 7"
simple_expect ":0 7"
Per Cederqvist's avatar
Per Cederqvist committed
1325
simple_expect "=1360"
Per Cederqvist's avatar
Per Cederqvist committed
1326
talk_to client 0
1327

Per Cederqvist's avatar
Per Cederqvist committed
1328 1329
send "1361 44 0\n"
simple_expect "=1361" "44=shutdown-kom succeeded"
1330 1331 1332