d5b89ec594a4d3be0c3739f852591100959188f5
[csit.git] / tests / vpp / func / ip4 / eth2p-dot1q-ip4base-func.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/shared/default.robot
16 | Resource | resources/libraries/robot/shared/testing_path.robot
17 | Resource | resources/libraries/robot/ip/ip4.robot
18 | Resource | resources/libraries/robot/l2/tagging.robot
19 | Resource | resources/libraries/robot/shared/traffic.robot
20 | Library  | resources.libraries.python.Trace
21 | Library | resources.libraries.python.IPv6Util
22 | Force Tags | 3_NODE_DOUBLE_LINK_TOPO | VM_ENV | HW_ENV | VPP_VM_ENV
23 | ... | SKIP_VPP_PATCH
24 | Test Setup | Set up functional test
25 | Test Teardown | Tear down functional test
26 | Documentation | *IPv4 with VLAN subinterfaces*
27 | ...
28 | ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology
29 | ... | with double links between nodes.
30 | ... | *[Enc] Packet encapsulations:* Eth-IPv4-ICMPv4 on TG-DUT1-IF1,
31 | ... | Eth-dot1q-IPv4-ICMPv4 on TG-DUT1-IF2.
32 | ... | *[Cfg] DUT configuration:* DUT1 is configured with 2 Vlan subinterfaces
33 | ... | on DUT1-IF2. The subinterfaces and DUT1-IF1 have IP addresses set and
34 | ... | corresponding IP neighbor entries are configured.
35 | ... | *[Ref] Applicable standard specifications:* IEEE 802.1q.
36
37 *** Variables ***
38
39 | ${ip4_net0_1}= | 192.168.0.1
40 | ${ip4_net0_2}= | 192.168.0.2
41 | ${ip4_net1_1}= | 192.168.100.1
42 | ${ip4_net1_2}= | 192.168.100.2
43 | ${ip4_net2_1}= | 192.168.200.1
44 | ${ip4_net2_2}= | 192.168.200.2
45 | ${ip4_prefix}= | 24
46 | ${tag_1}= | ${10}
47 | ${tag_2}= | ${20}
48
49 *** Test Cases ***
50 | TC01: Process untagged send tagged
51 | | Given Vlan Test Setup
52 | | Then Send packet and verify headers
53 | | ... | ${tg_node} | ${ip4_net0_2} | ${ip4_net2_2} | ${tg_to_dut_if1}
54 | | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac} | ${tg_to_dut_if2}
55 | | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
56 | | ... | encaps_rx=Dot1q | vlan_rx=${tag_2}
57
58 | TC02: Process tagged send untagged
59 | | Given Vlan Test Setup
60 | | Then Send packet and verify headers
61 | | ... | ${tg_node} | ${ip4_net2_2} | ${ip4_net0_2} | ${tg_to_dut_if2}
62 | | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if1}
63 | | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac}
64 | | ... | encaps_tx=Dot1q | vlan_tx=${tag_2}
65
66 | TC03: Process tagged send tagged
67 | | Given Vlan Test Setup
68 | | Then Send packet and verify headers
69 | | ... | ${tg_node} | ${ip4_net1_2} | ${ip4_net2_2} | ${tg_to_dut_if2}
70 | | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2}
71 | | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
72 | | ... | encaps_tx=Dot1q | vlan_tx=${tag_1}
73 | | ... | encaps_rx=Dot1q | vlan_rx=${tag_2}
74 | | And Send packet and verify headers
75 | | ... | ${tg_node} | ${ip4_net2_2} | ${ip4_net1_2} | ${tg_to_dut_if2}
76 | | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2}
77 | | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
78 | | ... | encaps_tx=Dot1q | vlan_tx=${tag_2}
79 | | ... | encaps_rx=Dot1q | vlan_rx=${tag_1}
80
81 *** Keywords ***
82 | Vlan Test Setup
83 | | Configure path in 2-node circular topology
84 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
85 | | Set interfaces in 2-node circular topology up
86 | |
87 | | ${vlan1_name} | ${vlan1_index}= | Create vlan sub-interface
88 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${tag_1}
89 | | ${vlan2_name} | ${vlan2_index}= | Create vlan sub-interface
90 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${tag_2}
91 | |
92 | | Set Interface Address | ${dut_node}
93 | | ... | ${dut_to_tg_if1} | ${ip4_net0_1} | ${ip4_prefix}
94 | | Set Interface Address | ${dut_node}
95 | | ... | ${vlan1_index} | ${ip4_net1_1} | ${ip4_prefix}
96 | | Set Interface Address | ${dut_node}
97 | | ... | ${vlan2_index} | ${ip4_net2_1} | ${ip4_prefix}
98 | |
99 | | Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1} | ${ip4_net0_2}
100 | | ... | ${tg_to_dut_if1_mac}
101 | | Add IP Neighbor | ${dut_node} | ${vlan1_index} | ${ip4_net1_2}
102 | | ... | ${tg_to_dut_if2_mac}
103 | | Add IP Neighbor | ${dut_node} | ${vlan2_index} | ${ip4_net2_2}
104 | | ... | ${tg_to_dut_if2_mac}