aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vpp/func/ip4/eth2p-dot1q-ip4base-func.robot
blob: 123969a867c4640f3d0f52110760d37318cbd929 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright (c) 2019 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

*** Settings ***
| Library | resources.libraries.python.IPv6Util
| Library | resources.libraries.python.Trace
| ...
| Resource | resources/libraries/robot/ip/ip4.robot
| Resource | resources/libraries/robot/l2/tagging.robot
| Resource | resources/libraries/robot/shared/default.robot
| Resource | resources/libraries/robot/shared/testing_path.robot
| Resource | resources/libraries/robot/shared/traffic.robot
| ...
| Force Tags | 3_NODE_DOUBLE_LINK_TOPO | VM_ENV | HW_ENV | VPP_VM_ENV
| ... | SKIP_VPP_PATCH
| Test Setup | Set up functional test
| Test Teardown | Tear down functional test
| Documentation | *IPv4 with VLAN subinterfaces*
| ...
| ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology
| ... | with double links between nodes.
| ... | *[Enc] Packet encapsulations:* Eth-IPv4-ICMPv4 on TG-DUT1-IF1,
| ... | Eth-dot1q-IPv4-ICMPv4 on TG-DUT1-IF2.
| ... | *[Cfg] DUT configuration:* DUT1 is configured with 2 Vlan subinterfaces
| ... | on DUT1-IF2. The subinterfaces and DUT1-IF1 have IP addresses set and
| ... | corresponding IP neighbor entries are configured.
| ... | *[Ref] Applicable standard specifications:* IEEE 802.1q.

*** Variables ***

| ${ip4_net0_1}= | 192.168.0.1
| ${ip4_net0_2}= | 192.168.0.2
| ${ip4_net1_1}= | 192.168.100.1
| ${ip4_net1_2}= | 192.168.100.2
| ${ip4_net2_1}= | 192.168.200.1
| ${ip4_net2_2}= | 192.168.200.2
| ${ip4_prefix}= | 24
| ${tag_1}= | ${10}
| ${tag_2}= | ${20}

*** Test Cases ***
| TC01: Process untagged send tagged
| | Given Vlan Test Setup
| | Then Send packet and verify headers
| | ... | ${tg_node} | ${ip4_net0_2} | ${ip4_net2_2} | ${tg_to_dut_if1}
| | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac} | ${tg_to_dut_if2}
| | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
| | ... | encaps_rx=Dot1q | vlan_rx=${tag_2}

| TC02: Process tagged send untagged
| | Given Vlan Test Setup
| | Then Send packet and verify headers
| | ... | ${tg_node} | ${ip4_net2_2} | ${ip4_net0_2} | ${tg_to_dut_if2}
| | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if1}
| | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac}
| | ... | encaps_tx=Dot1q | vlan_tx=${tag_2}

| TC03: Process tagged send tagged
| | Given Vlan Test Setup
| | Then Send packet and verify headers
| | ... | ${tg_node} | ${ip4_net1_2} | ${ip4_net2_2} | ${tg_to_dut_if2}
| | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2}
| | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
| | ... | encaps_tx=Dot1q | vlan_tx=${tag_1}
| | ... | encaps_rx=Dot1q | vlan_rx=${tag_2}
| | And Send packet and verify headers
| | ... | ${tg_node} | ${ip4_net2_2} | ${ip4_net1_2} | ${tg_to_dut_if2}
| | ... | ${tg_to_dut_if2_mac} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2}
| | ... | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}
| | ... | encaps_tx=Dot1q | vlan_tx=${tag_2}
| | ... | encaps_rx=Dot1q | vlan_rx=${tag_1}

*** Keywords ***
| Vlan Test Setup
| | Configure path in 2-node circular topology
| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
| | Set interfaces in 2-node circular topology up
| |
| | ${vlan1_name} | ${vlan1_index}= | Create vlan sub-interface
| | ... | ${dut_node} | ${dut_to_tg_if2} | ${tag_1}
| | ${vlan2_name} | ${vlan2_index}= | Create vlan sub-interface
| | ... | ${dut_node} | ${dut_to_tg_if2} | ${tag_2}
| |
| | VPP Interface Set IP Address | ${dut_node}
| | ... | ${dut_to_tg_if1} | ${ip4_net0_1} | ${ip4_prefix}
| | VPP Interface Set IP Address | ${dut_node}
| | ... | ${vlan1_index} | ${ip4_net1_1} | ${ip4_prefix}
| | VPP Interface Set IP Address | ${dut_node}
| | ... | ${vlan2_index} | ${ip4_net2_1} | ${ip4_prefix}
| |
| | VPP Add IP Neighbor
| | ... | ${dut_node} | ${dut_to_tg_if1} | ${ip4_net0_2} | ${tg_to_dut_if1_mac}
| | VPP Add IP Neighbor
| | ... | ${dut_node} | ${vlan1_index} | ${ip4_net1_2} | ${tg_to_dut_if2_mac}
| | VPP Add IP Neighbor
| | ... | ${dut_node} | ${vlan2_index} | ${ip4_net2_2} | ${tg_to_dut_if2_mac}