aboutsummaryrefslogtreecommitdiffstats
path: root/tests/func/vlan/eth2p-dot1q-ip4base-func.robot
blob: 5398574848eba2e47a0aadaf109cd3233a8c0739 (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
107
# Copyright (c) 2016 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 ***
| Resource | resources/libraries/robot/default.robot
| Resource | resources/libraries/robot/testing_path.robot
| Resource | resources/libraries/robot/ipv4.robot
| Resource | resources/libraries/robot/tagging.robot
| Resource | resources/libraries/robot/traffic.robot
| Library  | resources.libraries.python.Trace
| Library | resources.libraries.python.IPv6Util
| Force Tags | 3_NODE_DOUBLE_LINK_TOPO | VM_ENV | HW_ENV | VPP_VM_ENV
| Test Setup | Func Test Setup
| Test Teardown | Func Test Teardown
| 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 Check 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
# It doesn't work with virtio
| | [Tags] | EXPECTED_FAILING
| | Given Vlan Test Setup
| | Then Send Packet And Check 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
# It doesn't work with virtio
| | [Tags] | EXPECTED_FAILING
| | Given Vlan Test Setup
| | Then Send Packet And Check 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 Check 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
| | Path for 2-node testing is set
| | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
| | Interfaces in 2-node path are up
| |
| | ${vlan1_name} | ${vlan1_index}= | Vlan Subinterface Created
| | ... | ${dut_node} | ${dut_to_tg_if2} | ${tag_1}
| | ${vlan2_name} | ${vlan2_index}= | Vlan Subinterface Created
| | ... | ${dut_node} | ${dut_to_tg_if2} | ${tag_2}
| |
| | Set Interface Address | ${dut_node}
| | ... | ${dut_to_tg_if1} | ${ip4_net0_1} | ${ip4_prefix}
| | Set Interface Address | ${dut_node}
| | ... | ${vlan1_index} | ${ip4_net1_1} | ${ip4_prefix}
| | Set Interface Address | ${dut_node}
| | ... | ${vlan2_index} | ${ip4_net2_1} | ${ip4_prefix}
| |
| | Add IP Neighbor | ${dut_node} | ${dut_to_tg_if1} | ${ip4_net0_2}
| | ... | ${tg_to_dut_if1_mac}
| | Add IP Neighbor | ${dut_node} | ${vlan1_index} | ${ip4_net1_2}
| | ... | ${tg_to_dut_if2_mac}
| | Add IP Neighbor | ${dut_node} | ${vlan2_index} | ${ip4_net2_2}
| | ... | ${tg_to_dut_if2_mac}