CSIT-484: HC Test: Lisp
[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 | | ${data}= | Get Lisp operational data | ${node}
81 | | Should be equal as strings | ${data['lisp-state']['enable']} | False
82 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
83 | | Should match | ${data['pitr-cfg']['locator-set']} | N/A
84 | | Variable should not exist | ${data['eid-table']['vni-table'][0]}
85
86 | Lisp state From Honeycomb Should Be
87 | | [Documentation] | Retrieves Lisp state from Honeycomb operational\
88 | | ... | data, and compares Lisp state with expected value.
89 | | ...
90 | | ... | *Arguments:*
91 | | ... | - node - Information about a DUT node. Type: dictionary
92 | | ... | - state - Expected Lisp state. Type: string
93 | | ...
94 | | ... | *Example:*
95 | | ... | \| Lisp state From Honeycomb Should Be \| ${nodes['DUT1']} \
96 | | ... | \| enabled \|
97 | | [Arguments] | ${node} | ${state}
98 | | ${data}= | Get Lisp operational data | ${node}
99 | | Run keyword if | $state == 'enabled'
100 | | ... | Should be equal as strings
101 | | ... | ${data['lisp-state']['enable']} | ${True}
102 | | Run keyword if | $state == 'disabled'
103 | | ... | Should be equal as strings
104 | | ... | ${data['lisp-state']['enable']} | ${False}
105
106 | Lisp state From VAT Should Be
107 | | [Documentation] | Retrieves Lisp state from VAT,\
108 | | ... | and compares Lisp state with expected value.
109 | | ...
110 | | ... | *Arguments:*
111 | | ... | - node - Information about a DUT node. Type: dictionary
112 | | ... | - state - Expected Lisp state. Type: string
113 | | ...
114 | | ... | *Example:*
115 | | ... | \| Lisp state From VAT Should Be \| ${nodes['DUT1']} \| enabled \|
116 | | [Arguments] | ${node} | ${state}
117 | | ${status}= | VPP show Lisp State | ${node}
118 | | Should match | ${status['feature_status']} | ${state}
119
120 | Lisp mapping From Honeycomb Should Be
121 | | [Documentation] | Retrieves Lisp mapping from Honeycomb operational\
122 | | ... | data, and compares with expected data.
123 | | ...
124 | | ... | *Arguments:*
125 | | ... | - node - Information about a DUT node. Type: dictionary
126 | | ... | - settings - Expected Lisp mapping data. Type: dictionary
127 | | ...
128 | | ... | *Example:*
129 | | ... | \| Lisp mapping From Honeycomb Should Be \| ${nodes['DUT1']} \
130 | | ... | \| ${settings} \|
131 | | [Arguments] | ${node} | ${settings}
132 | | ${data}= | Get Lisp operational data | ${node}
133 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
134 | | ${data}= | Set Variable | ${data['eid-table']['vni-table'][0]}
135 | | Compare data structures | ${data} | ${settings}
136
137 | Lisp mapping From VAT Should Be
138 | | [Documentation] | Retrieves Lisp mapping from VAT,\
139 | | ... | and compares with expected data.
140 | | ...
141 | | ... | *Arguments:*
142 | | ... | - node - Information about a DUT node. Type: dictionary
143 | | ... | - settings - Expected Lisp mapping data. Type: dictionary
144 | | ...
145 | | ... | *Example:*
146 | | ... | \| Lisp mapping From VAT Should Be \| ${nodes['DUT1']} \
147 | | ... | \| ${settings} \|
148 | | [Arguments] | ${node} | ${settings}
149 | | ${data}= | VPP show Lisp eid table | ${node}
150 | | Compare data structures | ${data[0]} | ${settings}
151
152 | Lisp mappings from Honeycomb should not exist
153 | | [Documentation] | Retrieves Lisp mappings from operational\
154 | | ... | data, and expects to find none.
155 | | ...
156 | | ... | *Arguments:*
157 | | ... | - node - Information about a DUT node. Type: dictionary
158 | | ...
159 | | ... | *Example:*
160 | | ... | \| Lisp mappings from Honeycomb should not exist \
161 | | ... | \| ${nodes['DUT1']} \|
162 | | [Arguments] | ${node}
163 | | ${data}= | Get Lisp operational data | ${node}
164 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
165 | | Should be empty | ${data['eid-table']['vni-table']}
166
167 | Lisp mappings from VAT should not exist
168 | | [Documentation] | Retrieves Lisp mappings from VAT,\
169 | | ... | and expects to receive an empty list.
170 | | ...
171 | | ... | *Arguments:*
172 | | ... | - node - Information about a DUT node. Type: dictionary
173 | | ...
174 | | ... | *Example:*
175 | | ... | \| Lisp mappings from VAT should not exist \| ${nodes['DUT1']} \|
176 | | [Arguments] | ${node}
177 | | ${data}= | VPP show Lisp eid table | ${node}
178 | | Should be empty | ${data}
179
180 | Locator set from Honeycomb should be
181 | | [Documentation] | Retrieves Lisp locator set from Honeycomb operational\
182 | | ... | data, and compares with expected data.
183 | | ...
184 | | ... | *Arguments:*
185 | | ... | - node - Information about a DUT node. Type: dictionary
186 | | ... | - interface - Interface that should be referenced by locator.\
187 | | ... | Type: dictionary
188 | | ... | - locator_set - Expected locator set name. Type: string
189 | | ...
190 | | ... | *Example:*
191 | | ... | \| Locator set From Honeycomb Should Be \| ${nodes['DUT1']} \
192 | | ... | \| GigabitEthernet0/8/0 \| loc01 \|
193 | | [Arguments] | ${node} | ${interface} | ${locator_set}
194 | | ${data}= | Get Lisp operational data | ${node}
195 | | ${loc_data}= | Set Variable
196 | | ... | ${data['lisp-state']['lisp-feature-data']['locator-sets']}
197 | | Should be equal
198 | | ... | ${loc_data['locator-set'][0]['name']}
199 | | ... | ${locator_set}
200 | | Should be equal
201 | | ... | ${loc_data['locator-set'][0]['interface'][0]['interface-ref']}
202 | | ... | ${interface}
203
204 | Honeycomb adds Lisp adjacency
205 | | [Documentation] | Uses Honeycomb API to configure Lisp adjacency.
206 | | ...
207 | | ... | *Arguments:*
208 | | ... | - node - Information about a DUT node. Type: dictionary
209 | | ... | - vni - Virtual network identifier number. Type: integer
210 | | ... | - map - Name of an existing remote mapping. Type: string
211 | | ... | - adjacency - Name for the new adjacency. Type: string
212 | | ... | - data - Lisp adjacency settings to use. Type: dictionary
213 | | ...
214 | | ... | *Example:*
215 | | ... | \| Honeycomb adds Lisp adjacency \| ${nodes['DUT1']} \| ${1} \| map1\
216 | | ... | \| adj1 \| ${data} \|
217 | | [Arguments] | ${node} | ${vni} | ${map} | ${adjacency} | ${data}
218 | | Add Lisp adjacency
219 | | ... | ${node} | ${vni} | ${map} | ${adjacency} | ${data}
220
221 | Honeycomb adds Lisp Map resolver
222 | | [Documentation] | Uses Honeycomb API to configure Lisp map resolver.
223 | | ...
224 | | ... | *Arguments:*
225 | | ... | - node - Information about a DUT node. Type: dictionary
226 | | ... | - ip_address - IP address for the map resolver. Type: string
227 | | ...
228 | | ... | *Example:*
229 | | ... | \| Honeycomb adds Lisp Map resolver \| ${nodes['DUT1']} \
230 | | ... | \| 192.168.0.2 \|
231 | | [Arguments] | ${node} | ${ip_address}
232 | | Add map resolver | ${node} | ${ip_address}
233
234 | Map resolver from Honeycomb should be
235 | | [Documentation] | Retrieves Lisp map resolver from Honeycomb operational\
236 | | ... | data, and compares with expected data.
237 | | ...
238 | | ... | *Arguments:*
239 | | ... | - node - Information about a DUT node. Type: dictionary
240 | | ... | - ip_address - IP address that should be referenced in map resolver.\
241 | | ... | Type: string
242 | | ...
243 | | ... | *Example:*
244 | | ... | \| Map resolver From Honeycomb Should Be \| ${nodes['DUT1']} \
245 | | ... | \| 192.168.1.2 \|
246 | | [Arguments] | ${node} | ${ip_address}
247 | | ${data}= | Get Lisp operational data | ${node}
248 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
249 | | ${data}= | Set Variable | ${data['map-resolvers']['map-resolver'][0]}
250 | | Should be equal | ${data['ip-address']} | ${ip_address}
251
252 | Map resolver from VAT should be
253 | | [Documentation] | Retrieves Lisp mapping from VAT,\
254 | | ... | and compares with expected data.
255 | | ...
256 | | ... | *Arguments:*
257 | | ... | - node - Information about a DUT node. Type: dictionary
258 | | ... | - ip_address - IP address that should be referenced in map resolver.\
259 | | ... | Type: string
260 | | ...
261 | | ... | *Example:*
262 | | ... | \| Map resolver From VAT Should Be \| ${nodes['DUT1']} \
263 | | ... | \| 192.168.1.2 \|
264 | | [Arguments] | ${node} | ${ip_address}
265 | | ${data}= | Vpp show Lisp map resolver | ${node}
266 | | Should be equal | ${data[0]['map resolver']} | ${ip_address}
267
268 | Honeycomb enables Lisp PITR feature
269 | | [Documentation] | Uses Honeycomb API to configure Lisp PITR feature.
270 | | ...
271 | | ... | *Arguments:*
272 | | ... | - node - Information about a DUT node. Type: dictionary
273 | | ... | - locator_set - Name of an existing locator set. Type: string
274 | | ...
275 | | ... | *Example:*
276 | | ... | \| Honeycomb enables Lisp PITR feature \| ${nodes['DUT1']} \| loc1 \|
277 | | [Arguments] | ${node} | ${locator_set}
278 | | Configure PITR | ${node} | ${locator_set}
279
280 | PITR config from Honeycomb should be
281 | | [Documentation] | Retrieves PITR config from Honeycomb operational\
282 | | ... | data, and compares with expected data.
283 | | ...
284 | | ... | *Arguments:*
285 | | ... | - node - Information about a DUT node. Type: dictionary
286 | | ... | - locator_set - Name of locator set that should be referenced\
287 | | ... | in PITR config. Type: string
288 | | ...
289 | | ... | *Example:*
290 | | ... | \| PITR config from Honeycomb should be \| ${nodes['DUT1']} \
291 | | ... | \| loc01 \|
292 | | [Arguments] | ${node} | ${locator_set}
293 | | ${data}= | Get Lisp operational data | ${node}
294 | | ${data}= | Set Variable | ${data['lisp-state']['lisp-feature-data']}
295 | | ${data}= | Set Variable | ${data['pitr-cfg']}
296 | | Should be equal | ${data['locator-set']} | ${locator_set}
297
298 | PITR config from VAT should be
299 | | [Documentation] | Retrieves PITR config from VAT,\
300 | | ... | and compares with expected data.
301 | | ...
302 | | ... | *Arguments:*
303 | | ... | - node - Information about a DUT node. Type: dictionary
304 | | ... | - locator_set - Name of locator set that should be referenced\
305 | | ... | in PITR config. Type: string
306 | | ...
307 | | ... | *Example:*
308 | | ... | \| PITR config from VAT should be \| ${nodes['DUT1']} \
309 | | ... | \| loc01 \|
310 | | [Arguments] | ${node} | ${locator_set}
311 | | ${data}= | VPP show Lisp PITR | ${node}
312 | | Should be equal | ${data['status']} | enabled
313 | | Should be equal | ${data['locator_set']} | ${locator_set}
314
315 | Honeycomb disables all Lisp features
316 | | [Documentation] | Uses Honeycomb API to remove all Lisp configuration.
317 | | ...
318 | | ... | *Arguments:*
319 | | ... | - node - Information about a DUT node. Type: dictionary
320 | | ...
321 | | ... | *Example:*
322 | | ... | \| Honeycomb disables all Lisp features \| ${nodes['DUT1']} \|
323 | | [Arguments] | ${node}
324 | | Disable Lisp | ${node}