CSIT-509: Add perf tests for vlan + l2 + vhost
[csit.git] / tests / func / tap / eth2p-eth-l2bdbasemaclrn-l2shg-eth-2tap-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/ipv4.robot
17 | Resource | resources/libraries/robot/ipv6.robot
18 | Resource | resources/libraries/robot/interfaces.robot
19 | Resource | resources/libraries/robot/bridge_domain.robot
20 | Resource | resources/libraries/robot/testing_path.robot
21 | Resource | resources/libraries/robot/traffic.robot
22 | Library  | resources.libraries.python.Trace
23 | Library  | resources.libraries.python.Tap
24 | Library  | resources.libraries.python.Namespaces
25 | Library  | resources.libraries.python.IPUtil
26 | Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO
27 | Test Setup | Run Keywords | Func Test Setup
28 | ...        | AND          | Clean Up Namespaces | ${nodes['DUT1']}
29 | Test Teardown | Run Keywords | Func Test Teardown
30 | ...           | AND          | Clean Up Namespaces | ${nodes['DUT1']}
31 | Documentation | *Tap Interface Traffic Tests*
32 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
33 | ... | between nodes.
34 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of
35 | ... | IPv4.
36 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
37 | ... | bridge-domain (L2BD) MAC learning enabled; Split Horizon Groups (SHG)
38 | ... | are set depending on test case; Namespaces (NM)
39 | ... | are set on DUT1 with attached linux-TAP.
40 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets
41 | ... | are sent by TG on link to DUT1; On receipt TG verifies packets
42 | ... | for correctness and their IPv4 src-addr, dst-addr, and MAC addresses.
43 | ... | *[Ref] Applicable standard specifications:*
44
45 *** Variables ***
46 | ${tap1_NM_ip}= | 16.0.10.2
47 | ${tap2_NM_SHG}= | 16.0.10.3
48
49 | ${bd_id1}= | 21
50 | ${shg1}= | 2
51 | ${shg2}= | 3
52
53 | ${tap1_NM_mac}= | 02:00:00:00:00:02
54 | ${tap2_NM_mac}= | 02:00:00:00:00:04
55
56 | ${tap_int1}= | tap_int1
57 | ${tap_int2}= | tap_int2
58
59 | ${namespace1}= | nmspace1
60 | ${namespace2}= | nmspace2
61
62 | ${tg_ip_address_SHG}= | 16.0.10.20
63 | ${prefix}= | 24
64
65 *** Test Cases ***
66 | TC01: Tap Interface BD - Different Split Horizon
67 | | [Documentation]
68 | | ... | [Top] TG-DUT1-TG.
69 | | ... | [Enc] Eth-IPv4-ICMPv4.
70 | | ... | [Cfg] On DUT1
71 | | ... | configure one if into L2BD with MAC learning. Add two TAP interfaces
72 | | ... | into this L2BD and assign them different SHG. Setup two namespaces
73 | | ... | and assign two linux-TAP interfaces to it respectively.
74 | | ... | [Ver] Packet is sent from TG to both linux-TAP interfaces and reply
75 | | ... | is checked. Ping from First linux-TAP to another should pass.
76 | | Given Path for 2-node testing is set | ${nodes['TG']} | ${nodes['DUT1']}
77 | | ... | ${nodes['TG']}
78 | | And Interfaces in 2-node path are up
79 | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1}
80 | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2}
81 | | And Set Interface State | ${dut_node} | ${int1} | up
82 | | And Set Interface State | ${dut_node} | ${int2} | up
83 | | When Create Namespace | ${dut_node} | ${namespace1}
84 | | And Attach Interface To Namespace | ${dut_node}
85 | | ... | ${namespace1} | ${tap_int1}
86 | | And Create Namespace | ${dut_node} | ${namespace2}
87 | | And Attach Interface To Namespace | ${dut_node}
88 | | ... | ${namespace2} | ${tap_int2}
89 | | And Set Linux Interface IP | ${dut_node} | ${tap_int1}
90 | | ... | ${tap1_NM_ip} | ${prefix} | ${namespace1}
91 | | And Set Linux Interface IP | ${dut_node} | ${tap_int2}
92 | | ... | ${tap2_NM_SHG} | ${prefix} | ${namespace2}
93 | | And Set Linux Interface MAC | ${dut_node}
94 | | ... | ${tap_int1} | ${tap1_NM_mac} | ${namespace1}
95 | | And Set Linux Interface MAC | ${dut_node}
96 | | ... | ${tap_int2} | ${tap2_NM_mac} | ${namespace2}
97 | | And Set Linux Interface ARP | ${dut_node} | ${tap_int1}
98 | | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace1}
99 | | And Set Linux Interface ARP | ${dut_node} | ${tap_int2}
100 | | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace2}
101 | | And Bridge domain on DUT node is created | ${dut_node}
102 | | ... | ${bd_id1} | learn=${TRUE}
103 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
104 | | ...                                     | ${bd_id1}
105 | | And Interface is added to bridge domain | ${dut_node} | ${int1}
106 | | ...                                     | ${bd_id1} | ${shg1}
107 | | And Interface is added to bridge domain | ${dut_node} | ${int2}
108 | | ...                                     | ${bd_id1} | ${shg2}
109 | | Then Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1}
110 | | ... | ${tap1_NM_mac} | ${tg_to_dut_if1_mac}
111 | | ... | ${tap1_NM_ip} | ${tg_ip_address_SHG}
112 | | And Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1}
113 | | ... | ${tap2_NM_mac} | ${tg_to_dut_if1_mac}
114 | | ... | ${tap2_NM_SHG} | ${tg_ip_address_SHG}
115 | | And Send Ping From Node To Dst | ${dut_node} | ${tap1_NM_ip} | namespace=${namespace2}
116 | | And Send Ping From Node To Dst | ${dut_node} | ${tap2_NM_SHG} | namespace=${namespace1}
117
118 | TC02: Tap Interface BD - Same Split Horizon
119 | | [Documentation]
120 | | ... | [Top] TG-DUT1-TG.
121 | | ... | [Enc] Eth-IPv4-ICMPv4.
122 | | ... | [Cfg] On DUT1
123 | | ... | configure one if into L2BD with MAC learning. Add two TAP interfaces
124 | | ... | into this L2BD and assign them same SHG. Setup two namespaces
125 | | ... | and assign two linux-TAP interfaces to it respectively.
126 | | ... | [Ver] Packet is sent from TG to both linux-TAP interfaces and reply
127 | | ... | is checked. Ping from First linux-TAP to another should fail.
128 | | Given Path for 2-node testing is set | ${nodes['TG']} | ${nodes['DUT1']}
129 | | ... | ${nodes['TG']}
130 | | And Interfaces in 2-node path are up
131 | | ${int1}= | And Add Tap Interface | ${dut_node} | ${tap_int1}
132 | | ${int2}= | And Add Tap Interface | ${dut_node} | ${tap_int2}
133 | | And Set Interface State | ${dut_node} | ${int1} | up
134 | | And Set Interface State | ${dut_node} | ${int2} | up
135 | | When Create Namespace | ${dut_node} | ${namespace1}
136 | | And Attach Interface To Namespace | ${dut_node}
137 | | ... | ${namespace1} | ${tap_int1}
138 | | And Create Namespace | ${dut_node} | ${namespace2}
139 | | And Attach Interface To Namespace | ${dut_node}
140 | | ... | ${namespace2} | ${tap_int2}
141 | | And Set Linux Interface IP | ${dut_node} | ${tap_int1}
142 | | ... | ${tap1_NM_ip} | ${prefix} | ${namespace1}
143 | | And Set Linux Interface IP | ${dut_node} | ${tap_int2}
144 | | ... | ${tap2_NM_SHG} | ${prefix} | ${namespace2}
145 | | And Set Linux Interface MAC | ${dut_node}
146 | | ... | ${tap_int1} | ${tap1_NM_mac} | ${namespace1}
147 | | And Set Linux Interface MAC | ${dut_node}
148 | | ... | ${tap_int2} | ${tap2_NM_mac} | ${namespace2}
149 | | And Set Linux Interface ARP | ${dut_node} | ${tap_int1}
150 | | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace1}
151 | | And Set Linux Interface ARP | ${dut_node} | ${tap_int2}
152 | | ... | ${tg_ip_address_SHG} | ${tg_to_dut_if1_mac} | ${namespace2}
153 | | And Bridge domain on DUT node is created | ${dut_node}
154 | | ... | ${bd_id1} | learn=${TRUE}
155 | | And Interface is added to bridge domain | ${dut_node} | ${dut_to_tg_if1}
156 | | ...                                     | ${bd_id1}
157 | | And Interface is added to bridge domain | ${dut_node} | ${int1}
158 | | ...                                     | ${bd_id1} | ${shg1}
159 | | And Interface is added to bridge domain | ${dut_node} | ${int2}
160 | | ...                                     | ${bd_id1} | ${shg1}
161 | | Then Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1}
162 | | ... | ${tap1_NM_mac} | ${tg_to_dut_if1_mac}
163 | | ... | ${tap1_NM_ip} | ${tg_ip_address_SHG}
164 | | And Node replies to ICMP echo request | ${tg_node} | ${tg_to_dut_if1}
165 | | ... | ${tap2_NM_mac} | ${tg_to_dut_if1_mac}
166 | | ... | ${tap2_NM_SHG} | ${tg_ip_address_SHG}
167 | | And Run Keyword And Expect Error | Ping Not Successful | Send Ping From Node To Dst
168 | | ... | ${dut_node} | ${tap2_NM_SHG} | namespace=${namespace1}
169 | | And Run Keyword And Expect Error | Ping Not Successful | Send Ping From Node To Dst
170 | | ... | ${dut_node} | ${tap1_NM_ip} | namespace=${namespace2}