e1d69ed316dce68fa21b988a51f16343464a3491
[csit.git] / resources / libraries / robot / honeycomb / lisp.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.Lisp.LispKeywords
16 | Library | resources.libraries.python.LispUtil
17 | Documentation | Keywords used to test Honeycomb Lisp features.
18
19 *** Keywords ***
20 | Honeycomb enables Lisp
21 | | [Documentation] | Uses Honeycomb API to enable Lisp.
22 | | ...
23 | | ... | *Arguments:*
24 | | ... | - node - Information about a DUT node. Type: dictionary
25 | | ...
26 | | ... | *Example:*
27 | | ... | \| Honeycomb enables Lisp \| ${nodes['DUT1']} \|
28 | | [Arguments] | ${node}
29 | | ...
30 | | Set Lisp state | ${node} | enable
31
32 | Honeycomb adds locator set
33 | | [Documentation] | Uses Honeycomb API to enable Lisp.
34 | | ...
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
39 | | ...
40 | | ... | *Example:*
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}
45
46 | Honeycomb adds Lisp mapping
47 | | [Documentation] | Uses Honeycomb API to configure a Lisp mapping.
48 | | ...
49 | | ... | *Arguments:*
50 | | ... | - node - Information about a DUT node. Type: dictionary
51 | | ... | - data - Lisp settings to use. Type: dictionary
52 | | ...
53 | | ... | *Example:*
54 | | ... | \| Honeycomb adds Lisp mapping \| ${nodes['DUT1']} \| ${data} \|
55 | | [Arguments] | ${node} | ${data}
56 | | Configure lisp mapping | ${node} | ${data}
57
58 | Honeycomb removes all Lisp mappings
59 | | [Documentation] | Uses Honeycomb API to clear the eid-table.
60 | | ...
61 | | ... | *Arguments:*
62 | | ... | - node - Information about a DUT node. Type: dictionary
63 | | ...
64 | | ... | *Example:*
65 | | ... | \| Honeycomb removes all Lisp mappings \| ${nodes['DUT1']} \|
66 | | [Arguments] | ${node}
67 | | Configure lisp mapping | ${node} | ${NONE}
68
69 | Lisp should not be configured
70 | | [Documentation] | Retrieves Lisp configuration from Honeycomb operational\
71 | | ... | data, and expects an empty dictionary.
72 | | ...
73 | | ... | *Arguments:*
74 | | ... | - node - Information about a DUT node. Type: dictionary
75 | | ...
76 | | ... | *Example:*
77 | | ... | \| Lisp should not be configured \| ${nodes['DUT1']} \|
78 | | [Arguments] | ${node}
79 | | ...
80 | | Run keyword and Expect Error | KeyError: 'lisp-feature-data'
81 | | ... | Get Lisp operational data | ${node}
82
83 | Lisp state From Honeycomb Should Be
84 | | [Documentation] | Retrieves Lisp state from Honeycomb operational\
85 | | ... | data, and compares Lisp state with expected value.
86 | | ...
87 | | ... | *Arguments:*
88 | | ... | - node - Information about a DUT node. Type: dictionary
89 | | ... | - state - Expected Lisp state. Type: string
90 | | ...
91 | | ... | *Example:*
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}
102
103 | Lisp state From VAT Should Be
104 | | [Documentation] | Retrieves Lisp state from VAT,\
105 | | ... | and compares Lisp state with expected value.
106 | | ...
107 | | ... | *Arguments:*
108 | | ... | - node - Information about a DUT node. Type: dictionary
109 | | ... | - state - Expected Lisp state. Type: string
110 | | ...
111 | | ... | *Example:*
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}
116
117 | Lisp mapping From Honeycomb Should Be
118 | | [Documentation] | Retrieves Lisp mapping from Honeycomb operational\
119 | | ... | data, and compares with expected data.
120 | | ...
121 | | ... | *Arguments:*
122 | | ... | - node - Information about a DUT node. Type: dictionary
123 | | ... | - settings - Expected Lisp mapping data. Type: dictionary
124 | | ...
125 | | ... | *Example:*
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}
133
134 | Lisp mapping From VAT Should Be
135 | | [Documentation] | Retrieves Lisp mapping from VAT,\
136 | | ... | and compares with expected data.
137 | | ...
138 | | ... | *Arguments:*
139 | | ... | - node - Information about a DUT node. Type: dictionary
140 | | ... | - settings - Expected Lisp mapping data. Type: dictionary
141 | | ...
142 | | ... | *Example:*
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}
148
149 | Lisp mappings from Honeycomb should not exist
150 | | [Documentation] | Retrieves Lisp mappings from operational\
151 | | ... | data, and expects to find none.
152 | | ...
153 | | ... | *Arguments:*
154 | | ... | - node - Information about a DUT node. Type: dictionary
155 | | ...
156 | | ... | *Example:*
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']}
163
164 | Lisp mappings from VAT should not exist
165 | | [Documentation] | Retrieves Lisp mappings from VAT,\
166 | | ... | and expects to receive an empty list.
167 | | ...
168 | | ... | *Arguments:*
169 | | ... | - node - Information about a DUT node. Type: dictionary
170 | | ...
171 | | ... | *Example:*
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}
176
177 | Locator set from Honeycomb should be
178 | | [Documentation] | Retrieves Lisp locator set from Honeycomb operational\
179 | | ... | data, and compares with expected data.
180 | | ...
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
186 | | ...
187 | | ... | *Example:*
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']}
194 | | Should be equal
195 | | ... | ${loc_data['locator-set'][0]['name']}
196 | | ... | ${locator_set}
197 | | Should be equal
198 | | ... | ${loc_data['locator-set'][0]['interface'][0]['interface-ref']}
199 | | ... | ${interface}
200
201 | Honeycomb adds Lisp adjacency
202 | | [Documentation] | Uses Honeycomb API to configure Lisp adjacency.
203 | | ...
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
210 | | ...
211 | | ... | *Example:*
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}
217
218 | Honeycomb adds Lisp Map resolver
219 | | [Documentation] | Uses Honeycomb API to configure Lisp map resolver.
220 | | ...
221 | | ... | *Arguments:*
222 | | ... | - node - Information about a DUT node. Type: dictionary
223 | | ... | - ip_address - IP address for the map resolver. Type: string
224 | | ...
225 | | ... | *Example:*
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}
230
231 | Map resolver from Honeycomb should be
232 | | [Documentation] | Retrieves Lisp map resolver from Honeycomb operational\
233 | | ... | data, and compares with expected data.
234 | | ...
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
239 | | ...
240 | | ... | *Example:*
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}
248
249 | Map resolver from VAT should be
250 | | [Documentation] | Retrieves Lisp mapping from VAT,\
251 | | ... | and compares with expected data.
252 | | ...
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
257 | | ...
258 | | ... | *Example:*
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}
264
265 | Honeycomb enables Lisp PITR feature
266 | | [Documentation] | Uses Honeycomb API to configure Lisp PITR feature.
267 | | ...
268 | | ... | *Arguments:*
269 | | ... | - node - Information about a DUT node. Type: dictionary
270 | | ... | - locator_set - Name of an existing locator set. Type: string
271 | | ...
272 | | ... | *Example:*
273 | | ... | \| Honeycomb enables Lisp PITR feature \| ${nodes['DUT1']} \| loc1 \|
274 | | [Arguments] | ${node} | ${locator_set}
275 | | Configure PITR | ${node} | ${locator_set}
276
277 | PITR config from Honeycomb should be
278 | | [Documentation] | Retrieves PITR config from Honeycomb operational\
279 | | ... | data, and compares with expected data.
280 | | ...
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
285 | | ...
286 | | ... | *Example:*
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}
294
295 | PITR config from VAT should be
296 | | [Documentation] | Retrieves PITR config from VAT,\
297 | | ... | and compares with expected data.
298 | | ...
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
303 | | ...
304 | | ... | *Example:*
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}
311
312 | Honeycomb disables all Lisp features
313 | | [Documentation] | Uses Honeycomb API to remove all Lisp configuration.
314 | | ...
315 | | ... | *Arguments:*
316 | | ... | - node - Information about a DUT node. Type: dictionary
317 | | ...
318 | | ... | *Example:*
319 | | ... | \| Honeycomb disables all Lisp features \| ${nodes['DUT1']} \|
320 | | [Arguments] | ${node}
321 | | Disable Lisp | ${node}