blob: b2df1a119ffb10ba7f3f588580515d26c0795154 [file] [log] [blame]
Jacob Erlbeckae15a2c2013-08-06 14:29:14 +02001Going to test vty_cmd_string_from_valstr()
Jacob Erlbeckcd195fa2013-08-06 14:29:15 +02002Tested 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]'
Jacob Erlbeck0c987bd2013-09-06 16:52:00 +02003Going to test VTY node tree structure
4Going to execute 'enable'
5Returned: 0, Current node: 3 '%s# '
6Going to execute 'configure terminal'
7Returned: 0, Current node: 4 '%s(config)# '
8Going to execute 'exit'
9Returned: 0, Current node: 3 '%s# '
10Going to execute 'configure terminal'
11Returned: 0, Current node: 4 '%s(config)# '
12Going to execute 'end'
13Returned: 0, Current node: 3 '%s# '
14Going to execute 'configure terminal'
15Returned: 0, Current node: 4 '%s(config)# '
16Going to execute 'log stderr'
17Returned: 0, Current node: 7 '%s(config-log)# '
18Going to execute 'exit'
19Returned: 0, Current node: 4 '%s(config)# '
20Going to execute 'log stderr'
21Returned: 0, Current node: 7 '%s(config-log)# '
22Going to execute 'end'
23Returned: 0, Current node: 3 '%s# '
24Going to execute 'configure terminal'
25Returned: 0, Current node: 4 '%s(config)# '
26Going to execute 'line vty'
Jacob Erlbeckadc900e2015-10-20 19:05:52 +020027Returned: 0, Current node: 9 '%s(config-line)# '
Jacob Erlbeck0c987bd2013-09-06 16:52:00 +020028Going to execute 'exit'
29Returned: 0, Current node: 4 '%s(config)# '
30Going to execute 'line vty'
Jacob Erlbeckadc900e2015-10-20 19:05:52 +020031Returned: 0, Current node: 9 '%s(config-line)# '
Jacob Erlbeck0c987bd2013-09-06 16:52:00 +020032Going to execute 'end'
33Returned: 0, Current node: 3 '%s# '
34Going to execute 'configure terminal'
35Returned: 0, Current node: 4 '%s(config)# '
36Going to execute 'log stderr'
37Returned: 0, Current node: 7 '%s(config-log)# '
38Going to execute 'line vty'
Neels Hofmeyrd64b6ae2017-09-07 04:52:05 +020039Returned: 2, Current node: 7 '%s(config-log)# '
Jacob Erlbeck0c987bd2013-09-06 16:52:00 +020040Going to execute 'end'
41Returned: 0, Current node: 3 '%s# '
42Going to execute 'exit'
43Returned: 0, Current node: 3 '%s# '
Jacob Erlbeckbe37fb72015-11-03 15:21:34 +010044Going to test VTY configuration of the stats subsystem
45Going to execute 'enable'
46Returned: 0, Current node: 3 '%s# '
47Going to execute 'configure terminal'
48Returned: 0, Current node: 4 '%s(config)# '
49Going to execute 'stats reporter foobar'
50Returned: 2, Current node: 4 '%s(config)# '
51Going to execute 'stats interval 42'
52Returned: 0, Current node: 4 '%s(config)# '
53Going to execute 'stats reporter log'
54Returned: 0, Current node: 8 '%s(config-stats)# '
55Going to execute 'prefix myprefix'
56Returned: 0, Current node: 8 '%s(config-stats)# '
57Going to execute 'no prefix'
58Returned: 0, Current node: 8 '%s(config-stats)# '
59Going to execute 'level peer'
60Returned: 0, Current node: 8 '%s(config-stats)# '
61Going to execute 'level subscriber'
62Returned: 0, Current node: 8 '%s(config-stats)# '
63Going to execute 'level global'
64Returned: 0, Current node: 8 '%s(config-stats)# '
65Going to execute 'level foobar'
66Returned: 2, Current node: 8 '%s(config-stats)# '
67Going to execute 'enable'
68Returned: 0, Current node: 8 '%s(config-stats)# '
69Going to execute 'disable'
70Returned: 0, Current node: 8 '%s(config-stats)# '
71Going to execute 'exit'
72Returned: 0, Current node: 4 '%s(config)# '
73Going to execute 'stats reporter statsd'
74Returned: 0, Current node: 8 '%s(config-stats)# '
75Going to execute 'prefix myprefix'
76Returned: 0, Current node: 8 '%s(config-stats)# '
77Going to execute 'no prefix'
78Returned: 0, Current node: 8 '%s(config-stats)# '
79Going to execute 'level peer'
80Returned: 0, Current node: 8 '%s(config-stats)# '
81Going to execute 'level subscriber'
82Returned: 0, Current node: 8 '%s(config-stats)# '
83Going to execute 'level global'
84Returned: 0, Current node: 8 '%s(config-stats)# '
85Going to execute 'level foobar'
86Returned: 2, Current node: 8 '%s(config-stats)# '
87Going to execute 'remote-ip 127.0.0.99'
88Returned: 0, Current node: 8 '%s(config-stats)# '
89Going to execute 'remote-ip 678.0.0.99'
90Returned: 1, Current node: 8 '%s(config-stats)# '
91Going to execute 'remote-port 12321'
92Returned: 0, Current node: 8 '%s(config-stats)# '
93Going to execute 'local-ip 127.0.0.98'
94Returned: 0, Current node: 8 '%s(config-stats)# '
95Going to execute 'no local-ip'
96Returned: 0, Current node: 8 '%s(config-stats)# '
97Going to execute 'mtu 987'
98Returned: 0, Current node: 8 '%s(config-stats)# '
99Going to execute 'no mtu'
100Returned: 0, Current node: 8 '%s(config-stats)# '
101Going to execute 'enable'
102Returned: 0, Current node: 8 '%s(config-stats)# '
103Going to execute 'disable'
104Returned: 0, Current node: 8 '%s(config-stats)# '
105Going to execute 'exit'
106Returned: 0, Current node: 4 '%s(config)# '
107Going to execute 'no stats reporter log'
108Returned: 0, Current node: 4 '%s(config)# '
109Going to execute 'no stats reporter statsd'
110Returned: 0, Current node: 4 '%s(config)# '
Neels Hofmeyr4a31ffa2017-09-07 03:08:06 +0200111reading file ok.cfg, expecting rc=0
112got rc=0
113reading file ok_more_spaces.cfg, expecting rc=0
114got rc=0
115reading file ok_tabs.cfg, expecting rc=0
116got rc=0
117reading file ok_tabs_and_spaces.cfg, expecting rc=0
118got rc=0
119reading file ok_ignore_comment.cfg, expecting rc=0
120got rc=0
121reading file ok_ignore_blank.cfg, expecting rc=0
122got rc=0
123reading file fail_not_de-indented.cfg, expecting rc=-22
124got rc=-22
125reading file fail_too_much_indent.cfg, expecting rc=-22
126got rc=-22
127reading file fail_tabs_and_spaces.cfg, expecting rc=-22
128got rc=-22
129reading file ok_indented_root.cfg, expecting rc=0
130got rc=0
Jacob Erlbeckae15a2c2013-08-06 14:29:14 +0200131All tests passed