HC Test: Fix expected error when ACL table should be empty
[csit.git] / resources / libraries / robot / honeycomb / lisp_gpe.robot
1 # Copyright (c) 2017 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.LispGPEKeywords
16 | Library | resources.libraries.python.LispUtil
17 | Documentation | Keywords used to test Honeycomb Lisp GPE features.
18
19 *** Keywords ***
20 | Honeycomb enables LISP GPE
21 | | [Documentation] | Uses Honeycomb API to enable LISP GPE.
22 | | ...
23 | | ... | *Arguments:*
24 | | ... | - node - Information about a DUT node. Type: dictionary
25 | | ...
26 | | ... | *Example:*
27 | | ...
28 | | ... | \| Honeycomb enables LISP GPE \| ${nodes['DUT1']} \|
29 | | ...
30 | | [Arguments] | ${node}
31 | | ...
32 | | Set LISPGPE state | ${node} | ${TRUE}
33
34 | Honeycomb disables LISP GPE
35 | | [Documentation] | Uses Honeycomb API to disable LISP GPE.
36 | | ...
37 | | ... | *Arguments:*
38 | | ... | - node - Information about a DUT node. Type: dictionary
39 | | ...
40 | | ... | *Example:*
41 | | ...
42 | | ... | \| Honeycomb disables LISP GPE \| ${nodes['DUT1']} \|
43 | | ...
44 | | [Arguments] | ${node}
45 | | ...
46 | | Set LISPGPE state | ${node} | ${FALSE}
47
48 | Honeycomb adds first LISP GPE Mapping
49 | | [Documentation] | Uses Honeycomb API to configure a LISP mapping. Removes
50 | | ... | any existing mappings.
51 | | ...
52 | | ... | *Arguments:*
53 | | ... | - node - Information about a DUT node. Type: dictionary
54 | | ... | - data - LISP settings to use. Type: dictionary
55 | | ...
56 | | ... | *Example:*
57 | | ...
58 | | ... | \| Honeycomb adds first LISP GPE Mapping \| ${nodes['DUT1']} \
59 | | ... | \| ${data} \|
60 | | ...
61 | | [Arguments] | ${node} | ${data}
62 | | ...
63 | | Configure LISPGPE Mapping | ${node} | ${data}
64
65 | Honeycomb adds LISP GPE Mapping
66 | | [Documentation] | Uses Honeycomb API to configure a LISP mapping.
67 | | ...
68 | | ... | *Arguments:*
69 | | ... | - node - Information about a DUT node. Type: dictionary
70 | | ... | - data - LISP settings to use. Type: dictionary
71 | | ...
72 | | ... | *Example:*
73 | | ...
74 | | ... | \| Honeycomb adds LISP GPE Mapping \| ${nodes['DUT1']} \| ${data} \|
75 | | ...
76 | | [Arguments] | ${node} | ${data}
77 | | ...
78 | | Add LISPGPE Mapping | ${node} | ${data['id']} | ${data}
79
80 | Honeycomb removes LISP GPE mapping
81 | | [Documentation] | Uses Honeycomb API to remove the specified mapping.
82 | | ...
83 | | ... | *Arguments:*
84 | | ... | - node - Information about a DUT node. Type: dictionary
85 | | ...
86 | | ... | *Example:*
87 | | ...
88 | | ... | \| Honeycomb removes LISP GPE mapping \| ${nodes['DUT1']} \
89 | | ... | \| map_name \|
90 | | ...
91 | | [Arguments] | ${node} | ${mapping}
92 | | ...
93 | | Delete LISPGPE mapping | ${node} | ${mapping}
94
95 | LISP GPE should not be configured
96 | | [Documentation] | Retrieves LISP GPE configuration from Honeycomb operational\
97 | | ... | data, and expects an empty dictionary.
98 | | ...
99 | | ... | *Arguments:*
100 | | ... | - node - Information about a DUT node. Type: dictionary
101 | | ...
102 | | ... | *Example:*
103 | | ...
104 | | ... | \| LISP GPE should not be configured \| ${nodes['DUT1']} \|
105 | | ...
106 | | [Arguments] | ${node}
107 | | ...
108 | | ${data}= | Get LISP GPE operational data | ${node}
109 | | Should be Equal
110 | | ... | ${data['gpe-state']['gpe-feature-data']['enable']} | ${FALSE}
111
112 | LISP GPE state from Honeycomb should be
113 | | [Documentation] | Retrieves LISP GPE state from Honeycomb operational\
114 | | ... | data, and compares LISP state with expected value.
115 | | ...
116 | | ... | *Arguments:*
117 | | ... | - node - Information about a DUT node. Type: dictionary
118 | | ... | - state - Expected LISP state. Type: string
119 | | ...
120 | | ... | *Example:*
121 | | ...
122 | | ... | \| LISP GPE state from Honeycomb should be \| ${nodes['DUT1']} \
123 | | ... | \| enabled \|
124 | | ...
125 | | [Arguments] | ${node} | ${state}
126 | | ...
127 | | ${data}= | Get LISPGPE operational data | ${node}
128 | | Run keyword if | $state == 'enabled'
129 | | ... | Should be equal as strings
130 | | ... | ${data['gpe-state']['gpe-feature-data']['enable']} | ${True}
131 | | Run keyword if | $state == 'disabled'
132 | | ... | Should be equal as strings
133 | | ... | ${data['gpe-state']['gpe-feature-data']['enable']} | ${False}
134
135 | LISP GPE state from VAT should be
136 | | [Documentation] | Retrieves LISP state from VAT,\
137 | | ... | and compares LISP state with expected value.
138 | | ...
139 | | ... | *Arguments:*
140 | | ... | - node - Information about a DUT node. Type: dictionary
141 | | ... | - state - Expected LISP state. Type: string
142 | | ...
143 | | ... | *Example:*
144 | | ...
145 | | ... | \| LISP state from VAT should be \| ${nodes['DUT1']} \| enabled \|
146 | | ...
147 | | [Arguments] | ${node} | ${state}
148 | | ...
149 | | ${status}= | VPP show LISP State | ${node}
150 | | Should match | ${status['gpe_status']} | ${state}
151
152 | LISP GPE mapping from Honeycomb should be
153 | | [Documentation] | Retrieves LISP GPE mapping from Honeycomb operational\
154 | | ... | data, and compares with expected data.
155 | | ...
156 | | ... | *Arguments:*
157 | | ... | - node - Information about a DUT node. Type: dictionary
158 | | ... | - settings - Expected LISP mapping data. Type: dictionary
159 | | ...
160 | | ... | *Example:*
161 | | ...
162 | | ... | \| LISP GPE mapping from Honeycomb should be \| ${nodes['DUT1']} \
163 | | ... | \| ${settings} \|
164 | | ...
165 | | [Arguments] | ${node} | ${settings}
166 | | ...
167 | | ${data}= | Get LISPGPE mapping | ${node} | ${settings['id']}
168 | | Compare data structures | ${data} | ${settings}
169
170 | LISP GPE mappings from Honeycomb should not exist
171 | | [Documentation] | Retrieves LISP GPE mappings from operational\
172 | | ... | data, and expects to find none.
173 | | ...
174 | | ... | *Arguments:*
175 | | ... | - node - Information about a DUT node. Type: dictionary
176 | | ...
177 | | ... | *Example:*
178 | | ...
179 | | ... | \| LISP GPE mappings from Honeycomb should not exist \
180 | | ... | \| ${nodes['DUT1']} \|
181 | | ...
182 | | [Arguments] | ${node}
183 | | ...
184 | | ${data}= | Get LISPGPE operational data | ${node}
185 | | Variable Should Not Exist
186 | | ... | ${data['gpe-state']['gpe-feature-data']['gpe-entry']}
187
188 | Honeycomb disables all LISP GPE features
189 | | [Documentation] | Uses Honeycomb API to remove all LISP GPE configuration.
190 | | ...
191 | | ... | *Arguments:*
192 | | ... | - node - Information about a DUT node. Type: dictionary
193 | | ...
194 | | ... | *Example:*
195 | | ...
196 | | ... | \| Honeycomb disables all LISP GPE features \| ${nodes['DUT1']} \|
197 | | ...
198 | | [Arguments] | ${node}
199 | | ...
200 | | Disable LISPGPE | ${node}
201
202 | Send packet and verify LISP GPE encap
203 | | [Documentation] | Send ICMP packet to DUT out one interface and receive\
204 | | ... | a LISP-GPE encapsulated packet on the other interface.
205 | | ...
206 | | ... | *Arguments:*
207 | | ...
208 | | ... | _NOTE:_ Arguments are based on topology:
209 | | ...             | TG(if1)->(if1)DUT(if2)->TG(if2)
210 | | ...
211 | | ... | - tg_node - Node to execute scripts on (TG). Type: dictionary
212 | | ... | - src_ip - IP of source interface (TG-if1). Type: string
213 | | ... | - dst_ip - IP of destination interface (TG-if2). Type: string
214 | | ... | - tx_src_port - Interface of TG-if1. Type: string
215 | | ... | - tx_src_mac - MAC address of TG-if1. Type: string
216 | | ... | - tx_dst_mac - MAC address of DUT-if1. Type: string
217 | | ... | - rx_port - Interface of TG-if1. Type: string
218 | | ... | - rx_src_mac - MAC address of DUT1-if2. Type: string
219 | | ... | - rx_dst_mac - MAC address of TG-if2. Type: string
220 | | ... | - src_rloc - configured RLOC source address. Type: string
221 | | ... | - dst_rloc - configured RLOC destination address. Type: string
222 | | ...
223 | | ... | *Return:*
224 | | ... | - No value returned
225 | | ...
226 | | ... | *Example:*
227 | | ...
228 | | ... | \| Send packet and verify LISP GPE encap \| ${nodes['TG']} \
229 | | ... | \| 10.0.0.1 \| 32.0.0.1 \|
230 | | ... | \| eth2 \| 08:00:27:ee:fd:b3 \| 08:00:27:a2:52:5b \
231 | | ... | \| eth3 \| 08:00:27:4d:ca:7a \| 08:00:27:7d:fd:10 \
232 | | ... | \| 10.0.1.1 \| 10.0.1.2 \|
233 | | ...
234 | | [Arguments] | ${tg_node} | ${src_ip} | ${dst_ip} | ${tx_src_port} |
235 | | ... | ${tx_src_mac} | ${tx_dst_mac} | ${rx_port} | ${rx_src_mac}
236 | | ... | ${rx_dst_mac} | ${src_rloc} | ${dst_rloc}
237 | | ...
238 | | ${tx_port_name}= | Get interface name | ${tg_node} | ${tx_src_port}
239 | | ${rx_port_name}= | Get interface name | ${tg_node} | ${rx_port}
240 | | ${args}= | Catenate | --tg_src_mac | ${tx_src_mac} | --tg_dst_mac
241 | | ... | ${rx_dst_mac} | --dut_if1_mac | ${tx_dst_mac} | --dut_if2_mac
242 | | ... | ${rx_src_mac} | --src_ip | ${src_ip} | --dst_ip | ${dst_ip}
243 | | ... | --tx_if | ${tx_port_name} | --rx_if | ${rx_port_name}
244 | | ... | --src_rloc | ${src_rloc} | --dst_rloc | ${dst_rloc}
245 | | Run Traffic Script On Node | lisp/lispgpe_check.py | ${tg_node}
246 | | ... | ${args}
247
248 | LISPGPE Functional Traffic Test Teardown
249 | | [Documentation] | Teardown for LISP GPE functional traffic test.
250 | | Show Packet Trace on all DUTs | ${nodes}
251 | | VPP Show LISP EID Table | ${node}
252 | | Disable LISPGPE | ${node}