FIB table add/delete
[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 # It doesn't work with virtio
59 | | [Tags] | EXPECTED_FAILING
60 | | Given Vlan Test Setup
61 | | Then Send packet and verify headers
62 | | ... | ${tg_node} | ${ip4_net2_2} | ${ip4_net0_2} | ${tg_to_dut_if2}
63 | | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if1}
64 | | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac}
65 | | ... | encaps_tx=Dot1q | vlan_tx=${tag_2}
66
67 | TC03: Process tagged send tagged
68 # It doesn't work with virtio
69 | | [Tags] | EXPECTED_FAILING
70 | | Given Vlan Test Setup
71 | | Then Send packet and verify headers
72 | | ... | ${tg_node} | ${ip4_net1_2} | ${ip4_net2_2} | ${tg_to_dut_if2}
73 | | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2}
74 | | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
75 | | ... | encaps_tx=Dot1q | vlan_tx=${tag_1}
76 | | ... | encaps_rx=Dot1q | vlan_rx=${tag_2}
77 | | And Send packet and verify headers
78 | | ... | ${tg_node} | ${ip4_net2_2} | ${ip4_net1_2} | ${tg_to_dut_if2}
79 | | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2}
80 | | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
81 | | ... | encaps_tx=Dot1q | vlan_tx=${tag_2}
82 | | ... | encaps_rx=Dot1q | vlan_rx=${tag_1}
83
84 *** Keywords ***
85 | Vlan Test Setup
86 | | Configure path in 2-node circular topology
87 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
88 | | Set interfaces in 2-node circular topology up
89 | |
90 | | ${vlan1_name} | ${vlan1_index}= | Create vlan sub-interface
91 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${tag_1}
92 | | ${vlan2_name} | ${vlan2_index}= | Create vlan sub-interface
93 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${tag_2}
94 | |
95 | | Set Interface Address | ${dut_node}
96 | | ... | ${dut_to_tg_if1} | ${ip4_net0_1} | ${ip4_prefix}
97 | | Set Interface Address | ${dut_node}
98 | | ... | ${vlan1_index} | ${ip4_net1_1} | ${ip4_prefix}
99 | | Set Interface Address | ${dut_node}
100 | | ... | ${vlan2_index} | ${ip4_net2_1} | ${ip4_prefix}
101 | |
102 | | Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1} | ${ip4_net0_2}
103 | | ... | ${tg_to_dut_if1_mac}
104 | | Add IP Neighbor | ${dut_node} | ${vlan1_index} | ${ip4_net1_2}
105 | | ... | ${tg_to_dut_if2_mac}
106 | | Add IP Neighbor | ${dut_node} | ${vlan2_index} | ${ip4_net2_2}
107 | | ... | ${tg_to_dut_if2_mac}