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