0ffcb8909a4ec5bd89f9d166d9d7357b4e48bf8c
[csit.git] / tests / func / lisp / lisp_ipv4_lispgpe_ipv4.robot
1 # Copyright (c) 2016 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.topology.Topology
16 | Library | resources.libraries.python.NodePath
17 | Library | resources.libraries.python.Trace
18 | Library | resources.libraries.python.IPUtil
19 | Library | resources.libraries.python.LispUtil
20 | Resource | resources/libraries/robot/traffic.robot
21 | Resource | resources/libraries/robot/default.robot
22 | Resource | resources/libraries/robot/interfaces.robot
23 | Resource | resources/libraries/robot/testing_path.robot
24 | Resource | resources/libraries/robot/ipv4.robot
25 | Resource | resources/libraries/robot/lisp/lispgpe.robot
26 # Import configuration and test data:
27 | Variables | resources/test_data/lisp/ipv4_lispgpe_ipv4/ipv4_lispgpe_ipv4.py
28 | ...
29 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV
30 | ...
31 | Test Setup | Run Keywords | Setup all DUTs before test
32 | ...        | AND          | Setup all TGs before traffic script
33 | ...        | AND          | Update All Interface Data On All Nodes | ${nodes}
34 | Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
35 | ...           | AND          | Show vpp trace dump on all DUTs
36 | ...           | AND          | VPP Show Errors | ${nodes['DUT1']}
37 | ...           | AND          | VPP Show Errors | ${nodes['DUT2']}
38 | ...
39 | Documentation | *ip4-lispgpe-ip4 encapsulation test cases*
40 | ...
41 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology
42 | ... | with single links between nodes.
43 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-LISP-IPv4-ICMPv4 on DUT1-DUT2,
44 | ... | Eth-IPv4-ICMPv4 on TG-DUTn for IPv4 routing over LISPoIPv4 tunnel.
45 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv4
46 | ... | routing and static routes. LISPoIPv4 tunnel is configured between
47 | ... | DUT1 and DUT2.
48 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets are sent in
49 | ... | both directions by TG on links to DUT1 and DUT2; on receive
50 | ... | TG verifies packets for correctness and their IPv4 src-addr, dst-addr
51 | ... | and MAC addresses.
52 | ... | *[Ref] Applicable standard specifications:* RFC6830.
53
54 *** Test Cases ***
55 | TC01: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using physical interfaces
56 | | [Documentation]
57 | | ... | Case: ip4-lispgpe-ip4 - phy2lisp \
58 | | ... | [Top] TG-DUT1-DUT2-TG.
59 | | ... | [Enc] Eth-IPv4-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on
60 | | ... | TG-DUTn.
61 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2.
62 | | ... | [Ver] Make TG send ICMPv4 Echo Req between its interfaces across both
63 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on received
64 | | ... | packets are correct.
65 | | ... | [Ref] RFC6830.
66 | | ...
67 | | Given Path for 3-node testing is set
68 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
69 | | And Interfaces in 3-node path are up
70 | | And IP addresses are set on interfaces
71 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip4} | ${prefix4}
72 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${prefix4}
73 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip4} | ${prefix4}
74 | | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip4} | ${prefix4}
75 | | And VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4}
76 | | And VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4}
77 | | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
78 | | ... | ${tg_to_dut2_mac}
79 | | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
80 | | ... | ${tg_to_dut1_mac}
81 | | When Set up LISP GPE topology
82 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
83 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
84 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
85 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
86 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
87 | | Then Send Packet And Check Headers
88 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
89 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
90 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
91 | | And Send Packet And Check Headers
92 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
93 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
94 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
95
96 | TC02: DUT1 and DUT2 route IPv4 bidirectionally over LISP GPE tunnel using physical interfaces and VRF is enabled
97 | | [Documentation]
98 | | ... | Case: ip4-lispgpe-ip4 - vrf, phy2lisp \
99 | | ... | [Top] TG-DUT1-DUT2-TG.
100 | | ... | [Enc] Eth-IPv4-LISPGPE-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on
101 | | ... | TG-DUTn.
102 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2.
103 | | ... | [Ver] Make TG send ICMPv4 Echo Req between its interfaces across both
104 | | ... | DUTs and LISP GPE tunnel between them; verify IPv4 headers on received
105 | | ... | packets are correct.
106 | | ... | [Ref] RFC6830.
107 | | ...
108 | | Given Path for 3-node testing is set
109 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
110 | | And Interfaces in 3-node path are up
111 | | When Setup VRF on DUT | ${dut1_node} | ${dut1_fib_table} | ${dut1_to_dut2}
112 | | ... | ${dut2_to_dut1_ip4} | ${dut2_to_dut1_mac} | ${tg2_ip4} | ${dut1_to_tg}
113 | | ... | ${tg1_ip4} | ${tg_to_dut1_mac} | ${prefix4}
114 | | And Setup VRF on DUT | ${dut2_node} | ${dut2_fib_table} | ${dut2_to_dut1}
115 | | ... | ${dut1_to_dut2_ip4} | ${dut1_to_dut2_mac} | ${tg1_ip4} | ${dut2_to_tg}
116 | | ... | ${tg2_ip4} | ${tg_to_dut2_mac} | ${prefix4}
117 | | And IP addresses are set on interfaces
118 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip4} | ${prefix4}
119 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip4} | ${prefix4}
120 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip4} | ${prefix4}
121 | | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip4} | ${prefix4}
122 | | And Set up LISP GPE topology
123 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
124 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
125 | | ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
126 | | ... | ${dut1_to_dut2_ip4_static_adjacency}
127 | | ... | ${dut2_to_dut1_ip4_static_adjacency}
128 | | Then Send Packet And Check Headers
129 | | ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
130 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
131 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
132 | | And Send Packet And Check Headers
133 | | ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
134 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
135 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
136
137 *** Keywords ***
138 | Setup VRF on DUT
139 | | [Documentation]
140 | | ... | The keyword sets a FIB table on a DUT, assigns two interfaces to it,\
141 | | ... | adds two ARP items and a route, see example.
142 | | ...
143 | | ... | *Example:*
144 | | ... | Three-node topology:
145 | | ... | TG_if1 - DUT1_if1-DUT1_if2 - DUT2_if1-DUT2_if2 - TG_if2
146 | | ... | Create one VRF on each DUT:
147 | | ... | \| Setup VRF on DUT \| ${dut1_node} \| ${dut1_fib_table} \
148 | | ... | \| ${dut1_to_dut2} \| ${dut2_to_dut1_ip4} \| ${dut2_to_dut1_mac} \
149 | | ... | \| ${tg2_ip4} \| ${dut1_to_tg} \| ${tg1_ip4} \| ${tg_to_dut1_mac} \
150 | | ... | \| 24 \|
151 | | ... | \| Setup VRF on DUT \| ${dut2_node} \| ${dut2_fib_table} \
152 | | ... | \| ${dut2_to_dut1} \| ${dut1_to_dut2_ip4} \| ${dut1_to_dut2_mac} \
153 | | ... | \| ${tg1_ip4} \| ${dut2_to_tg} \| ${tg2_ip4} \| ${tg_to_dut2_mac} \
154 | | ... | \| 24 \|
155 | | ...
156 | | [Arguments]
157 | | ... | ${node} | ${table} | ${route_interface} | ${route_gateway_ip}
158 | | ... | ${route_gateway_mac} | ${route_dst_ip} | ${vrf_src_if} | ${src_if_ip}
159 | | ... | ${src_if_mac} | ${prefix_len}
160 | | ...
161 | | ${route_interface_idx}= | Get Interface SW Index
162 | | ... | ${node} | ${route_interface}
163 | | ...
164 | | Add fib table | ${node}
165 | | ... | ${route_dst_ip} | ${prefix_len} | ${table}
166 | | ... | via ${route_gateway_ip} sw_if_index ${route_interface_idx} multipath
167 | | ...
168 | | Assign Interface To Fib Table
169 | | ... | ${node} | ${route_interface} | ${table}
170 | | Assign Interface To Fib Table
171 | | ... | ${node} | ${vrf_src_if} | ${table}
172 | | ...
173 | | Add Arp On Dut | ${node} | ${vrf_src_if}
174 | | ... | ${src_if_ip} | ${src_if_mac} | vrf=${table}
175 | | Add Arp On Dut | ${node} | ${route_interface}
176 | | ... | ${route_gateway_ip} | ${route_gateway_mac} | vrf=${table}
177 | | ...
178 | | Vpp Route Add | ${node} | ${route_dst_ip} | ${prefix_len}
179 | | ... | ${route_gateway_ip} | ${route_interface} | vrf=${table}