b2700042f505294e9b17268dcdfe04d134132ca2
[csit.git] / tests / vpp / device / vm_vhost / l2bd / eth2p-eth-l2bdbasemaclrn-eth-2vhost-1vm-dev.robot
1 # Copyright (c) 2019 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 | Library  | resources.libraries.python.Trace
16 | Resource | resources/libraries/robot/shared/default.robot
17 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
18 | Resource | resources/libraries/robot/shared/testing_path.robot
19 | ...
20 | Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV
21 | ... | FUNCTEST | L2BDMACLRN | BASE | ETH | VHOST | 1VM
22 | ...
23 | Test Setup | Set up VPP device test
24 | ...
25 | Test Teardown | Run Keywords
26 | ... | Tear down QEMU
27 | ... | AND | Tear down VPP device test
28 | ...
29 | Documentation | *L2 bridge-domain test cases with vhost user interface*
30 | ...
31 | ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \
32 | ... | VM and single links between nodes.
33 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of \
34 | ... | IPv4; Eth-IPv6-ICMPv6 for L2 switching of IPv6.
35 | ... | *[Cfg] DUT configuration:* DUT1 is configured with two L2 \
36 | ... | bridge-domains (L2BD) switching combined with MAC learning enabled. \
37 | ... | Qemu Guest is connected to VPP via vhost-user interfaces. Guest is \
38 | ... | configured with linux bridge interconnecting vhost-user interfaces.
39 | ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets \
40 | ... | are sent in both directions by TG on links to DUT1 via VM; on \
41 | ... | receive TG verifies packets for correctness and their IPv4 (IPv6) \
42 | ... | src-addr, dst-addr and MAC addresses.
43 | ... | *[Ref] Applicable standard specifications:* RFC792
44
45 *** Variables ***
46 | ${bd_id1}= | 1
47 | ${bd_id2}= | 2
48
49 | ${sock1}= | /tmp/sock1
50 | ${sock2}= | /tmp/sock2
51
52 *** Test Cases ***
53 | tc01-eth2p-ethip4-l2bdbasemaclrn-eth-2vhost-1vm-device
54 | | [Documentation]
55 | | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 configure \
56 | | ... | two L2BDs with MAC learning, each with vhost-user i/f to local \
57 | | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two \
58 | | ... | virtio i/fs. [Ver] Make TG verify ICMPv4 Echo Req pkts are \
59 | | ... | switched thru DUT1 and VM in both directions and are correct on \
60 | | ... | receive. [Ref]
61 | | ...
62 | | Given Configure path in 2-node circular topology
63 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
64 | | And Configure interfaces in path up
65 | | When Configure vhost interfaces for L2BD forwarding | ${dut_node}
66 | | ... | ${sock1}
67 | | ... | ${sock2}
68 | | And Create bridge domain | ${dut_node} | ${bd_id1}
69 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1}
70 | | ... | ${bd_id1}
71 | | And Add interface to bridge domain | ${dut_node} | ${vhost_if1}
72 | | ... | ${bd_id1}
73 | | And Create bridge domain | ${dut_node} | ${bd_id2}
74 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2}
75 | | ... | ${bd_id2}
76 | | And Add interface to bridge domain | ${dut_node} | ${vhost_if2}
77 | | ... | ${bd_id2}
78 | | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1}
79 | | ... | ${sock2}
80 | | Then Send ICMPv4 bidirectionally and verify received packets | ${tg_node}
81 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2}
82
83 | tc02-eth2p-ethip6-l2bdbasemaclrn-eth-2vhost-1vm-device
84 | | [Documentation]
85 | | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 configure \
86 | | ... | two L2BDs with MAC learning, each with vhost-user i/f to local \
87 | | ... | VM and i/f to TG; configure VM to loop pkts back betwen its two \
88 | | ... | virtio i/fs. [Ver] Make TG verify ICMPv6 Echo Req pkts are \
89 | | ... | switched thru DUT1 and VM in both directions and are correct on \
90 | | ... | receive. [Ref]
91 | | ...
92 | | Given Configure path in 2-node circular topology
93 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
94 | | And Configure interfaces in path up
95 | | When Configure vhost interfaces for L2BD forwarding | ${dut_node}
96 | | ... | ${sock1}
97 | | ... | ${sock2}
98 | | And Create bridge domain | ${dut_node} | ${bd_id1}
99 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if1}
100 | | ... | ${bd_id1}
101 | | And Add interface to bridge domain | ${dut_node} | ${vhost_if1}
102 | | ... | ${bd_id1}
103 | | And Create bridge domain | ${dut_node} | ${bd_id2}
104 | | And Add interface to bridge domain | ${dut_node} | ${dut_to_tg_if2}
105 | | ... | ${bd_id2}
106 | | And Add interface to bridge domain | ${dut_node} | ${vhost_if2}
107 | | ... | ${bd_id2}
108 | | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1}
109 | | ... | ${sock2}
110 | | Then Send ICMPv6 bidirectionally and verify received packets | ${tg_node}
111 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2}