HC2VPP-331: Fix Honeycomb fails to assign VRF to interface
[csit.git] / tests / honeycomb / func / mgmt-cfg-routing-apihc-apivat-func.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.Routing.RoutingKeywords
16 | Library | resources.libraries.python.Trace
17 | Library | resources.libraries.python.InterfaceUtil
18 | Resource | resources/libraries/robot/shared/default.robot
19 | Resource | resources/libraries/robot/shared/testing_path.robot
20 | Resource | resources/libraries/robot/ip/ip4.robot
21 | Resource | resources/libraries/robot/ip/ip6.robot
22 | Resource | resources/libraries/robot/honeycomb/honeycomb.robot
23 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
24 | Resource | resources/libraries/robot/honeycomb/routing.robot
25 | Resource | resources/libraries/robot/honeycomb/fib.robot
26 | ...
27 | Test Setup | Clear Packet Trace on All DUTs | ${nodes}
28 | ...
29 | Suite Setup | Set Up Honeycomb Functional Test Suite | ${node}
30 | ...
31 | Suite Teardown | Tear Down Honeycomb Functional Test Suite | ${node}
32 | ...
33 | Test Teardown | Honeycomb routing test teardown | ${node} | ${table}
34 | ...
35 | Documentation | *Honeycomb routing test suite.*
36 | ...
37 | Force Tags | HC_FUNC
38
39 *** Test Cases ***
40 | TC01: Single hop IPv4 route
41 | | [Documentation]
42 | | ... | [Top] TG=DUT1=TG.
43 | | ... | [Enc] Eth-IPv4-ICMP.
44 | | ... | [Cfg] (Using Honeycomb API) On DUT1 add ARP entries to both TG\
45 | | ... | interfaces and configure route with TG-if2 as next-hop.
46 | | ... | [Ver] Send ICMP packet from first TG interface to configured route
47 | | ... | destination. Receive packet on the second TG interface.
48 | | ...
49 | | ${table}= | Set Variable | table1
50 | | Given Setup interfaces and neighbors for IPv4 routing test
51 | | When Honeycomb configures routing table
52 | | ... | ${node} | table1 | ipv4 | ${table1} | ${1}
53 | | Then Routing data from Honeycomb should contain
54 | | ... | ${node} | table1 | ipv4 | ${table1_oper}
55 | | And Verify route IPv4 | ${nodes['TG']}
56 | | ... | ${src_ip} | ${dst_ip}
57 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
58 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
59
60 | TC02: Multi hop IPv4 route
61 | | [Documentation]
62 | | ... | [Top] TG=DUT1=TG.
63 | | ... | [Enc] Eth-IPv4-ICMP.
64 | | ... | [Cfg] (Using Honeycomb API) On DUT1 add ARP entries to both TG\
65 | | ... | interfaces and configure two routes through the second DUT interface.
66 | | ... | [Ver] Send 100 ICMP packets from first TG interface to configured
67 | | ... | route destination. Receive all packets on the second TG interface and\
68 | | ... | verify that each destination MAC was used by exactly 50 packets.
69 | | ... | Receive packet on the second TG interface.
70 | | ...
71 | | ${table}= | Set Variable | table2
72 | | Given Setup interfaces and neighbors for IPv4 routing test
73 | | And Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if2}
74 | | ... | ${next_hop1} | ${next_hop_mac1}
75 | | And Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if2}
76 | | ... | ${next_hop2} | ${next_hop_mac2}
77 | | ...
78 | | When Honeycomb configures routing table
79 | | ... | ${node} | table2 | ipv4 | ${table2} | ${1}
80 | | Then Routing data from Honeycomb should contain
81 | | ... | ${node} | table2 | ipv4 | ${table2_oper}
82 | | And Verify multipath Route | ${nodes['TG']}
83 | | ... | ${src_ip} | ${dst_ip}
84 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
85 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
86 | | ... | ${dut_to_tg_if2_mac} | ${next_hop_mac1} | ${next_hop_mac2}
87
88 | TC03: Special hop - blackhole IPv4 route
89 | | [Documentation]
90 | | ... | [Top] TG=DUT1=TG.
91 | | ... | [Enc] Eth-IPv4-ICMP.
92 | | ... | [Cfg] (Using Honeycomb API) On DUT1 add ARP entries to both TG\
93 | | ... | interfaces and configure route with special rule blackhole.
94 | | ... | [Ver] Send ICMP packet from first TG interface to configured route
95 | | ... | destination. Make sure no packet is received on the second TG\
96 | | ... | interface.
97 | | ...
98 | | ${table}= | Set Variable | table3
99 | | Given Setup interfaces and neighbors for IPv4 routing test
100 | | When Honeycomb configures routing table
101 | | ... | ${node} | table3 | ipv4 | ${table3} | ${1} | special=${TRUE}
102 | | Then Routing data from Honeycomb should contain
103 | | ... | ${node} | table3 | ipv4 | ${table3_oper}
104 | | And Run keyword and Expect Error | ICMP echo Rx timeout
105 | | ... | Verify route IPv4 | ${nodes['TG']}
106 | | ... | ${src_ip} | ${dst_ip}
107 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
108 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
109
110 | TC04: Single hop IPv6 route
111 | | [Documentation]
112 | | ... | [Top] TG=DUT1=TG.
113 | | ... | [Enc] Eth-IPv6-ICMPv6.
114 | | ... | [Cfg] (Using Honeycomb API) On DUT1 add ARP entries to both TG\
115 | | ... | interfaces and configure route with TG-if2 as next-hop.
116 | | ... | [Ver] Send ICMP packet from first TG interface to configured route
117 | | ... | destination. Receive packet on the second TG interface.
118 | | ...
119 | | ${table}= | Set Variable | table4
120 | | Given Setup interfaces and neighbors for IPv6 routing test
121 | | When Honeycomb configures routing table
122 | | ... | ${node} | table4 | ipv6 | ${table4} | ${1}
123 | | Then Routing data from Honeycomb should contain
124 | | ... | ${node} | table4 | ipv6 | ${table4_oper}
125 | | And Verify route IPv6 | ${nodes['TG']}
126 | | ... | ${src_ip} | ${next_hop}
127 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
128 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
129
130 | TC05: Multi hop IPv6 route
131 | | [Documentation]
132 | | ... | [Top] TG=DUT1=TG.
133 | | ... | [Enc] Eth-IPv6-ICMPv6.
134 | | ... | [Cfg] (Using Honeycomb API) On DUT1 add ARP entries to both TG\
135 | | ... | interfaces and configure two routes through the second DUT interface.
136 | | ... | [Ver] Send 100 ICMP packets from first TG interface to configured
137 | | ... | route destination. Receive all packets on the second TG interface and\
138 | | ... | verify that each destination MAC was used by exactly 50 packets.
139 | | ... | Receive packet on the second TG interface.
140 | | ...
141 | | ${table}= | Set Variable | table5
142 | | Given Setup interfaces and neighbors for IPv6 routing test
143 | | And Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if2}
144 | | ... | ${next_hop1} | ${next_hop_mac1}
145 | | And Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if2}
146 | | ... | ${next_hop2} | ${next_hop_mac2}
147 | | When Honeycomb configures routing table
148 | | ... | ${node} | table5 | ipv6 | ${table5} | ${1}
149 | | Then Routing data from Honeycomb should contain
150 | | ... | ${node} | table5 | ipv6 | ${table5_oper}
151 | | And Verify multipath Route | ${nodes['TG']}
152 | | ... | ${src_ip} | ${dst_ip}
153 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
154 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
155 | | ... | ${dut_to_tg_if2_mac} | ${next_hop_mac1} | ${next_hop_mac2}
156
157 | TC06: Special hop - blackhole IPv6 route
158 | | [Documentation]
159 | | ... | [Top] TG=DUT1=TG.
160 | | ... | [Enc] Eth-IPv6-ICMPv6.
161 | | ... | [Cfg] (Using Honeycomb API) On DUT1 add ARP entries to both TG\
162 | | ... | interfaces and configure route with special rule blackhole.
163 | | ... | [Ver] Send ICMP packet from first TG interface to configured route
164 | | ... | destination. Make sure no packet is received on the second TG\
165 | | ... | interface.
166 | | ...
167 | | ${table}= | Set Variable | table6
168 | | Given Setup interfaces and neighbors for IPv6 routing test
169 | | When Honeycomb configures routing table
170 | | ... | ${node} | table6 | ipv6 | ${table6} | ${1} | special=${TRUE}
171 | | Then Routing data from Honeycomb should contain
172 | | ... | ${node} | table6 | ipv6 | ${table6_oper}
173 | | And Run keyword and Expect Error | ICMP echo Rx timeout
174 | | ... | Verify route IPv6 | ${nodes['TG']}
175 | | ... | ${src_ip} | ${dst_ip}
176 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
177 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
178
179 *** Keywords ***
180 | Setup interfaces and neighbors for IPv4 routing test
181 | | Configure path in 2-node circular topology
182 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
183 | | Import Variables | resources/test_data/honeycomb/routing.py
184 | | ... | ${nodes['DUT1']} | ipv4 | ${dut_to_tg_if2}
185 | | Setup vrf FIBs | ${dut_node} | ${1}
186 | | Setup vrf IDs | ${dut_node} | ${dut_to_tg_if1} | ${1}
187 | | Setup vrf IDs | ${dut_node} | ${dut_to_tg_if2} | ${1}
188 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1} | up
189 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2} | up
190 | | Vpp Node Interfaces Ready Wait | ${dut_node}
191 | | Honeycomb sets interface IPv4 address with prefix | ${dut_node}
192 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_len}
193 | | Honeycomb sets interface IPv4 address with prefix | ${dut_node}
194 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_len}
195 | | Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if1}
196 | | ... | ${src_ip} | ${tg_to_dut_if1_mac}
197 | | Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if2}
198 | | ... | ${next_hop} | ${tg_to_dut_if2_mac}
199
200 | Setup interfaces and neighbors for IPv6 routing test
201 | | Configure path in 2-node circular topology
202 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
203 | | Import Variables | resources/test_data/honeycomb/routing.py
204 | | ... | ${nodes['DUT1']} | ipv6 | ${dut_to_tg_if2}
205 | | Setup vrf FIBs | ${dut_node} | ${1}
206 | | Setup vrf IDs | ${dut_node} | ${dut_to_tg_if1} | ${1}
207 | | Setup vrf IDs | ${dut_node} | ${dut_to_tg_if2} | ${1}
208 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1} | up
209 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2} | up
210 | | Vpp Node Interfaces Ready Wait | ${dut_node}
211 | | Honeycomb sets interface IPv6 address | ${dut_node}
212 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_len}
213 | | Honeycomb sets interface IPv6 address | ${dut_node}
214 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_len}
215 | | Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if1}
216 | | ... | ${src_ip} | ${tg_to_dut_if1_mac}
217 | | Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if2}
218 | | ... | ${next_hop} | ${tg_to_dut_if2_mac}
219 | | Vpp all ra suppress link layer | ${nodes}
220
221 | Honeycomb routing test teardown
222 | | ...
223 | | [arguments] | ${node} | ${routing_table}
224 | | ...
225 | | Show Packet Trace on All DUTs | ${nodes}
226 | | Log routing configuration from VAT | ${node}
227 | | Honeycomb removes routing configuration | ${node} | ${routing_table}
228 | | Remove vrf FIBs | ${node} | ${1}
229
230 | Setup vrf IDs
231 | | ...
232 | | [Arguments] | ${node} | ${interface} | ${vrf}
233 | | ...
234 | | Honeycomb sets interface VRF ID
235 | | ... | ${node} | ${interface} | ${vrf} | ipv4
236 | | Honeycomb sets interface VRF ID
237 | | ... | ${node} | ${interface} | ${vrf} | ipv6
238
239 | Setup vrf FIBs
240 | | ...
241 | | [Arguments] | ${node} | ${vrf}
242 | | ...
243 | | Honeycomb configures FIB table | ${node} | ipv4 | ${vrf}
244 | | Honeycomb configures FIB table | ${node} | ipv6 | ${vrf}
245
246 | Remove vrf FIBs
247 | | ...
248 | | [Arguments] | ${node} | ${vrf}
249 | | ...
250 | | Honeycomb removes FIB configuration | ${node} | ipv4 | ${vrf}
251 | | Honeycomb removes FIB configuration | ${node} | ipv6 | ${vrf}