VIRL test: Dot1Q-L2BD-vhost_user test (CSIT-502)
[csit.git] / tests / func / vlan / eth2p-dot1q-l2bdbasemaclrn-eth-2vhost-1vm-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/default.robot
16 | Resource | resources/libraries/robot/bridge_domain.robot
17 | Resource | resources/libraries/robot/testing_path.robot
18 | Resource | resources/libraries/robot/tagging.robot
19 | Resource | resources/libraries/robot/l2_traffic.robot
20 | Resource | resources/libraries/robot/qemu.robot
21 | Resource | resources/libraries/robot/double_qemu_setup.robot
22 | Library  | resources.libraries.python.Trace
23 | Force Tags | 3_NODE_DOUBLE_LINK_TOPO | HW_ENV | VM_ENV | VPP_VM_ENV
24 | Test Setup | Func Test Setup
25 | Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
26 | ...           | AND | Show vpp trace dump on all DUTs
27 | ...           | AND | Stop and Clear QEMU | ${dut_node} | ${vm_node}
28 | ...           | AND | Check VPP PID in Teardown
29 | Documentation | *L2 bridge domain with VLAN tag over VM test cases*
30 | ...
31 | ... | *[Top] Network Topologies:* TG=DUT 2-node circular topology
32 | ... | with double links between nodes.
33 | ... | *[Enc] Packet encapsulations:* Eth-dot1q-IPv4-ICMPv4 or
34 | ... | Eth-dot1q-IPv6-ICMPv6 on TG=DUT and on DUT=VM.
35 | ... | *[Cfg] DUT configuration:* DUT is configured with two bridge domains
36 | ... | (L2BD) with MAC learning enabled; each one with added VLAN
37 | ... | sub-interface towards TG and vhost-user interface to local VM. Configure
38 | ... | linux bridge on VM to pass traffic between both vhost-user interfaces.
39 | ... | *[Ver] TG verification:* Make TG send ICMPv4/ICMPv6 Echo Req between two
40 | ... | of its interfaces to be switched by DUT via VM; verify packets are
41 | ... | switched between these TG interfaces; on receive TG verifies packets for
42 | ... | correctness and their IPv4 src-addr, dst-addr, MAC addresses and
43 | ... | VLAN tag.
44 | ... | *[Ref] Applicable standard specifications:* IEEE 802.1q.
45
46 *** Variables ***
47 | ${bd_id1}= | 1
48 | ${bd_id2}= | 2
49
50 | ${vlan_id1}= | 110
51 | ${vlan_wrong}= | 150
52
53 | ${sock1}= | /tmp/sock1
54 | ${sock2}= | /tmp/sock2
55
56 | ${ip4_1}= | 192.168.100.1
57 | ${ip4_2}= | 192.168.100.2
58
59 | ${ip6_1}= | 3ffe:63::1
60 | ${ip6_2}= | 3ffe:63::2
61
62 *** Test Cases ***
63 | TC01: eth2p-dot1q-l2bdbasemaclrn-eth-2vhost-1vm - ipv4
64 | | [Documentation]
65 | | ... | [Top] TG=DUT.
66 | | ... | [Enc] Eth-dot1q-IPv4-ICMPv4 on TG=DUT and on DUT=VM.
67 | | ... | [Cfg] On DUT configure two L2BDs (MAC learning enabled); first L2BD
68 | | ... | with Dot1Q tagged interface to TG-if1 and vhost-user interface to
69 | | ... | local VM, second one with vhost-user interface to local VM and Dot1Q
70 | | ... | tagged interface towards TG-if2. Configure linux bridge on VM to pass
71 | | ... | traffic between both vhost-user interfaces.
72 | | ... | [Ver] Make TG send ICMPv4 Echo Req tagged with one Dot1q tag
73 | | ... | from one of its interfaces to another one via DUT and VM; verify
74 | | ... | that packet is received.
75 | | ... | [Ref] IEEE 802.1q
76 | | ...
77 | | Given Path for 2-node testing is set
78 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
79 | | And Interfaces in 2-node path are up
80 | | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created
81 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${vlan_id1}
82 | | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created
83 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${vlan_id1}
84 | | And VPP Vhost interfaces for L2BD forwarding are setup
85 | | ... | ${dut_node} | ${sock1} | ${sock2}
86 | | And VM for Vhost L2BD forwarding is setup
87 | | ... | ${dut_node} | ${sock1} | ${sock2}
88 | | And Interface is added to bridge domain | ${dut_node} | ${vlan1_index}
89 | | ...                                     | ${bd_id1}
90 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
91 | | ...                                     | ${bd_id1}
92 | | And Interface is added to bridge domain | ${dut_node} | ${vlan2_index}
93 | | ...                                     | ${bd_id2}
94 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
95 | | ...                                     | ${bd_id2}
96 | | Then Send and receive ICMP Packet
97 | | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} | ${ip4_1} | ${ip4_2}
98 | | ... | encaps=Dot1q | vlan1=${vlan_id1} | encaps_rx=Dot1q
99 | | And Send and receive ICMP Packet
100 | | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1} | ${ip4_2} | ${ip4_1}
101 | | ... | encaps=Dot1q | vlan1=${vlan_id1} | encaps_rx=Dot1q
102
103 | TC01: eth2p-dot1q-l2bdbasemaclrn-eth-2vhost-1vm - ipv6
104 | | [Documentation]
105 | | ... | [Top] TG=DUT.
106 | | ... | [Enc] Eth-dot1q-IPv6-ICMPv6 on TG=DUT and on DUT=VM.
107 | | ... | [Cfg] On DUT configure two L2BDs (MAC learning enabled); first L2BD
108 | | ... | with Dot1Q tagged interface to TG-if1 and vhost-user interface to
109 | | ... | local VM, second one with vhost-user interface to local VM and Dot1Q
110 | | ... | tagged interface towards TG-if2. Configure linux bridge on VM to pass
111 | | ... | traffic between both vhost-user interfaces.
112 | | ... | [Ver] Make TG send ICMPv6 Echo Req tagged with one Dot1q tag
113 | | ... | from one of its interfaces to another one via DUT and VM; verify
114 | | ... | that packet is received.
115 | | ... | [Ref] IEEE 802.1q
116 | | ...
117 | | Given Path for 2-node testing is set
118 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
119 | | And Interfaces in 2-node path are up
120 | | ${vlan1_name} | ${vlan1_index}= | When Vlan Subinterface Created
121 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${vlan_id1}
122 | | ${vlan2_name} | ${vlan2_index}= | And Vlan Subinterface Created
123 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${vlan_id1}
124 | | And VPP Vhost interfaces for L2BD forwarding are setup
125 | | ... | ${dut_node} | ${sock1} | ${sock2}
126 | | And VM for Vhost L2BD forwarding is setup
127 | | ... | ${dut_node} | ${sock1} | ${sock2}
128 | | And Interface is added to bridge domain | ${dut_node} | ${vlan1_index}
129 | | ...                                     | ${bd_id1}
130 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if1}
131 | | ...                                     | ${bd_id1}
132 | | And Interface is added to bridge domain | ${dut_node} | ${vlan2_index}
133 | | ...                                     | ${bd_id2}
134 | | And Interface is added to bridge domain | ${dut_node} | ${vhost_if2}
135 | | ...                                     | ${bd_id2}
136 | | Then Send and receive ICMP Packet
137 | | ... | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2} | ${ip6_1} | ${ip6_2}
138 | | ... | encaps=Dot1q | vlan1=${vlan_id1} | encaps_rx=Dot1q
139 | | And Send and receive ICMP Packet
140 | | ... | ${tg_node} | ${tg_to_dut_if2} | ${tg_to_dut_if1} | ${ip6_2} | ${ip6_1}
141 | | ... | encaps=Dot1q | vlan1=${vlan_id1} | encaps_rx=Dot1q
142
143
144
145