summaryrefslogtreecommitdiffstats
path: root/tests/vty/vty_test.ok
blob: 0b5ac9c0b969a9e2a50ebcc073f3e4a73ddf4d39 (plain)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
Going to test vty_cmd_string_from_valstr()
Tested with %s-strings, resulting cmd = '[prefix%s%s%s%s%s][foo%s%s%s%s%s][sep%s%s%s%s%s][bar%s%s%s%s%s][end%s%s%s%s%s]'
Going to test VTY node tree structure
Going to execute 'enable'
Returned: 0, Current node: 3 '%s# '
Going to execute 'configure terminal'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'exit'
Returned: 0, Current node: 3 '%s# '
Going to execute 'configure terminal'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'end'
Returned: 0, Current node: 3 '%s# '
Going to execute 'configure terminal'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'log stderr'
Returned: 0, Current node: 7 '%s(config-log)# '
Going to execute 'exit'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'log stderr'
Returned: 0, Current node: 7 '%s(config-log)# '
Going to execute 'end'
Returned: 0, Current node: 3 '%s# '
Going to execute 'configure terminal'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'line vty'
Returned: 0, Current node: 9 '%s(config-line)# '
Going to execute 'exit'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'line vty'
Returned: 0, Current node: 9 '%s(config-line)# '
Going to execute 'end'
Returned: 0, Current node: 3 '%s# '
Going to execute 'configure terminal'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'log stderr'
Returned: 0, Current node: 7 '%s(config-log)# '
Going to execute 'line vty'
Returned: 2, Current node: 7 '%s(config-log)# '
Going to execute 'end'
Returned: 0, Current node: 3 '%s# '
Going to execute 'exit'
Returned: 0, Current node: 3 '%s# '
Going to test VTY configuration of the stats subsystem
Going to execute 'enable'
Returned: 0, Current node: 3 '%s# '
Going to execute 'configure terminal'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'stats reporter foobar'
Returned: 2, Current node: 4 '%s(config)# '
Going to execute 'stats interval 42'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'stats reporter log'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'prefix myprefix'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'no prefix'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'level peer'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'level subscriber'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'level global'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'level foobar'
Returned: 2, Current node: 8 '%s(config-stats)# '
Going to execute 'enable'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'disable'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'exit'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'stats reporter statsd'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'prefix myprefix'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'no prefix'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'level peer'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'level subscriber'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'level global'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'level foobar'
Returned: 2, Current node: 8 '%s(config-stats)# '
Going to execute 'remote-ip 127.0.0.99'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'remote-ip 678.0.0.99'
Returned: 1, Current node: 8 '%s(config-stats)# '
Going to execute 'remote-port 12321'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'local-ip 127.0.0.98'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'no local-ip'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'mtu 987'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'no mtu'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'enable'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'disable'
Returned: 0, Current node: 8 '%s(config-stats)# '
Going to execute 'exit'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'no stats reporter log'
Returned: 0, Current node: 4 '%s(config)# '
Going to execute 'no stats reporter statsd'
Returned: 0, Current node: 4 '%s(config)# '
reading file ok.cfg, expecting rc=0
called level1 node a
called level1 child cmd a
called level2 node a
called level2 child cmd a
called level3 node a
called level3 child cmd a
called level1 node b
called level1 child cmd b
called level2 node b
called level2 child cmd b
called level1 node c
called level1 child cmd c
called level2 node c
called level2 child cmd c
called level3 node c
called level3 child cmd c
called level2 node d
called level2 child cmd d
called level1 node e
called level1 child cmd e
called level2 node e
called level2 child cmd e
called level2 node f
called level2 child cmd f
called level1 node g
called level1 child cmd g
called level1 node h
called level1 child cmd h
got rc=0
reading file ok_more_spaces.cfg, expecting rc=0
called level1 node a
called level1 child cmd a
called level2 node a
called level2 child cmd a
called level3 node a
called level3 child cmd a
called level1 node b
called level1 child cmd b
called level2 node b
called level2 child cmd b
called level1 node c
called level1 child cmd c
called level2 node c
called level2 child cmd c
called level3 node c
called level3 child cmd c
called level2 node d
called level2 child cmd d
called level1 node e
called level1 child cmd e
called level2 node e
called level2 child cmd e
called level2 node f
called level2 child cmd f
called level1 node g
called level1 child cmd g
called level1 node h
called level1 child cmd h
got rc=0
reading file ok_tabs.cfg, expecting rc=0
called level1 node a
called level1 child cmd a
called level2 node a
called level2 child cmd a
called level3 node a
called level3 child cmd a
called level1 node b
called level1 child cmd b
called level2 node b
called level2 child cmd b
called level1 node c
called level1 child cmd c
called level2 node c
called level2 child cmd c
called level3 node c
called level3 child cmd c
called level2 node d
called level2 child cmd d
called level1 node e
called level1 child cmd e
called level2 node e
called level2 child cmd e
called level2 node f
called level2 child cmd f
called level1 node g
called level1 child cmd g
called level1 node h
called level1 child cmd h
got rc=0
reading file ok_tabs_and_spaces.cfg, expecting rc=0
called level1 node a
called level1 child cmd a
called level2 node a
called level2 child cmd a
called level3 node a
called level3 child cmd a
called level1 node b
called level1 child cmd b
called level2 node b
called level2 child cmd b
called level1 node c
called level1 child cmd c
called level2 node c
called level2 child cmd c
called level3 node c
called level3 child cmd c
called level2 node d
called level2 child cmd d
called level1 node e
called level1 child cmd e
called level2 node e
called level2 child cmd e
called level2 node f
called level2 child cmd f
called level1 node g
called level1 child cmd g
called level1 node h
called level1 child cmd h
got rc=0
reading file ok_ignore_comment.cfg, expecting rc=0
called level1 node 
called level1 child cmd 
called level2 node 
called level2 child cmd 
called level1 node 
got rc=0
reading file ok_ignore_blank.cfg, expecting rc=0
called level1 node 
called level2 node 
called level2 child cmd 
called level3 node 
called level3 child cmd 
called level1 node 
got rc=0
reading file fail_not_de-indented.cfg, expecting rc=-22
called level1 node a
called level1 child cmd a
got rc=-22
reading file fail_too_much_indent.cfg, expecting rc=-22
called level1 node a
called level1 child cmd a
got rc=-22
reading file fail_tabs_and_spaces.cfg, expecting rc=-22
called level1 node a
called level1 child cmd a
got rc=-22
reading file ok_indented_root.cfg, expecting rc=0
called level1 node a
called level1 child cmd 
called level2 node 
called level2 child cmd 
called level1 node b
got rc=0
reading file ok_empty_parent.cfg, expecting rc=0
called level1 node a
called level2 node a
called level3 node a
called level1 node b
called level2 node b
called level1 node c
called level1 node d
called level2 node e
called level2 node f
called level3 node f
called level3 node g
called level2 node g
called level2 node h
called level1 node h
called level1 node i
called level1 node j
called level2 node j
called level1 child cmd j
called level1 node k
called level2 node k
called level3 node k
called level1 child cmd k
got rc=0
reading file fail_cmd_ret_warning.cfg, expecting rc=-22
Called: 'return-success'
Called: 'return-warning'
got rc=-22
Going to test is_cmd_ambiguous()
Going to execute 'ambiguous_nr'
Called: 'ambiguous_nr [<0-23>]' (argc=0)
Returned: 0, Current node: 1 '%s> '
Going to execute 'ambiguous_nr 23'
Called: 'ambiguous_nr [<0-23>]' (argc=1)
Returned: 0, Current node: 1 '%s> '
Going to execute 'ambiguous_nr 23 keyword'
Called: 'ambiguous_nr <0-23> keyword'
Returned: 0, Current node: 1 '%s> '
Going to execute 'ambiguous_str'
Called: 'ambiguous_str [ARG]' (argc=0)
Returned: 0, Current node: 1 '%s> '
Going to execute 'ambiguous_str arg'
Called: 'ambiguous_str [ARG]' (argc=1)
Returned: 0, Current node: 1 '%s> '
Going to execute 'ambiguous_str arg keyword'
Called: 'ambiguous_str ARG keyword'
Returned: 0, Current node: 1 '%s> '
All tests passed