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