HC Tests: fix packet trace library settings
[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
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 | | ${table}= | Set Variable | table4
117 | | Given Setup interfaces and neighbors for IPv6 routing test
118 | | When Honeycomb configures routing table
119 | | ... | ${node} | table4 | ipv6 | ${table4} | ${1}
120 | | Then Routing data from Honeycomb should contain
121 | | ... | ${node} | table4 | ipv6 | ${table4_oper}
122 | | And Verify route IPv6 | ${nodes['TG']}
123 | | ... | ${src_ip} | ${next_hop}
124 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
125 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
126
127 | TC05: Multi hop IPv6 route
128 | | [Documentation]
129 | | ... | [Top] TG=DUT1=TG.
130 | | ... | [Enc] Eth-IPv6-ICMPv6.
131 | | ... | [Cfg] (Using Honeycomb API) On DUT1 add ARP entries to both TG\
132 | | ... | interfaces and configure two routes through the second DUT interface.
133 | | ... | [Ver] Send 100 ICMP packets from first TG interface to configured
134 | | ... | route destination. Receive all packets on the second TG interface and\
135 | | ... | verify that each destination MAC was used by exactly 50 packets.
136 | | ... | Receive packet on the second TG interface.
137 | | ...
138 | | ${table}= | Set Variable | table5
139 | | Given Setup interfaces and neighbors for IPv6 routing test
140 | | And Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if2}
141 | | ... | ${next_hop1} | ${next_hop_mac1}
142 | | And Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if2}
143 | | ... | ${next_hop2} | ${next_hop_mac2}
144 | | When Honeycomb configures routing table
145 | | ... | ${node} | table5 | ipv6 | ${table5} | ${1}
146 | | Then Routing data from Honeycomb should contain
147 | | ... | ${node} | table5 | ipv6 | ${table5_oper}
148 | | And Verify multipath Route | ${nodes['TG']}
149 | | ... | ${src_ip} | ${dst_ip}
150 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
151 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
152 | | ... | ${dut_to_tg_if2_mac} | ${next_hop_mac1} | ${next_hop_mac2}
153
154 | TC06: Special hop - blackhole IPv6 route
155 | | [Documentation]
156 | | ... | [Top] TG=DUT1=TG.
157 | | ... | [Enc] Eth-IPv6-ICMPv6.
158 | | ... | [Cfg] (Using Honeycomb API) On DUT1 add ARP entries to both TG\
159 | | ... | interfaces and configure route with special rule blackhole.
160 | | ... | [Ver] Send ICMP packet from first TG interface to configured route
161 | | ... | destination. Make sure no packet is received on the second TG\
162 | | ... | interface.
163 | | ...
164 # HC2VPP-254 Operational data for Blackhole IPv6 route is incorrect
165 | | [Tags] | EXPECTED_FAILING
166 | | ${table}= | Set Variable | table6
167 | | Given Setup interfaces and neighbors for IPv6 routing test
168 | | When Honeycomb configures routing table
169 | | ... | ${node} | table6 | ipv6 | ${table6} | ${1} | special=${TRUE}
170 | | Then Routing data from Honeycomb should contain
171 | | ... | ${node} | table6 | ipv6 | ${table6_oper}
172 | | And Run keyword and Expect Error | ICMP echo Rx timeout
173 | | ... | Verify route IPv6 | ${nodes['TG']}
174 | | ... | ${src_ip} | ${dst_ip}
175 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac}
176 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if1_mac}
177
178 *** Keywords ***
179 | Setup interfaces and neighbors for IPv4 routing test
180 | | Configure path in 2-node circular topology
181 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
182 | | Import Variables | resources/test_data/honeycomb/routing.py
183 | | ... | ${nodes['DUT1']} | ipv4 | ${dut_to_tg_if2}
184 | | Setup vrf IDs | ${dut_node} | ${dut_to_tg_if1} | ${1}
185 | | Setup vrf IDs | ${dut_node} | ${dut_to_tg_if2} | ${1}
186 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1} | up
187 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2} | up
188 | | Honeycomb sets interface IPv4 address with prefix | ${dut_node}
189 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_len}
190 | | Honeycomb sets interface IPv4 address with prefix | ${dut_node}
191 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_len}
192 | | Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if1}
193 | | ... | ${src_ip} | ${tg_to_dut_if1_mac}
194 | | Honeycomb adds interface IPv4 neighbor | ${dut_node} | ${dut_to_tg_if2}
195 | | ... | ${next_hop} | ${tg_to_dut_if2_mac}
196
197 | Setup interfaces and neighbors for IPv6 routing test
198 | | Configure path in 2-node circular topology
199 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
200 | | Import Variables | resources/test_data/honeycomb/routing.py
201 | | ... | ${nodes['DUT1']} | ipv6 | ${dut_to_tg_if2}
202 | | Honeycomb sets interface VRF ID
203 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${1} | ipv6
204 | | Honeycomb sets interface VRF ID
205 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${1} | ipv6
206 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1} | up
207 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2} | up
208 | | Honeycomb sets interface IPv6 address | ${dut_node}
209 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_len}
210 | | Honeycomb sets interface IPv6 address | ${dut_node}
211 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_len}
212 | | Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if1}
213 | | ... | ${src_ip} | ${tg_to_dut_if1_mac}
214 | | Honeycomb adds interface IPv6 neighbor | ${dut_node} | ${dut_to_tg_if2}
215 | | ... | ${next_hop} | ${tg_to_dut_if2_mac}
216 | | Vpp all ra suppress link layer | ${nodes}
217
218 | Honeycomb routing test teardown
219 | | ...
220 | | [arguments] | ${node} | ${routing_table}
221 | | ...
222 | | Show Packet Trace on All DUTs | ${nodes}
223 | | Log routing configuration from VAT | ${node}
224 | | Honeycomb removes routing configuration | ${node} | ${routing_table}
225
226 | Setup vrf IDs
227 | | ...
228 | | [Arguments] | ${node} | ${interface} | ${vrf}
229 | | ...
230 | | Honeycomb sets interface VRF ID
231 | | ... | ${node} | ${interface} | ${vrf} | ipv4
232 | | Honeycomb sets interface VRF ID
233 | | ... | ${node} | ${interface} | ${vrf} | ipv6

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.