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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 | Library | resources.libraries.python.honeycomb.Lisp.LispKeywords
16 | Library | resources.libraries.python.LispUtil
17 | Documentation | Keywords used to test Honeycomb Lisp features.
20 | Honeycomb enables Lisp
21 | | [Documentation] | Uses Honeycomb API to enable Lisp.
23 | | ... | *Arguments:*
24 | | ... | - node - Information about a DUT node. Type: dictionary
27 | | ... | \| Honeycomb enables Lisp \| ${nodes['DUT1']} \|
28 | | [Arguments] | ${node}
30 | | Set Lisp state | ${node} | enable
32 | Honeycomb adds locator set
33 | | [Documentation] | Uses Honeycomb API to enable Lisp.
35 | | ... | *Arguments:*
36 | | ... | - node - Information about a DUT node. Type: dictionary
37 | | ... | - interface - Name of an interface on the node. Type: string
38 | | ... | - locator_set - Name for the new locator set. Type: string
41 | | ... | \| Honeycomb enables Lisp \| ${nodes['DUT1']} \| GigabitEthernet0/8/0\
42 | | ... | \| loc_01 \|
43 | | [Arguments] | ${node} | ${interface} | ${locator_set}
44 | | Add locator | ${node} | ${interface} | ${locator_set}
46 | Honeycomb adds Lisp mapping
47 | | [Documentation] | Uses Honeycomb API to configure a Lisp mapping.
49 | | ... | *Arguments:*
50 | | ... | - node - Information about a DUT node. Type: dictionary
51 | | ... | - data - Lisp settings to use. Type: dictionary
54 | | ... | \| Honeycomb adds Lisp mapping \| ${nodes['DUT1']} \| ${data} \|
55 | | [Arguments] | ${node} | ${data}
56 | | Configure lisp mapping | ${node} | ${data}
58 | Honeycomb removes all Lisp mappings
59 | | [Documentation] | Uses Honeycomb API to clear the eid-table.
61 | | ... | *Arguments:*
62 | | ... | - node - Information about a DUT node. Type: dictionary
65 | | ... | \| Honeycomb removes all Lisp mappings \| ${nodes['DUT1']} \|
66 | | [Arguments] | ${node}
67 | | Configure lisp mapping | ${node} | ${NONE}
69 | Lisp should not be configured
70 | | [Documentation] | Retrieves Lisp configuration from Honeycomb operational\
71 | | ... | data, and expects an empty dictionary.
73 | | ... | *Arguments:*
74 | | ... | - node - Information about a DUT node. Type: dictionary
77 | | ... | \| Lisp should not be configured \| ${nodes['DUT1']} \|
78 | | [Arguments] | ${node}
80 | | Run keyword and Expect Error | KeyError: 'lisp-feature-data'
81 | | ... | Get Lisp operational data | ${node}
83 | Lisp state From Honeycomb Should Be
84 | | [Documentation] | Retrieves Lisp state from Honeycomb operational\
85 | | ... | data, and compares Lisp state with expected value.
87 | | ... | *Arguments:*
88 | | ... | - node - Information about a DUT node. Type: dictionary
89 | | ... | - state - Expected Lisp state. Type: string
92 | | ... | \| Lisp state From Honeycomb Should Be \| ${nodes['DUT1']} \
93 | | ... | \| enabled \|
94 | | [Arguments] | ${node} | ${state}
95 | | ${data}= | Get Lisp operational data | ${node}
96 | | Run keyword if | $state == 'enabled'
97 | | ... | Should be equal as strings
98 | | ... | ${data['lisp-state']['enable']} | ${True}
99 | | Run keyword if | $state == 'disabled'
100 | | ... | Should be equal as strings
101 | | ... | ${data['lisp-state']['enable']} | ${False}
103 | Lisp state From VAT Should Be
104 | | [Documentation] | Retrieves Lisp state from VAT,\
105 | | ... | and compares Lisp state with expected value.
107 | | ... | *Arguments:*
108 | | ... | - node - Information about a DUT node. Type: dictionary
109 | | ... | - state - Expected Lisp state. Type: string
112 | | ... | \| Lisp state From VAT Should Be \| ${nodes['DUT1']} \| enabled \|
113 | | [Arguments] | ${node} | ${state}
114 | | ${status}= | VPP show Lisp State | ${node}
115 | | Should match | ${status['feature_status']} | ${state}
117 | Lisp mapping From Honeycomb Should Be
118 | | [Documentation] | Retrieves Lisp mapping from Honeycomb operational\
119 | | ... | data, and compares with expected data.
121 | | ... | *Arguments:*
122 | | ... | - node - Information about a DUT node. Type: dictionary
123 | | ... | - settings - Expected Lisp mapping data. Type: dictionary
126 | | ... | \| Lisp mapping From Honeycomb Should Be \| ${nodes['DUT1']} \
127 | | ... | \| ${settings} \|
128 | | [Arguments] | ${node} | ${settings}
129 | | ${data}= | Get Lisp operational data | ${node}
130 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
131 | | ${data}= | Set Variable | ${data['eid-table']['vni-table'][0]}
132 | | Compare data structures | ${data} | ${settings}
134 | Lisp mapping From VAT Should Be
135 | | [Documentation] | Retrieves Lisp mapping from VAT,\
136 | | ... | and compares with expected data.
138 | | ... | *Arguments:*
139 | | ... | - node - Information about a DUT node. Type: dictionary
140 | | ... | - settings - Expected Lisp mapping data. Type: dictionary
143 | | ... | \| Lisp mapping From VAT Should Be \| ${nodes['DUT1']} \
144 | | ... | \| ${settings} \|
145 | | [Arguments] | ${node} | ${settings}
146 | | ${data}= | VPP show Lisp eid table | ${node}
147 | | Compare data structures | ${data[0]} | ${settings}
149 | Lisp mappings from Honeycomb should not exist
150 | | [Documentation] | Retrieves Lisp mappings from operational\
151 | | ... | data, and expects to find none.
153 | | ... | *Arguments:*
154 | | ... | - node - Information about a DUT node. Type: dictionary
157 | | ... | \| Lisp mappings from Honeycomb should not exist \
158 | | ... | \| ${nodes['DUT1']} \|
159 | | [Arguments] | ${node}
160 | | ${data}= | Get Lisp operational data | ${node}
161 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
162 | | Should be empty | ${data['eid-table']['vni-table']}
164 | Lisp mappings from VAT should not exist
165 | | [Documentation] | Retrieves Lisp mappings from VAT,\
166 | | ... | and expects to receive an empty list.
168 | | ... | *Arguments:*
169 | | ... | - node - Information about a DUT node. Type: dictionary
172 | | ... | \| Lisp mappings from VAT should not exist \| ${nodes['DUT1']} \|
173 | | [Arguments] | ${node}
174 | | ${data}= | VPP show Lisp eid table | ${node}
175 | | Should be empty | ${data}
177 | Locator set from Honeycomb should be
178 | | [Documentation] | Retrieves Lisp locator set from Honeycomb operational\
179 | | ... | data, and compares with expected data.
181 | | ... | *Arguments:*
182 | | ... | - node - Information about a DUT node. Type: dictionary
183 | | ... | - interface - Interface that should be referenced by locator.\
184 | | ... | Type: dictionary
185 | | ... | - locator_set - Expected locator set name. Type: string
188 | | ... | \| Locator set From Honeycomb Should Be \| ${nodes['DUT1']} \
189 | | ... | \| GigabitEthernet0/8/0 \| loc01 \|
190 | | [Arguments] | ${node} | ${interface} | ${locator_set}
191 | | ${data}= | Get Lisp operational data | ${node}
192 | | ${loc_data}= | Set Variable
193 | | ... | ${data['lisp-state']['lisp-feature-data']['locator-sets']}
195 | | ... | ${loc_data['locator-set'][0]['name']}
196 | | ... | ${locator_set}
198 | | ... | ${loc_data['locator-set'][0]['interface'][0]['interface-ref']}
199 | | ... | ${interface}
201 | Honeycomb adds Lisp adjacency
202 | | [Documentation] | Uses Honeycomb API to configure Lisp adjacency.
204 | | ... | *Arguments:*
205 | | ... | - node - Information about a DUT node. Type: dictionary
206 | | ... | - vni - Virtual network identifier number. Type: integer
207 | | ... | - map - Name of an existing remote mapping. Type: string
208 | | ... | - adjacency - Name for the new adjacency. Type: string
209 | | ... | - data - Lisp adjacency settings to use. Type: dictionary
212 | | ... | \| Honeycomb adds Lisp adjacency \| ${nodes['DUT1']} \| ${1} \| map1\
213 | | ... | \| adj1 \| ${data} \|
214 | | [Arguments] | ${node} | ${vni} | ${map} | ${adjacency} | ${data}
215 | | Add Lisp adjacency
216 | | ... | ${node} | ${vni} | ${map} | ${adjacency} | ${data}
218 | Honeycomb adds Lisp Map resolver
219 | | [Documentation] | Uses Honeycomb API to configure Lisp map resolver.
221 | | ... | *Arguments:*
222 | | ... | - node - Information about a DUT node. Type: dictionary
223 | | ... | - ip_address - IP address for the map resolver. Type: string
226 | | ... | \| Honeycomb adds Lisp Map resolver \| ${nodes['DUT1']} \
227 | | ... | \| 192.168.0.2 \|
228 | | [Arguments] | ${node} | ${ip_address}
229 | | Add map resolver | ${node} | ${ip_address}
231 | Map resolver from Honeycomb should be
232 | | [Documentation] | Retrieves Lisp map resolver from Honeycomb operational\
233 | | ... | data, and compares with expected data.
235 | | ... | *Arguments:*
236 | | ... | - node - Information about a DUT node. Type: dictionary
237 | | ... | - ip_address - IP address that should be referenced in map resolver.\
238 | | ... | Type: string
241 | | ... | \| Map resolver From Honeycomb Should Be \| ${nodes['DUT1']} \
242 | | ... | \| 192.168.1.2 \|
243 | | [Arguments] | ${node} | ${ip_address}
244 | | ${data}= | Get Lisp operational data | ${node}
245 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
246 | | ${data}= | Set Variable | ${data['map-resolvers']['map-resolver'][0]}
247 | | Should be equal | ${data['ip-address']} | ${ip_address}
249 | Map resolver from VAT should be
250 | | [Documentation] | Retrieves Lisp mapping from VAT,\
251 | | ... | and compares with expected data.
253 | | ... | *Arguments:*
254 | | ... | - node - Information about a DUT node. Type: dictionary
255 | | ... | - ip_address - IP address that should be referenced in map resolver.\
256 | | ... | Type: string
259 | | ... | \| Map resolver From VAT Should Be \| ${nodes['DUT1']} \
260 | | ... | \| 192.168.1.2 \|
261 | | [Arguments] | ${node} | ${ip_address}
262 | | ${data}= | Vpp show Lisp map resolver | ${node}
263 | | Should be equal | ${data[0]['map resolver']} | ${ip_address}
265 | Honeycomb enables Lisp PITR feature
266 | | [Documentation] | Uses Honeycomb API to configure Lisp PITR feature.
268 | | ... | *Arguments:*
269 | | ... | - node - Information about a DUT node. Type: dictionary
270 | | ... | - locator_set - Name of an existing locator set. Type: string
273 | | ... | \| Honeycomb enables Lisp PITR feature \| ${nodes['DUT1']} \| loc1 \|
274 | | [Arguments] | ${node} | ${locator_set}
275 | | Configure PITR | ${node} | ${locator_set}
277 | PITR config from Honeycomb should be
278 | | [Documentation] | Retrieves PITR config from Honeycomb operational\
279 | | ... | data, and compares with expected data.
281 | | ... | *Arguments:*
282 | | ... | - node - Information about a DUT node. Type: dictionary
283 | | ... | - locator_set - Name of locator set that should be referenced\
284 | | ... | in PITR config. Type: string
287 | | ... | \| PITR config from Honeycomb should be \| ${nodes['DUT1']} \
288 | | ... | \| loc01 \|
289 | | [Arguments] | ${node} | ${locator_set}
290 | | ${data}= | Get Lisp operational data | ${node}
291 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
292 | | ${data}= | Set Variable | ${data['pitr-cfg']}
293 | | Should be equal | ${data['locator-set']} | ${locator_set}
295 | PITR config from VAT should be
296 | | [Documentation] | Retrieves PITR config from VAT,\
297 | | ... | and compares with expected data.
299 | | ... | *Arguments:*
300 | | ... | - node - Information about a DUT node. Type: dictionary
301 | | ... | - locator_set - Name of locator set that should be referenced\
302 | | ... | in PITR config. Type: string
305 | | ... | \| PITR config from VAT should be \| ${nodes['DUT1']} \
306 | | ... | \| loc01 \|
307 | | [Arguments] | ${node} | ${locator_set}
308 | | ${data}= | VPP show Lisp PITR | ${node}
309 | | Should be equal | ${data['status']} | enabled
310 | | Should be equal | ${data['locator_set']} | ${locator_set}
312 | Honeycomb disables all Lisp features
313 | | [Documentation] | Uses Honeycomb API to remove all Lisp configuration.
315 | | ... | *Arguments:*
316 | | ... | - node - Information about a DUT node. Type: dictionary
319 | | ... | \| Honeycomb disables all Lisp features \| ${nodes['DUT1']} \|
320 | | [Arguments] | ${node}
321 | | Disable Lisp | ${node}