CSIT-562 HC Test: Persistence suite rework, part1
[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 | Multi-Feature Persistence Test Configuration
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 | | ... | \| Multi-Feature Persistence Test Configuration \| ${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 | Multi-Feature persistence Test Verification
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 | | ... | \| Multi-Feature persistence Test Verification \| ${nodes['DUT1']} \
133 | | ... | \| GigabitEthernet0/8/0 \|
134 | | ...
135 | | [Arguments] | ${node} | ${interface}
136 | | VxLAN Operational Data From Honeycomb Should Be
137 | | ... | ${node} | ${vx_interface} | ${vxlan_settings}
138 | | VxLAN Operational Data From VAT Should Be
139 | | ... | ${node} | ${vxlan_settings}
140 | | Bridge domain Operational Data From Honeycomb Should Be
141 | | ... | ${node} | ${bd_name} | ${bd_settings}
142 | | Bridge domain Operational Data From VAT Should Be
143 | | ... | ${node} | ${0} | ${bd_settings}
144 | | TAP Operational Data From Honeycomb Should Be
145 | | ... | ${node} | ${tap_interface} | ${tap_settings}
146 | | TAP Operational Data From VAT Should Be
147 | | ... | ${node} | ${tap_interface} | ${tap_settings}
148 | | Vhost-user Operational Data From Honeycomb Should Be
149 | | ... | ${node} | ${vhost_interface} | ${vhost_user_client}
150 | | Vhost-user Operational Data From VAT Should Be
151 | | ... | ${node} | ${vhost_user_client}
152 | | Sub-interface Operational Data From Honeycomb Should Be
153 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_if_1_oper}
154 | | Sub-interface Operational Data 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 Operational Data From Honeycomb Should Be
159 | | ... | ${node} | ${interface} | ${sub_if_id} | ${sub_bd_settings}
160 | | Sub-interface bridge domain Operational Data 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 | | ${data_conf}= | InterfaceAPI.Get all interfaces cfg data | ${node}
167 | | ${data_oper}= | InterfaceAPI.Get all interfaces oper data | ${node}
168 | | Compare interface lists | ${data_conf} | ${data_oper}
169
170 | Honeycomb and VPP should have default configuration
171 | | [Documentation] | Uses Honeycomb and VAT to verify settings for VxLAN,\
172 | | ... | bridge domains, TAP, vhost-user and VLAN. Expects default\
173 | | ... | configuration.
174 | | ...
175 | | ... | *Arguments:*
176 | | ... | - node - information about a DUT node. Type: dictionary
177 | | ...
178 | | ... | *Example:*
179 | | ...
180 | | ... | \| Honeycomb and VPP should have default configuration \|
181 | | ... | ${nodes['DUT1']} \|
182 | | ...
183 | | [Arguments] | ${node}
184 | | VxLAN Operational Data From Honeycomb Should Be empty
185 | | ... | ${node} | ${vx_interface}
186 | | VxLAN Operational Data From VAT Should Be empty | ${node}
187 | | Honeycomb should show no bridge domains | ${node}
188 | | VAT should show no bridge domains | ${node}
189 | | TAP Operational Data From Honeycomb Should Be empty
190 | | ... | ${node} | ${tap_interface}
191 | | TAP Operational Data From VAT Should Be empty
192 | | ... | ${node} | ${tap_interface}
193 | | Vhost-user Operational Data From Honeycomb Should Be empty
194 | | ... | ${node} | ${vhost_interface}
195 | | Vhost-user Operational Data From VAT Should Be empty
196 | | ... | ${node}
197 | | interface state from Honeycomb should be
198 | | ... | ${node} | ${interface} | down
199 | | And interface state from VAT should be
200 | | ... | ${node} | ${interface} | down
201
202 | Persistence file is damaged during restart
203 | | [Documentation] | Shuts down Honeycomb, modifies persistence files to\
204 | | ... | simulate damage, then restarts VPP and starts up Honeycomb again.
205 | | ...
206 | | ... | *Arguments:*
207 | | ... | - node - information about a DUT node. Type: dictionary
208 | | ...
209 | | ... | *Example:*
210 | | ...
211 | | ... | \| Persistence file is damaged during restart \| ${nodes['DUT1']} \|
212 | | ...
213 | | [Arguments] | ${node}
214 | | Stop Honeycomb service on DUTs | ${node}
215 | | Modify persistence files | ${node} | { | abc
216 | | Setup DUT | ${node}
217 | | Setup Honeycomb service on DUTs | ${node}
218
219 | Log persisted configuration on node
220 | | [Documentation] | Logs the content of Honeycomb's persitence files.
221 | | ...
222 | | ... | *Arguments:*
223 | | ... | - node - information about a DUT node. Type: dictionary
224 | | ...
225 | | ... | *Example:*
226 | | ...
227 | | ... | \| Log persisted configuration on node \| ${nodes['DUT1']} \|
228 | | ...
229 | | [Arguments] | ${node}
230 | | Log persisted configuration | ${node}
231
232 | Interface Persistence Setup
233 | | [Documentation] | Configure interface state, ipv4 and ipv6 addresses
234 | | ... | and neighbors.
235 | | ...
236 | | ... | *Arguments:*
237 | | ... | - node - information about a DUT node. Type: dictionary
238 | | ...
239 | | ... | *Example:*
240 | | ...
241 | | ... | \| Interface Persistence Setup \| ${nodes['DUT1']} \|
242 | | ...
243 | | [Arguments] | ${node}
244 | | Honeycomb and VPP should have default configuration | ${node}
245 | | Import Variables | resources/test_data/honeycomb/interface_ip.py
246 | | Honeycomb sets interface state | ${node} | ${interface} | up
247 | | Honeycomb sets interface ipv4 address with prefix
248 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
249 | | Honeycomb adds interface ipv4 neighbor
250 | | ... | ${node} | ${interface} | ${ipv4_neighbor} | ${neighbor_mac}
251 | | Honeycomb sets interface ipv6 address
252 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
253 | | Honeycomb adds interface ipv6 neighbor
254 | | ... | ${node} | ${interface} | ${ipv6_neighbor} | ${neighbor_mac}
255
256 | Interface Persistence Check
257 | | [Documentation] | Verify interface state, ipv4 and ipv6 addresses
258 | | ... | and neighbors.
259 | | ...
260 | | ... | *Arguments:*
261 | | ... | - node - information about a DUT node. Type: dictionary
262 | | ...
263 | | ... | *Example:*
264 | | ...
265 | | ... | \| Interface Persistence Check \| ${nodes['DUT1']} \|
266 | | ...
267 | | [Arguments] | ${node}
268 | | Interface state from Honeycomb should be | ${node} | ${interface} | up
269 | | IPv4 address from Honeycomb should be
270 | | ... | ${node} | ${interface} | ${ipv4_address} | ${ipv4_prefix}
271 | | IPv4 address from VAT should be
272 | | ... | ${node} | ${interface} | ${ipv4_address}
273 | | ... | ${ipv4_prefix} | ${ipv4_mask}
274 | | IPv4 neighbor from Honeycomb should be
275 | | ... | ${node} | ${interface} | ${ipv4_neighbor} | ${neighbor_mac}
276 | | IPv6 address from Honeycomb should contain
277 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
278 | | IPv6 address from VAT should contain
279 | | ... | ${node} | ${interface} | ${ipv6_address} | ${ipv6_prefix}
280 | | IPv6 neighbor from Honeycomb should be
281 | | ... | ${node} | ${interface} | ${ipv6_neighbor} | ${neighbor_mac}
282
283 | Bridge Domain Persistence Setup
284 | | [Documentation] | Configure bridge domain, BD interface assignment
285 | | ... | and L2 fib entry.
286 | | ...
287 | | ... | *Arguments:*
288 | | ... | - node - information about a DUT node. Type: dictionary
289 | | ...
290 | | ... | *Example:*
291 | | ...
292 | | ... | \| Bridge Domain Persistence Setup \| ${nodes['DUT1']} \|
293 | | ...
294 | | [Arguments] | ${node}
295 | | Honeycomb and VPP should have default configuration | ${node}
296 | | Import Variables | resources/test_data/honeycomb/l2_fib.py
297 | | ... | ${node} | ${interface} | ${interface}
298 | | Honeycomb creates first l2 bridge domain
299 | | ... | ${node} | ${bd_name} | ${bd_settings}
300 | | Honeycomb adds interface to bridge domain
301 | | ... | ${node} | ${interface} | ${bd_name} | ${if_bd_settings}
302 | | Honeycomb adds L2 FIB entry to bridge domain
303 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_cfg}
304
305 | Bridge Domain Persistence Check
306 | | [Documentation] | Verify bridge domain, BD interface assignment
307 | | ... | and L2 fib entry.
308 | | ...
309 | | ... | *Arguments:*
310 | | ... | - node - information about a DUT node. Type: dictionary
311 | | ...
312 | | ... | *Example:*
313 | | ...
314 | | ... | \| Bridge Domain Persistence Check \| ${nodes['DUT1']} \|
315 | | ...
316 | | [Arguments] | ${node}
317 | | Bridge domain Operational Data From Honeycomb Should Be
318 | | ... | ${node} | ${bd_name} | ${bd_settings}
319 | | Bridge domain Operational Data From VAT Should Be
320 | | ... | ${node} | ${0} | ${bd_settings}
321 | | Bridge domain Operational Interface Assignment should be
322 | | ... | ${node} | ${interface} | ${if_bd_settings}
323 | | L2 FIB Entry from Honeycomb should be
324 | | ... | ${node} | ${bd_name} | ${l2_fib_forward_oper}
325 | | L2 FIB entry from VAT should be
326 | | ... | ${node} | ${bd_index} | ${l2_fib_forward_vat}

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.