HC Test: update persistence suite
[csit.git] / resources / libraries / robot / honeycomb / persistence.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Library | resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords
16 | ...     | WITH NAME | InterfaceAPI
17 | Library | resources/libraries/python/honeycomb/HcPersistence.py
18 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
19 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
20 | Resource | resources/libraries/robot/honeycomb/vxlan.robot
21 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
22 | Resource | resources/libraries/robot/honeycomb/tap.robot
23 | Resource | resources/libraries/robot/honeycomb/vhost_user.robot
24 | Resource | resources/libraries/robot/honeycomb/sub_interface.robot
25 | Variables | resources/test_data/honeycomb/persistence.py | ${interface}
26 | Documentation | Keywords used to test Honeycomb persistence.
27
28 *** Keywords ***
29 | Honeycomb is restarted
30 | | [Documentation] | Restarts Honeycomb without clearing persistence data.
31 | | ...
32 | | ... | *Arguments:*
33 | | ... | - node - information about a DUT node. Type: dictionary
34 | | ...
35 | | ... | *Example:*
36 | | ...
37 | | ... | \| Honeycomb is restarted \| ${nodes['DUT1']} \|
38 | | ...
39 | | [Arguments] | ${node}
40 | | Stop Honeycomb service on DUTs | ${node}
41 | | Log Persisted Configuration | ${node}
42 | | Setup Honeycomb service on DUTs | ${node}
43
44 | VPP is restarted
45 | | [Documentation] | Restarts VPP and waits until it reconnects with Honeycomb.
46 | | ...
47 | | ... | *Arguments:*
48 | | ... | - node - information about a DUT node. Type: dictionary
49 | | ...
50 | | ... | *Example:*
51 | | ...
52 | | ... | \| VPP is restarted \| ${nodes['DUT1']} \|
53 | | ...
54 | | [Arguments] | ${node}
55 | | Setup DUT | ${node}
56 | | Check VPP connection | ${node}
57
58 | Check VPP connection
59 | | [Documentation] | Checks if Honeycomb is connected to VPP by reading VPP\
60 | | ... | version number from Honeycomb operational data.
61 | | ...
62 | | ... | *Arguments:*
63 | | ... | - node - information about a DUT node. Type: dictionary
64 | | ...
65 | | ... | *Example:*
66 | | ...
67 | | ... | \| Check VPP connection \| ${nodes['DUT1']} \|
68 | | ...
69 | | [Arguments] | ${node}
70 | | Wait until keyword succeeds | 2min | 20sec
71 | | ... | Check Honeycomb startup state | ${node}
72
73 | Honeycomb and VPP are restarted
74 | | [Documentation] | Stops Honeycomb, restarts VPP and then starts Honeycomb\
75 | | ... | again.
76 | | ...
77 | | ... | *Arguments:*
78 | | ... | - node - information about a DUT node. Type: dictionary
79 | | ...
80 | | ... | *Example:*
81 | | ...
82 | | ... | \| Honeycomb and VPP are restarted \| ${nodes['DUT1']} \|
83 | | ...
84 | | [Arguments] | ${node}
85 | | Stop Honeycomb service on DUTs | ${node}
86 | | Log Persisted Configuration | ${node}
87 | | Setup DUT | ${node}
88 | | Setup Honeycomb service on DUTs | ${node}
89
90 | Honeycomb configures every setting
91 | | [Documentation] | Uses Honeycomb to set basic settings for VxLAN,\
92 | | ... | bridge domains, TAP, vhost-user and VLAN.
93 | | ...
94 | | ... | *Arguments:*
95 | | ... | - node - information about a DUT node. Type: dictionary
96 | | ... | - interface - name of an interface on the specified node. Type: string
97 | | ...
98 | | ... | *Example:*
99 | | ...
100 | | ... | \| Honeycomb configures every setting \| ${nodes['DUT1']} \
101 | | ... | \| GigabitEthernet0/8/0 \|
102 | | ...
103 | | [Arguments] | ${node} | ${interface}
104 | | Honeycomb sets interface VxLAN configuration
105 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
106 | | Honeycomb creates first l2 bridge domain
107 | | ... | ${node} | ${bd_name} | ${bd_settings}
108 | | Honeycomb creates TAP interface
109 | | ... | ${node} | ${tap_interface} | ${tap_settings}
110 | | Honeycomb creates vhost-user interface
111 | | ... | ${node} | ${vhost_interface} | ${vhost_user_client}
112 | | Honeycomb creates sub-interface | ${node} | ${interface}
113 | | ... | ${sub_if_1_match} | ${sub_if_1_tags} | ${sub_if_1_settings}
114 | | Honeycomb sets interface state | ${node} | ${interface} | up
115 | | Honeycomb sets the sub-interface up
116 | | ... | ${node} | ${interface} | ${sub_if_id}
117 | | Honeycomb adds sub-interface to bridge domain
118 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_bd_settings}
119 | | Honeycomb configures tag rewrite
120 | | ... | ${node} | ${interface} | ${sub_if_id} | ${tag_rewrite_pop_1}
121
122 | Honeycomb and VPP should verify every setting
123 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
124 | | ... | bridge domains, TAP, vhost-user and VLAN.
125 | | ...
126 | | ... | *Arguments:*
127 | | ... | - node - information about a DUT node. Type: dictionary
128 | | ... | - interface - name of an interface on the specified node. Type: string
129 | | ...
130 | | ... | *Example:*
131 | | ...
132 | | ... | \| Honeycomb and VPP should verify every setting \| ${nodes['DUT1']} \
133 | | ... | \| GigabitEthernet0/8/0 \|
134 | | ...
135 | | [Arguments] | ${node} | ${interface}
136 | | VxLAN configuration from Honeycomb should be
137 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
138 | | VxLAN configuration from VAT should be
139 | | ... | ${node} | ${vxlan_settings}
140 | | Bridge domain configuration from Honeycomb should be
141 | | ... | ${node} | ${bd_name} | ${bd_settings}
142 | | Bridge domain configuration from VAT should be
143 | | ... | ${node} | ${0} | ${bd_settings}
144 | | TAP configuration from Honeycomb should be
145 | | ... | ${node} | ${tap_interface} | ${tap_settings}
146 | | TAP configuration from VAT should be
147 | | ... | ${node} | ${tap_interface} | ${tap_settings}
148 | | Vhost-user configuration from Honeycomb should be
149 | | ... | ${node} | ${vhost_interface} | ${vhost_user_client}
150 | | Vhost-user configuration from VAT should be
151 | | ... | ${node} | ${vhost_user_client}
152 | | Sub-interface configuration from Honeycomb should be
153 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_if_1_oper}
154 | | Sub-interface configuration from VAT should be
155 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
156 | | Interface state from Honeycomb should be | ${node} | ${interface} | up
157 | | Interface state from VAT should be | ${node} | ${interface} | up
158 | | Sub-interface bridge domain configuration from Honeycomb should be
159 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_bd_settings}
160 | | Sub-interface bridge domain configuration from VAT should be
161 | | ... | ${node} | ${sub_if_name} | ${sub_bd_settings}
162 | | Rewrite tag from Honeycomb should be
163 | | ... | ${node} | ${interface} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
164 | | Rewrite tag from VAT should be
165 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT}
166
167 | Honeycomb and VPP should have default configuration
168 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
169 | | ... | bridge domains, TAP, vhost-user and VLAN. Expects default\
170 | | ... | configuration.
171 | | ...
172 | | ... | *Arguments:*
173 | | ... | - node - information about a DUT node. Type: dictionary
174 | | ...
175 | | ... | *Example:*
176 | | ...
177 | | ... | \| Honeycomb and VPP should have default configuration \|
178 | | ... | ${nodes['DUT1']} \|
179 | | ...
180 | | [Arguments] | ${node}
181 | | VxLAN configuration from Honeycomb should be empty
182 | | ... | ${node} | ${vx_interface}
183 | | VxLAN configuration from VAT should be empty | ${node}
184 | | Honeycomb should show no bridge domains | ${node}
185 | | VAT should show no bridge domains | ${node}
186 | | TAP configuration from Honeycomb should be empty
187 | | ... | ${node} | ${tap_interface}
188 | | TAP configuration from VAT should be empty
189 | | ... | ${node} | ${tap_interface}
190 | | Vhost-user configuration from Honeycomb should be empty
191 | | ... | ${node} | ${vhost_interface}
192 | | Vhost-user configuration from VAT should be empty
193 | | ... | ${node}
194 | | interface state from Honeycomb should be
195 | | ... | ${node} | ${interface} | down
196 | | And interface state from VAT should be
197 | | ... | ${node} | ${interface} | down
198
199 | Honeycomb and VPP should not have default configuration
200 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
201 | | ... | bridge domains, TAP, vhost-user and VLAN. Expects any\
202 | | ... | configuration other than default.
203 | | ...
204 | | ... | *Arguments:*
205 | | ... | - node - information about a DUT node. Type: dictionary
206 | | ...
207 | | ... | *Example:*
208 | | ...
209 | | ... | \| Honeycomb and VPP should not have default configuration \
210 | | ... | \| ${nodes['DUT1']} \|
211 | | ...
212 | | [Arguments] | ${node}
213 | | Run keyword and expect error | *
214 | | ... | Honeycomb and VPP should have default configuration | ${node}
215
216 | Honeycomb should show no rogue interfaces
217 | | [Documentation] | Checks if operational data contains interfaces not\
218 | | ... | present in configuration and vice versa.
219 | | ...
220 | | ... | *Arguments:*
221 | | ... | - node - information about a DUT node. Type: dictionary
222 | | ...
223 | | ... | *Example:*
224 | | ...
225 | | ... | \| Honeycomb should show no rogue interfaces \| ${nodes['DUT1']} \|
226 | | ...
227 | | [Arguments] | ${node}
228 | | ${data_conf}= | InterfaceAPI.Get all interfaces cfg data | ${node}
229 | | ${data_oper}= | InterfaceAPI.Get all interfaces oper data | ${node}
230 | | Compare interface lists | ${data_conf} | ${data_oper}
231
232 | Persistence file is damaged during restart
233 | | [Documentation] | Shuts down Honeycomb, modifies persistence files to\
234 | | ... | simulate damage, then restarts VPP and starts up Honeycomb again.
235 | | ...
236 | | ... | *Arguments:*
237 | | ... | - node - information about a DUT node. Type: dictionary
238 | | ...
239 | | ... | *Example:*
240 | | ...
241 | | ... | \| Persistence file is damaged during restart \| ${nodes['DUT1']} \|
242 | | ...
243 | | [Arguments] | ${node}
244 | | Stop Honeycomb service on DUTs | ${node}
245 | | Modify persistence files | ${node} | { | abc
246 | | Setup DUT | ${node}
247 | | Setup Honeycomb service on DUTs | ${node}
248
249 | Log persisted configuration on node
250 | | [Documentation] | Logs the content of Honeycomb's persitence files.
251 | | ...
252 | | ... | *Arguments:*
253 | | ... | - node - information about a DUT node. Type: dictionary
254 | | ...
255 | | ... | *Example:*
256 | | ...
257 | | ... | \| Log persisted configuration on node \| ${nodes['DUT1']} \|
258 | | ...
259 | | [Arguments] | ${node}
260 | | Log persisted configuration | ${node}