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