CSIT-843: Update actual topology in case of new/updated/deleted interface
[csit.git] / tests / vpp / func / vm_vhost / l2bd / eth2p-eth-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/vm/qemu.robot
19 | Library  | resources.libraries.python.Trace
20 | Force Tags | 3_NODE_DOUBLE_LINK_TOPO | HW_ENV | VM_ENV | VPP_VM_ENV
21 | Test Setup | Set up functional test
22 | Test Teardown | Run Keywords  | Tear down functional test
23 | ... | AND | Stop and clear QEMU | ${dut_node} | ${vm_node}
24 | Documentation | *L2 bridge-domain test cases*
25 | ...
26 | ... | *[Top] Network Topologies:* TG=DUT=VM 3-node topology with VM
27 | ... | and double parallel links.
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 is configured with two L2 bridge-domains
32 | ... | (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 via VM; 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 | ${sock1}= | /tmp/sock1
44 | ${sock2}= | /tmp/sock2
45
46 *** Test Cases ***
47 | TC01: DUT with two L2BDs (MAC learn) switches ICMPv4 between TG and VM links
48 | | [Documentation]
49 | | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 configure \
50 | | ... | two L2BDs with MAC learning, each with vhost-user i/f to local
51 | | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two
52 | | ... | virtio i/fs. [Ver] Make TG verify ICMPv4 Echo Req pkts are
53 | | ... | switched thru DUT1 and VM in both directions and are correct on
54 | | ... | receive. [Ref]
55 | | ...
56 | | Given Configure path in 2-node circular topology
57 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
58 | | And Set interfaces in 2-node circular topology up
59 | | When Configure vhost interfaces for L2BD forwarding | ${dut_node}
60 | | ... | ${sock1}
61 | | ... | ${sock2}
62 | | And Create bridge domain | ${dut_node} | ${bd_id1}
63 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1}
64 | | ... | ${bd_id1}
65 | | And Add interface to bridge domain | ${dut_node} | ${vhost_if1}
66 | | ... | ${bd_id1}
67 | | And Create bridge domain | ${dut_node} | ${bd_id2}
68 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2}
69 | | ... | ${bd_id2}
70 | | And Add interface to bridge domain | ${dut_node} | ${vhost_if2}
71 | | ... | ${bd_id2}
72 | | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1}
73 | | ... | ${sock2}
74 | | Then Send ICMPv4 bidirectionally and verify received packets | ${tg_node}
75 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2}
76
77 | TC02: DUT with two L2BDs (MAC learn) switches ICMPv6 between TG and VM links
78 | | [Documentation]
79 | | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 configure \
80 | | ... | two L2BDs with MAC learning, each with vhost-user i/f to local
81 | | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two
82 | | ... | virtio i/fs. [Ver] Make TG verify ICMPv6 Echo Req pkts are
83 | | ... | switched thru DUT1 and VM in both directions and are correct on
84 | | ... | receive. [Ref]
85 | | ...
86 | | Given Configure path in 2-node circular topology
87 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
88 | | And Set interfaces in 2-node circular topology up
89 | | When Configure vhost interfaces for L2BD forwarding | ${dut_node}
90 | | ... | ${sock1}
91 | | ... | ${sock2}
92 | | And Create bridge domain | ${dut_node} | ${bd_id1}
93 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1}
94 | | ... | ${bd_id1}
95 | | And Add interface to bridge domain | ${dut_node} | ${vhost_if1}
96 | | ... | ${bd_id1}
97 | | And Create bridge domain | ${dut_node} | ${bd_id2}
98 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2}
99 | | ... | ${bd_id2}
100 | | And Add interface to bridge domain | ${dut_node} | ${vhost_if2}
101 | | ... | ${bd_id2}
102 | | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1}
103 | | ... | ${sock2}
104 | | Then Send ICMPv6 bidirectionally and verify received packets | ${tg_node}
105 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2}