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