CSIT-128: Remove EXPECTED_FAILING tag from VXLAN over IPv6 test cases
[csit.git] / tests / suites / gre / gre_encapsulation.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 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/testing_path.robot
17 | Resource | resources/libraries/robot/ipv4.robot
18 | Resource | resources/libraries/robot/gre.robot
19 | Resource | resources/libraries/robot/traffic.robot
20 | Library  | resources.libraries.python.IPUtil
21 | Library  | resources.libraries.python.Trace
22 | Force Tags | VM_ENV | HW_ENV
23 | Test Setup | Run Keywords | Setup all DUTs before test
24 | ...        | AND          | Setup all TGs before traffic script
25 | Test Teardown | Show Packet Trace on All DUTs | ${nodes}
26 | Documentation | *GRE test suite.*
27 | ...
28 | ... | Test suite uses 2-node topology TG - DUT1 - TG with two links
29 | ... | between nodes as well as 3-node topology TG - DUT1 - DUT2 - TG
30 | ... | with one link between nodes. Test packets are sent from TG to DUT1.
31 | ... | DUT1 encapsulate packet into GRE and send out from other interface.
32 | ... | Traffic scripts check received MAC headers, IP headers and GRE headers.
33
34 *** Variables ***
35 | ${net1_address}= | 192.168.0.0
36 | ${net1_host_address}= | 192.168.0.100
37 | ${net1_gw_address}= | 192.168.0.1
38 | ${net2_address}= | 192.168.2.0
39 | ${net2_host_address}= | 192.168.2.100
40 | ${net2_gw_address}= | 192.168.2.1
41 | ${dut1_ip_address}= | 192.168.1.1
42 | ${dut2_ip_address}= | 192.168.1.2
43 | ${dut1_gre_ip}= | 172.16.0.1
44 | ${dut2_gre_ip}= | 172.16.0.2
45 | ${prefix}= | 24
46
47 *** Test Cases ***
48 | VPP can route IPv4 traffic from GRE tunnel
49 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO
50 | | [Documentation] | Create GRE configuration on 2 DUTs, send IP traffic and
51 | | ...             | check IP is not changed.
52 | | Given Path for 3-node testing is set | ${nodes['TG']} | ${nodes['DUT1']}
53 | |       ... | ${nodes['DUT2']} | ${nodes['TG']}
54 | | And   Interfaces in 3-node path are up
55 | | And   IP addresses are set on interfaces
56 | |       ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_ip_address} | ${prefix}
57 | |       ... | ${dut1_node} | ${dut1_to_tg}   | ${net1_gw_address} | ${prefix}
58 | |       ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_ip_address} | ${prefix}
59 | |       ... | ${dut2_node} | ${dut2_to_tg}   | ${net2_gw_address} | ${prefix}
60 | | And   VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_ip_address}
61 | | And   VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_ip_address}
62 | | And   Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${net2_host_address}
63 | |       ... | ${tg_to_dut2_mac}
64 | | ${dut1_gre_interface} | ${dut1_gre_index}=
65 | | | ... | When GRE tunnel interface is created and up
66 | | |     |      ... | ${dut1_node} | ${dut1_ip_address} | ${dut2_ip_address}
67 | | ${dut2_gre_interface} | ${dut2_gre_index}=
68 | | | ... | And  GRE tunnel interface is created and up
69 | | |     |      ... | ${dut2_node} | ${dut2_ip_address} | ${dut1_ip_address}
70 | | And  IP addresses are set on interfaces
71 | |      ... | ${dut1_node} | ${dut1_gre_index} | ${dut1_gre_ip} | ${prefix}
72 | |      ... | ${dut2_node} | ${dut2_gre_index} | ${dut2_gre_ip} | ${prefix}
73 | | And  Vpp Route Add | ${dut1_node} | ${net2_address} | ${prefix}
74 | |      ... | ${dut2_gre_ip} | ${dut1_gre_index}
75 | | Then Send Packet And Check Headers | ${tg_node}
76 | |      ... | ${net1_host_address} | ${net2_host_address}
77 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
78 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
79
80
81 | VPP can encapsulate IPv4 traffic in GRE
82 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO
83 | | [Documentation] | Create GRE configuration on DUT, send IP traffic and
84 | | ...             | check IP is correctly encapsulate into GRE.
85 | | Given Path for 2-node testing is set
86 | |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
87 | | And   Interfaces in 2-node path are up
88 | | And   IP addresses are set on interfaces
89 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut1_ip_address} | ${prefix}
90 | |       ... | ${dut_node} | ${dut_to_tg_if1} | ${net1_gw_address} | ${prefix}
91 | | And  Add Arp On Dut | ${dut_node} | ${dut_to_tg_if2} | ${dut2_ip_address}
92 | |      ... | ${tg_to_dut_if2_mac}
93 | | ${dut1_gre_interface} | ${dut1_gre_index}=
94 | | | ... | When GRE tunnel interface is created and up
95 | | |     |      ... | ${dut_node} | ${dut1_ip_address} | ${dut2_ip_address}
96 | | And  IP addresses are set on interfaces
97 | |      ... | ${dut_node} | ${dut1_gre_index} | ${dut1_gre_ip} | ${prefix}
98 | | And  Vpp Route Add | ${dut_node} | ${net2_address} | ${prefix}
99 | |      ... | ${dut2_gre_ip} | ${dut1_gre_index}
100 | | Then Send ICMPv4 and check received GRE header
101 | |      ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2}
102 | |      ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if2_mac}
103 | |      ... | ${net1_host_address} | ${net2_host_address}
104 | |      ... | ${dut1_ip_address} | ${dut2_ip_address}
105
106
107 | VPP can decapsulate IPv4 traffic in GRE
108 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO
109 | | [Documentation] | Create GRE configuration on DUT, send GRE encapsulated
110 | | ...             | traffic and  check IP is received without GRE headers.
111 | | Given Path for 2-node testing is set
112 | |       ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
113 | | And   Interfaces in 2-node path are up
114 | | And   IP addresses are set on interfaces
115 | |       ... | ${dut_node} | ${dut_to_tg_if2} | ${dut1_ip_address} | ${prefix}
116 | |       ... | ${dut_node} | ${dut_to_tg_if1} | ${net1_gw_address} | ${prefix}
117 | | And  Add Arp On Dut | ${dut_node} | ${dut_to_tg_if1} | ${net1_host_address}
118 | |      ... | ${tg_to_dut_if1_mac}
119 | | ${dut1_gre_interface} | ${dut1_gre_index}=
120 | | | ... | When GRE tunnel interface is created and up
121 | | |     |      ... | ${dut_node} | ${dut1_ip_address} | ${dut2_ip_address}
122 | | And  IP addresses are set on interfaces
123 | |      ... | ${dut_node} | ${dut1_gre_index} | ${dut1_gre_ip} | ${prefix}
124 | | Then Send GRE and check received ICMPv4 header
125 | |      ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1}
126 | |      ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if1_mac}
127 | |      ... | ${net2_host_address} | ${net1_host_address}
128 | |      ... | ${dut2_ip_address} | ${dut1_ip_address}