CSIT-664: Refactor setups and teardowns
[csit.git] / tests / func / l2bd / eth2p-eth-l2bdbasemaclrn-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/qemu.robot
19 | Library  | resources.libraries.python.Trace
20 | Force Tags | HW_ENV | VM_ENV | SKIP_VPP_PATCH
21 | Test Setup | Set up functional test
22 | Test Teardown | Tear down functional test
23 | Documentation | *L2 bridge-domain test cases*
24 | ...
25 | ... | *[Top] Network Topologies:* TG=DUT1 2-node topology with two links
26 | ... | between nodes; TG-DUT1-DUT2-TG 3-node circular topology with
27 | ... | single links between nodes.
28 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of
29 | ... | IPv4; Eth-IPv6-ICMPv6 for L2 switching of IPv6 use. Both apply
30 | ... | to all links.
31 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
32 | ... | bridge-domain (L2BD) switching combined with MAC learning enabled.
33 | ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets
34 | ... | are sent in both directions by TG on links to DUT1 and DUT2; on
35 | ... | receive TG verifies packets for correctness and their IPv4 (IPv6)
36 | ... | src-addr, dst-addr and MAC addresses.
37 | ... | *[Ref] Applicable standard specifications:*
38
39 *** Variables ***
40 | ${bd_id1}= | 1
41 | ${bd_id2}= | 2
42
43 *** Test Cases ***
44 | TC01: DUT reports active interfaces
45 | | [Documentation]
46 | | ... | [Top] TG=DUT1; TG-DUT1-DUT2-TG. [Enc] None. [Cfg] Discovered \
47 | | ... | active interfaces. [Ver] Report active interfaces on DUT. [Ref]
48 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | 3_NODE_SINGLE_LINK_TOPO
49 | | Report VPP interfaces | ${nodes['DUT1']}
50
51 | TC02: DUT with L2BD (MAC learning) switch ICMPv4 between two TG links
52 | | [Documentation]
53 | | ... | [Top] TG=DUT1. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 configure \
54 | | ... | two i/fs into L2BD with MAC learning. [Ver] Make TG verify
55 | | ... | ICMPv4 Echo Req pkts are switched thru DUT1 in both directions
56 | | ... | and are correct on receive. [Ref]
57 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO
58 | | Given Configure path in 2-node circular topology
59 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
60 | | And Set interfaces in 2-node circular topology up
61 | | When Create bridge domain | ${dut_node} | ${bd_id1}
62 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1}
63 | | ... | ${bd_id1}
64 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2}
65 | | ... | ${bd_id1}
66 | | Then Send ICMPv4 bidirectionally and verify received packets | ${tg_node}
67 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2}
68
69 | TC03: DUT1 and DUT2 with L2BD (MAC learning) switch between two TG links
70 | | [Documentation]
71 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 and DUT2 \
72 | | ... | configure two i/fs into L2BD with MAC learning. [Ver] Make TG
73 | | ... | verify ICMPv4 Echo Req pkts are switched thru DUT1 and DUT2 in
74 | | ... | both directions and are correct on receive. [Ref]
75 | | [Tags] | 3_NODE_SINGLE_LINK_TOPO
76 | | Given Configure path in 3-node circular topology
77 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
78 | | And Set interfaces in 3-node circular topology up
79 | | When Create bridge domain | ${dut1_node} | ${bd_id1}
80 | | And Add interface to bridge domain | ${dut1_node} | ${dut1_to_tg}
81 | | ... | ${bd_id1}
82 | | And Add interface to bridge domain | ${dut1_node} | ${dut1_to_dut2}
83 | | ... | ${bd_id1}
84 | | And Create bridge domain | ${dut2_node} | ${bd_id2}
85 | | And Add interface to bridge domain | ${dut2_node} | ${dut2_to_tg}
86 | | ... | ${bd_id2}
87 | | And Add interface to bridge domain | ${dut2_node} | ${dut2_to_dut1}
88 | | ... | ${bd_id2}
89 | | Then Send ICMPv4 bidirectionally and verify received packets | ${tg_node}
90 | | ... | ${tg_to_dut1} | ${tg_to_dut2}