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

3
4
5
6
7
set f [open "../version.incl"]
gets $f
gets $f server_compat_version
close $f

Per Cederqvist's avatar
Per Cederqvist committed
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
lyskomd_start

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

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

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

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

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

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

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

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

# 0:login-old may succeed
# 1:logout always succeeds
send "1006 1\n"
simple_expect "=1006"
# 2:change-conference
send "1007 2 4\n"
simple_expect "%1007 6 0"
# 3:change-name
send "1008 3 1 [holl "new name"]\n"
simple_expect "%1008 6 0"
# 4:change-what-i-am-doing
send "1009 4 [holl "testing lyskomd"]\n"
simple_expect "=1009"
# 5:create-person-old
send "1010 5 [holl "new person"] [holl "mypasswd"]\n"
simple_expect "=1010 6"
send "1011 1\n"
simple_expect "=1011"
# 6:get-person-stat-old
send "1012 6 6 1\n"
simple_expect "%1012 6 0"
# 7:set-priv-bits
send "1013 7 6 0000000000000000\n"
simple_expect "%1013 6 0"
# 8:set-passwd
send "1014 8 5 [holl "old"] [holl "new"]\n"
simple_expect "%1014 6 0"
# 9:query-read-texts-old
send "1015 9 6 6\n"
simple_expect "=1015 $any_time 6 255 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# 10:create-conf-old
send "1016 10 [holl "no way"] 0000\n"
simple_expect "%1016 6 0"
# 11:delete-conf
send "1017 11 1\n"
simple_expect "%1017 6 0"
# 12:lookup-name
send "1018 12 [holl "pres"]\n"
simple_expect "=1018 2 { 1 2 } { 0000 0000 }"
send "1019 12 [holl "xyzzy does not exist"]\n"
simple_expect "=1019 0 \\* \\*"
# 13:get-conf-stat-older
send "1020 13 1 0\n"
simple_expect "=1020 0H 0000 $any_time $any_time 0 0 0 0 0 0 77 0 1 0"
send "1021 13 1 1\n"
simple_expect "=1021 [holl "Presentation .av nya. mten"] 0000 $any_time $any_time 0 0 0 0 0 0 77 0 1 0"
Per Cederqvist's avatar
Per Cederqvist committed
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
129
130
131
132
133
134
135
136
137
138
# 14:add-member-old
send "1022 14 4 5 255 1\n"
simple_expect "%1022 6 0"
# 15:sub-member
send "1023 15 4 5\n"
simple_expect "%1023 6 0"
# 16:set-presentation
send "1024 16 4 1\n"
simple_expect "%1024 6 0"
# 17:set-etc-motd
send "1025 17 4 1\n"
simple_expect "%1025 6 0"
# 18:set-supervisor
send "1026 18 4 1\n"
simple_expect "%1026 6 0"
# 19:set-permitted-submitters
send "1027 19 4 1\n"
simple_expect "%1027 6 0"
# 20:set-super-conf
send "1028 20 4 1\n"
simple_expect "%1028 6 0"
# 21:set-conf-type
send "1029 21 4 0000\n"
simple_expect "%1029 6 0"
send "1030 21 4 00000000\n"
simple_expect "%1030 6 0"
# 22:set-garb-nice
send "1031 22 4 17\n"
simple_expect "%1031 6 0"
# 23:get-marks
send "1032 23\n"
simple_expect "%1032 6 0"
# 24:mark-text-old
send "1033 24 1 243\n"
simple_expect "%1033 6 0"
# 25:get-text
send "1034 25 1 0 999\n"
simple_expect "%1034 14 1"
# 26:get-text-stat-old
send "1035 26 1\n"
simple_expect "%1035 14 1"
# 27:mark-as-read
send "1036 27 3 1 { 1 }\n"
simple_expect "%1036 6 0"
# 28:create-text-old
send "1037 28 [holl "A sample text"] 1 { 0 2 }\n"
simple_expect "%1037 6 0"
# 29:delete-text
send "1038 29 1\n"
simple_expect "%1038 6 0"
# 30:add-recipient
send "1039 30 1 4 0\n"
simple_expect "%1039 6 0"
# 31:sub-recipient
send "1040 31 1 4\n"
simple_expect "%1040 6 0"
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# 32:add-comment
send "1041 32 2 1\n"
simple_expect "%1041 6 0"
# 33:sub-comment
send "1042 33 2 1\n"
simple_expect "%1042 6 0"
# 34:get-map
send "1043 34 1 0 99\n"
simple_expect "%1043 6 0"
# 35:get-time
send "1044 35\n"
simple_expect "=1044 $any_time"
# 36:get-info-old
send "1045 36\n"
simple_expect "=1045 $server_compat_version 1 2 3 4 0"
# 37:add-footnote
send "1046 37 1 2\n"
simple_expect "%1046 6 0"
# 38:sub-footnote
send "1047 38 1 2\n"
simple_expect "%1047 6 0"
# 39:who-is-on-old
send "1048 39\n"
simple_expect "=1048 0 \\*"
# 40:set-unread
send "1049 40 1 3\n"
simple_expect "%1049 6 0"
# 41:set-motd-of-lyskom
send "1050 41 1\n"
simple_expect "%1050 6 0"
Per Cederqvist's avatar
Per Cederqvist committed
169
170

# Log in
171
172
send "1051 62 5 [holl "gazonk"] 0\n"
simple_expect "=1051"
Per Cederqvist's avatar
Per Cederqvist committed
173

174
175
send "1052 9 5 5\n"
simple_expect "=1052 $any_time 5 255 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
176

177
178
send "1053 27 5 0 { }\n"
simple_expect "=1053"
Per Cederqvist's avatar
Per Cederqvist committed
179

180
181
send "1054 9 5 5\n"
simple_expect "=1054 $any_time 5 255 0 0 \\*"
Per Cederqvist's avatar
Per Cederqvist committed
182

183
184
185
186
send "1055 6 6 1\n"
simple_expect "=1055 [holl "DejaGnu test suite.unknown.@localhost"] 0000010000000000 00000000 $any_time 0 0 1 0 0 0 0 0 0 1 0 0 1"
send "1056 6 6 0\n"
simple_expect "=1056 0H 0000010000000000 00000000 $any_time 0 0 1 0 0 0 0 0 0 1 0 0 1"
Per Cederqvist's avatar
Per Cederqvist committed
187
188
189

talk_to client 0

190
191
192
193
send "1057 42 255\n"
simple_expect "=1057" "42=enable succeeded"
send "1058 44 0\n"
simple_expect "=1058" "44=shutdown-kom succeeded"
Per Cederqvist's avatar
Per Cederqvist committed
194
195
client_death 0
lyskomd_death