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