CSIT-664: Refactor setups and teardowns
[csit.git] / tests / func / l2xc / eth2p-eth-l2xcbase-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/default.robot
16 | Resource | resources/libraries/robot/l2_xconnect.robot
17 | Resource | resources/libraries/robot/l2_traffic.robot
18 | Resource | resources/libraries/robot/testing_path.robot
19 | Resource | resources/libraries/robot/interfaces.robot
20 | Resource | resources/libraries/robot/bridge_domain.robot
21 | Resource | resources/libraries/robot/qemu.robot
22 | Library  | resources.libraries.python.Trace
23 | Library | resources.libraries.python.NodePath
24 | Force Tags | 3_NODE_DOUBLE_LINK_TOPO | HW_ENV | VM_ENV | VPP_VM_ENV
25 | Test Setup | Set up functional test
26 | Test Teardown | Tear down functional test
27 | Documentation | *L2 cross-connect test cases*
28 | ...
29 | ... | *[Top] Network Topologies:* TG=DUT=VM 3-node topology with VM and
30 | ... | double parallel links.
31 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of IPv4;
32 | ... | Eth-IPv6-ICMPv6 for L2 switching of IPv6 use. Both apply to all links.
33 | ... | *[Cfg] DUT configuration:* DUT1 is configured with L2 cross-connect
34 | ... | (L2XC) switching.
35 | ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets are
36 | ... | sent in both directions by TG on links to DUT1 via VM; on receive TG
37 | ... | verifies packets for correctness and their IPv4 (IPv6) src-addr,
38 | ... | dst-addr and MAC addresses.
39 | ... | *[Ref] Applicable standard specifications:*
40
41 *** Variables ***
42 | ${sock1}= | /tmp/sock1
43 | ${sock2}= | /tmp/sock2
44
45 *** Test Cases ***
46 | TC01: DUT with two L2XCs switches ICMPv4 between TG and local VM links
47 | | [Documentation]
48 | | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT configure \
49 | | ... | two L2 cross-connects (L2XC), each with one untagged interface
50 | | ... | to TG and untagged i/f to local VM over vhost-user. [Ver] Make
51 | | ... | TG send ICMPv4 Echo Reqs in both directions between two of its
52 | | ... | i/fs to be switched by DUT to and from VM; verify all packets
53 | | ... | are received. [Ref]
54 | | ...
55 | | [Teardown] | Run Keywords | Stop and clear QEMU | ${dut_node} | ${vm_node}
56 | | ... | AND | Tear down functional test
57 | | ...
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 Configure vhost interfaces for L2BD forwarding | ${dut_node}
62 | | ... | ${sock1} | ${sock2}
63 | | And Configure L2XC | ${dut_node} | ${dut_to_tg_if1} | ${vhost_if1}
64 | | And Configure L2XC | ${dut_node} | ${dut_to_tg_if2} | ${vhost_if2}
65 | | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1}
66 | | ... | ${sock2}
67 | | Then Send ICMPv4 bidirectionally and verify received packets | ${tg_node}
68 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2}
69
70 | TC02: DUT with two L2XCs switches ICMPv6 between TG and local VM links
71 | | [Documentation]
72 | | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT configure \
73 | | ... | two L2 cross-connects (L2XC), each with one untagged i/f to TG
74 | | ... | and untagged i/f to local VM over vhost-user. [Ver] Make TG send
75 | | ... | ICMPv6 Echo Reqs in both directions between two of its i/fs to
76 | | ... | be switched by DUT to and from VM; verify all packets are
77 | | ... | received. [Ref]
78 | | ...
79 | | [Teardown] | Run Keywords | Stop and clear QEMU | ${dut_node} | ${vm_node}
80 | | ... | AND | Tear down functional test
81 | | ...
82 | | Given Configure path in 2-node circular topology
83 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
84 | | And Set interfaces in 2-node circular topology up
85 | | When Configure vhost interfaces for L2BD forwarding | ${dut_node}
86 | | ... | ${sock1} | ${sock2}
87 | | And Configure L2XC | ${dut_node} | ${dut_to_tg_if1} | ${vhost_if1}
88 | | And Configure L2XC | ${dut_node} | ${dut_to_tg_if2} | ${vhost_if2}
89 | | And Configure VM for vhost L2BD forwarding | ${dut_node} | ${sock1}
90 | | ... | ${sock2}
91 | | Then Send ICMPv6 bidirectionally and verify received packets | ${tg_node}
92 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if2}
93