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:
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.LispGPEKeywords
16 | Library | resources.libraries.python.LispUtil
17 | Documentation | Keywords used to test Honeycomb Lisp GPE features.
20 | Honeycomb enables LISP GPE
21 | | [Documentation] | Uses Honeycomb API to enable LISP GPE.
23 | | ... | *Arguments:*
24 | | ... | - node - Information about a DUT node. Type: dictionary
28 | | ... | \| Honeycomb enables LISP GPE \| ${nodes['DUT1']} \|
30 | | [Arguments] | ${node}
32 | | Set LISPGPE state | ${node} | ${TRUE}
34 | Honeycomb disables LISP GPE
35 | | [Documentation] | Uses Honeycomb API to disable LISP GPE.
37 | | ... | *Arguments:*
38 | | ... | - node - Information about a DUT node. Type: dictionary
42 | | ... | \| Honeycomb disables LISP GPE \| ${nodes['DUT1']} \|
44 | | [Arguments] | ${node}
46 | | Set LISPGPE state | ${node} | ${FALSE}
48 | Honeycomb adds first LISP GPE Mapping
49 | | [Documentation] | Uses Honeycomb API to configure a LISP mapping. Removes
50 | | ... | any existing mappings.
52 | | ... | *Arguments:*
53 | | ... | - node - Information about a DUT node. Type: dictionary
54 | | ... | - data - LISP settings to use. Type: dictionary
58 | | ... | \| Honeycomb adds first LISP GPE Mapping \| ${nodes['DUT1']} \
59 | | ... | \| ${data} \|
61 | | [Arguments] | ${node} | ${data}
63 | | Configure LISPGPE Mapping | ${node} | ${data}
65 | Honeycomb adds LISP GPE Mapping
66 | | [Documentation] | Uses Honeycomb API to configure a LISP mapping.
68 | | ... | *Arguments:*
69 | | ... | - node - Information about a DUT node. Type: dictionary
70 | | ... | - data - LISP settings to use. Type: dictionary
74 | | ... | \| Honeycomb adds LISP GPE Mapping \| ${nodes['DUT1']} \| ${data} \|
76 | | [Arguments] | ${node} | ${data}
78 | | Add LISPGPE Mapping | ${node} | ${data['id']} | ${data}
80 | Honeycomb removes LISP GPE mapping
81 | | [Documentation] | Uses Honeycomb API to remove the specified mapping.
83 | | ... | *Arguments:*
84 | | ... | - node - Information about a DUT node. Type: dictionary
88 | | ... | \| Honeycomb removes LISP GPE mapping \| ${nodes['DUT1']} \
89 | | ... | \| map_name \|
91 | | [Arguments] | ${node} | ${mapping}
93 | | Delete LISPGPE mapping | ${node} | ${mapping}
95 | LISP GPE should not be configured
96 | | [Documentation] | Retrieves LISP GPE configuration from Honeycomb operational\
97 | | ... | data, and expects an empty dictionary.
99 | | ... | *Arguments:*
100 | | ... | - node - Information about a DUT node. Type: dictionary
104 | | ... | \| LISP GPE should not be configured \| ${nodes['DUT1']} \|
106 | | [Arguments] | ${node}
108 | | ${data}= | Get LISP GPE operational data | ${node}
110 | | ... | ${data['gpe-state']['gpe-feature-data']['enable']} | ${FALSE}
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.
116 | | ... | *Arguments:*
117 | | ... | - node - Information about a DUT node. Type: dictionary
118 | | ... | - state - Expected LISP state. Type: string
122 | | ... | \| LISP GPE state from Honeycomb should be \| ${nodes['DUT1']} \
123 | | ... | \| enabled \|
125 | | [Arguments] | ${node} | ${state}
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}
135 | LISP GPE state from VAT should be
136 | | [Documentation] | Retrieves LISP state from VAT,\
137 | | ... | and compares LISP state with expected value.
139 | | ... | *Arguments:*
140 | | ... | - node - Information about a DUT node. Type: dictionary
141 | | ... | - state - Expected LISP state. Type: string
145 | | ... | \| LISP state from VAT should be \| ${nodes['DUT1']} \| enabled \|
147 | | [Arguments] | ${node} | ${state}
149 | | ${status}= | VPP show LISP State | ${node}
150 | | Should match | ${status['gpe_status']} | ${state}
152 | LISP GPE mapping from Honeycomb should be
153 | | [Documentation] | Retrieves LISP GPE mapping from Honeycomb operational\
154 | | ... | data, and compares with expected data.
156 | | ... | *Arguments:*
157 | | ... | - node - Information about a DUT node. Type: dictionary
158 | | ... | - settings - Expected LISP mapping data. Type: dictionary
162 | | ... | \| LISP GPE mapping from Honeycomb should be \| ${nodes['DUT1']} \
163 | | ... | \| ${settings} \|
165 | | [Arguments] | ${node} | ${settings}
167 | | ${data}= | Get LISPGPE mapping | ${node} | ${settings['id']}
168 | | Compare data structures | ${data} | ${settings}
170 | LISP GPE mappings from Honeycomb should not exist
171 | | [Documentation] | Retrieves LISP GPE mappings from operational\
172 | | ... | data, and expects to find none.
174 | | ... | *Arguments:*
175 | | ... | - node - Information about a DUT node. Type: dictionary
179 | | ... | \| LISP GPE mappings from Honeycomb should not exist \
180 | | ... | \| ${nodes['DUT1']} \|
182 | | [Arguments] | ${node}
184 | | ${data}= | Get LISPGPE operational data | ${node}
185 | | Variable Should Not Exist
186 | | ... | ${data['gpe-state']['gpe-feature-data']['gpe-entry']}
188 | Honeycomb disables all LISP GPE features
189 | | [Documentation] | Uses Honeycomb API to remove all LISP GPE configuration.
191 | | ... | *Arguments:*
192 | | ... | - node - Information about a DUT node. Type: dictionary
196 | | ... | \| Honeycomb disables all LISP GPE features \| ${nodes['DUT1']} \|
198 | | [Arguments] | ${node}
200 | | Disable LISPGPE | ${node}
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.
206 | | ... | *Arguments:*
208 | | ... | _NOTE:_ Arguments are based on topology:
209 | | ... | TG(if1)->(if1)DUT(if2)->TG(if2)
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
224 | | ... | - No value returned
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 \|
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}
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}
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}