17bacd17b1340700e192593e631c9aa2f37f8375
[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 | Library | resources.libraries.python.honeycomb.HcPersistence
17 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
18 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
19 | Resource | resources/libraries/robot/honeycomb/vxlan.robot
20 | Resource | resources/libraries/robot/honeycomb/bridge_domain.robot
21 | Resource | resources/libraries/robot/honeycomb/tap.robot
22 | Resource | resources/libraries/robot/honeycomb/vhost_user.robot
23 | Resource | resources/libraries/robot/honeycomb/sub_interface.robot
24 | Variables | resources/test_data/honeycomb/persistence.py | ${interface}
25 | Documentation | Keywords used to test Honeycomb persistence.
26
27 *** Keywords ***
28 | Restart Honeycomb
29 | | [Documentation] | Restarts Honeycomb without clearing persistence data.
30 | | ...
31 | | ... | *Arguments:*
32 | | ... | - node - information about a DUT node. Type: dictionary
33 | | ...
34 | | ... | *Example:*
35 | | ...
36 | | ... | \| Restart Honeycomb \| ${nodes['DUT1']} \|
37 | | ...
38 | | [Arguments] | ${node}
39 | | Stop Honeycomb service on DUTs | ${node}
40 | | Log Persisted Configuration | ${node}
41 | | Configure Honeycomb service on DUTs | ${node}
42
43 | Restart VPP
44 | | [Documentation] | Restarts VPP and waits until it reconnects with Honeycomb.
45 | | ...
46 | | ... | *Arguments:*
47 | | ... | - node - information about a DUT node. Type: dictionary
48 | | ...
49 | | ... | *Example:*
50 | | ...
51 | | ... | \| Restart VPP \| ${nodes['DUT1']} \|
52 | | ...
53 | | [Arguments] | ${node}
54 | | Setup DUT | ${node}
55 | | Check VPP connection | ${node}
56
57 | Check VPP connection
58 | | [Documentation] | Checks if Honeycomb is connected to VPP by reading VPP\
59 | | ... | version number from Honeycomb operational data.
60 | | ...
61 | | ... | *Arguments:*
62 | | ... | - node - information about a DUT node. Type: dictionary
63 | | ...
64 | | ... | *Example:*
65 | | ...
66 | | ... | \| Check VPP connection \| ${nodes['DUT1']} \|
67 | | ...
68 | | [Arguments] | ${node}
69 | | Wait until keyword succeeds | 2min | 20sec
70 | | ... | Check Honeycomb startup state | ${node}
71
72 | Restart Honeycomb and VPP in pesistence test
73 | | [Documentation] | Stops Honeycomb, restarts VPP and then starts Honeycomb\
74 | | ... | again.
75 | | ...
76 | | ... | *Arguments:*
77 | | ... | - node - information about a DUT node. Type: dictionary
78 | | ...
79 | | ... | *Example:*
80 | | ...
81 | | ... | \| Restart Honeycomb and VPP \| ${nodes['DUT1']} \|
82 | | ...
83 | | [Arguments] | ${node}
84 | | Stop Honeycomb service on DUTs | ${node}
85 | | Log Persisted Configuration | ${node}
86 | | Setup DUT | ${node}
87 | | Configure Honeycomb service on DUTs | ${node}
88
89 | Multi-Feature Persistence Test Configuration
90 | | [Documentation] | Uses Honeycomb to set basic settings for VxLAN,\
91 | | ... | bridge domains, TAP, vhost-user and VLAN.
92 | | ...
93 | | ... | *Arguments:*
94 | | ... | - node - information about a DUT node. Type: dictionary
95 | | ... | - interface - name of an interface on the specified node. Type: string
96 | | ...
97 | | ... | *Example:*
98 | | ...
99 | | ... | \| Multi-Feature Persistence Test Configuration \| ${nodes['DUT1']} \
100 | | ... | \| GigabitEthernet0/8/0 \|
101 | | ...
102 | | [Arguments] | ${node} | ${interface}
103 | | Honeycomb sets interface VxLAN configuration
104 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
105 | | Honeycomb creates first l2 bridge domain
106 | | ... | ${node} | ${bd_name} | ${bd_settings}
107 | | Honeycomb creates TAP interface
108 | | ... | ${node} | ${tap_interface} | ${tap_settings}
109 | | Honeycomb creates vhost-user interface
110 | | ... | ${node} | ${vhost_interface} | ${vhost_user_client}
111 | | Honeycomb creates sub-interface | ${node} | ${interface}
112 | | ... | ${sub_if_1_match} | ${sub_if_1_tags} | ${sub_if_1_settings}
113 | | Honeycomb configures interface state | ${node} | ${interface} | up
114 | | Honeycomb sets the sub-interface up
115 | | ... | ${node} | ${interface} | ${sub_if_id}
116 | | Honeycomb adds sub-interface to bridge domain
117 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_bd_settings}
118 | | Honeycomb configures tag rewrite
119 | | ... | ${node} | ${interface} | ${sub_if_id} | ${tag_rewrite_pop_1}
120
121 | Multi-Feature persistence Test Verification
122 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
123 | | ... | bridge domains, TAP, vhost-user and VLAN.
124 | | ...
125 | | ... | *Arguments:*
126 | | ... | - node - information about a DUT node. Type: dictionary
127 | | ... | - interface - name of an interface on the specified node. Type: string
128 | | ...
129 | | ... | *Example:*
130 | | ...
131 | | ... | \| Multi-Feature persistence Test Verification \| ${nodes['DUT1']} \
132 | | ... | \| GigabitEthernet0/8/0 \|
133 | | ...
134 | | [Arguments] | ${node} | ${interface}
135 | | VxLAN Operational Data From Honeycomb Should Be
136 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
137 | | VxLAN Operational Data From VAT Should Be
138 | | ... | ${node} | ${vxlan_settings}
139 | | Bridge domain Operational Data From Honeycomb Should Be
140 | | ... | ${node} | ${bd_name} | ${bd_settings}
141 | | Bridge domain Operational Data From VAT Should Be
142 | | ... | ${node} | ${0} | ${bd_settings}
143 | | TAP Operational Data From Honeycomb Should Be
144 | | ... | ${node} | ${tap_interface} | ${tap_settings}
145 | | TAP Operational Data From VAT Should Be
146 | | ... | ${node} | ${tap_interface} | ${tap_settings}
147 | | Vhost-user Operational Data From Honeycomb Should Be
148 | | ... | ${node} | ${vhost_interface} | ${vhost_user_client}
149 | | Vhost-user Operational Data From VAT Should Be
150 | | ... | ${node} | ${vhost_user_client}
151 | | Sub-interface Operational Data From Honeycomb Should Be
152 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_if_1_oper}
153 | | Sub-interface Operational Data From VAT Should Be
154 | | ... | ${node} | ${sub_if_name} | ${sub_if_1_oper}
155 | | Interface state from Honeycomb should be | ${node} | ${interface} | up
156 | | Interface state from VAT should be | ${node} | ${interface} | up
157 | | Sub-interface bridge domain Operational Data From Honeycomb Should Be
158 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_bd_settings}
159 | | Sub-interface bridge domain Operational Data From VAT Should Be
160 | | ... | ${node} | ${sub_if_name} | ${sub_bd_settings}
161 | | Rewrite tag from Honeycomb should be
162 | | ... | ${node} | ${interface} | ${sub_if_id} | ${tag_rewrite_pop_1_oper}
163 | | Rewrite tag from VAT should be
164 | | ... | ${node} | ${sub_if_name} | ${tag_rewrite_pop_1_VAT}
165 | | ${data_conf}= | Get all interfaces cfg data | ${node}
166 | | ${data_oper}= | Get all interfaces oper data | ${node}
167 | | Compare interface lists | ${data_conf} | ${data_oper}
168
169 | Honeycomb and VPP should have default configuration
170 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
171 | | ... | bridge domains, TAP, vhost-user and VLAN. Expects default\
172 | | ... | configuration.
173 | | ...
174 | | ... | *Arguments:*
175 | | ... | - node - information about a DUT node. Type: dictionary
176 | | ...
177 | | ... | *Example:*
178 | | ...
179 | | ... | \| Honeycomb and VPP should have default configuration \|
180 | | ... | ${nodes['DUT1']} \|
181 | | ...
182 | | [Arguments] | ${node}
183 | | VxLAN Operational Data From Honeycomb Should Be empty
184 | | ... | ${node} | ${vx_interface}
185 | | VxLAN Operational Data From VAT Should Be empty | ${node}
186 | | Honeycomb should show no bridge domains | ${node}
187 | | VAT should show no bridge domains | ${node}
188 | | TAP Operational Data From Honeycomb Should Be empty
189 | | ... | ${node} | ${tap_interface}
190 | | TAP Operational Data From VAT Should Be empty
191 | | ... | ${node} | ${tap_interface}
192 | | Vhost-user Operational Data From Honeycomb Should Be empty
193 | | ... | ${node} | ${vhost_interface}
194 | | Vhost-user Operational Data From VAT Should Be empty
195 | | ... | ${node}
196 | | interface state from Honeycomb should be
197 | | ... | ${node} | ${interface} | down
198 | | And interface state from VAT should be
199 | | ... | ${node} | ${interface} | down
200
201 | Persistence file is damaged during restart
202 | | [Documentation] | Shuts down Honeycomb, modifies persistence files to\
203 | | ... | simulate damage, then restarts VPP and starts up Honeycomb again.
204 | | ...
205 | | ... | *Arguments:*
206 | | ... | - node - information about a DUT node. Type: dictionary
207 | | ...
208 | | ... | *Example:*
209 | | ...
210 | | ... | \| Persistence file is damaged during restart \| ${nodes['DUT1']} \|
211 | | ...
212 | | [Arguments] | ${node}
213 | | Stop Honeycomb service on DUTs | ${node}
214 | | Modify persistence files | ${node} | { | abc
215 | | Setup DUT | ${node}
216 | | Configure Honeycomb service on DUTs | ${node}
217
218 | Log persisted configuration on node
219 | | [Documentation] | Logs the content of Honeycomb's persitence files.
220 | | ...
221 | | ... | *Arguments:*
222 | | ... | - node - information about a DUT node. Type: dictionary
223 | | ...
224 | | ... | *Example:*
225 | | ...
226 | | ... | \| Log persisted configuration on node \| ${nodes['DUT1']} \|
227 | | ...
228 | | [Arguments] | ${node}
229 | | Log persisted configuration | ${node}
230
231 | Interface Persistence Setup
232 | | [Documentation] | Configure interface state, ipv4 and ipv6 addresses
233 | | ... | and neighbors.
234 | | ...
235 | | ... | *Arguments:*
236 | | ... | - node - information about a DUT node. Type: dictionary
237 | | ...
238 | | ... | *Example:*
239 | | ...
240 | | ... | \| Interface Persistence Setup \| ${nodes['DUT1']} \|
241 | | ...
242 | | [Arguments] | ${node}
243 | | Honeycomb and VPP should have default configuration | ${node}
244 | | Import Variables | resources/test_data/honeycomb/interface_ip.py
245 | | Honeycomb configures interface state | ${node} | ${interface} | up
246 | | Honeycomb sets interface IPv4 address with prefix
247 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
248 | | Honeycomb adds interface IPv4 neighbor
249 | | ... | ${node} | ${interface} | ${ipv4_neighbor} | ${neighbor_mac}
250 | | Honeycomb sets interface IPv6 address
251 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
252 | | Honeycomb adds interface IPv6 neighbor
253 | | ... | ${node} | ${interface} | ${ipv6_neighbor} | ${neighbor_mac}
254
255 | Interface Persistence Check
256 | | [Documentation] | Verify interface state, ipv4 and ipv6 addresses
257 | | ... | and neighbors.
258 | | ...
259 | | ... | *Arguments:*
260 | | ... | - node - information about a DUT node. Type: dictionary
261 | | ...
262 | | ... | *Example:*
263 | | ...
264 | | ... | \| Interface Persistence Check \| ${nodes['DUT1']} \|
265 | | ...
266 | | [Arguments] | ${node}
267 | | Interface state from Honeycomb should be | ${node} | ${interface} | up
268 | | IPv4 address from Honeycomb should be
269 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
270 | | IPv4 address from VAT should be
271 | | ... | ${node} | ${interface} | ${ipv4_address}
272 | | ... | ${ipv4_prefix} | ${ipv4_mask}
273 | | IPv4 neighbor from Honeycomb should be
274 | | ... | ${node} | ${interface} | ${ipv4_neighbor} | ${neighbor_mac}
275 | | IPv6 address from Honeycomb should contain
276 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
277 | | IPv6 address from VAT should contain
278 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
279 | | IPv6 neighbor from Honeycomb should be
280 | | ... | ${node} | ${interface} | ${ipv6_neighbor} | ${neighbor_mac}
281
282 | Bridge Domain Persistence Setup
283 | | [Documentation] | Configure bridge domain, BD interface assignment
284 | | ... | and L2 fib entry.
285 | | ...
286 | | ... | *Arguments:*
287 | | ... | - node - information about a DUT node. Type: dictionary
288 | | ...
289 | | ... | *Example:*
290 | | ...
291 | | ... | \| Bridge Domain Persistence Setup \| ${nodes['DUT1']} \|
292 | | ...
293 | | [Arguments] | ${node}
294 | | Honeycomb and VPP should have default configuration | ${node}
295 | | Import Variables | resources/test_data/honeycomb/l2_fib.py
296 | | ... | ${node} | ${interface} | ${interface}
297 | | Honeycomb creates first l2 bridge domain
298 | | ... | ${node} | ${bd_name} | ${bd_settings}
299 | | Honeycomb adds interface to bridge domain
300 | | ... | ${node} | ${interface} | ${bd_name} | ${if_bd_settings}
301 | | Honeycomb adds L2 FIB entry to bridge domain
302 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg}
303
304 | Bridge Domain Persistence Check
305 | | [Documentation] | Verify bridge domain, BD interface assignment
306 | | ... | and L2 fib entry.
307 | | ...
308 | | ... | *Arguments:*
309 | | ... | - node - information about a DUT node. Type: dictionary
310 | | ...
311 | | ... | *Example:*
312 | | ...
313 | | ... | \| Bridge Domain Persistence Check \| ${nodes['DUT1']} \|
314 | | ...
315 | | [Arguments] | ${node}
316 | | Bridge domain Operational Data From Honeycomb Should Be
317 | | ... | ${node} | ${bd_name} | ${bd_settings}
318 | | Bridge domain Operational Data From VAT Should Be
319 | | ... | ${node} | ${0} | ${bd_settings}
320 | | Bridge domain Operational Interface Assignment should be
321 | | ... | ${node} | ${interface} | ${if_bd_settings}
322 | | L2 FIB Entry from Honeycomb should be
323 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper}
324 | | L2 FIB entry from VAT should be
325 | | ... | ${node} | ${bd_index} | ${l2_fib_forward_vat}