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