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