CSIT-158: Tap interface tests
[csit.git] / tests / func / l2_xconnect / l2_xconnect_untagged.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_SINGLE_LINK_TOPO | HW_ENV | VM_ENV
25 | Test Setup | Setup all DUTs before test
26 | Suite Setup | Setup all TGs before traffic script
27 | Documentation | *L2 cross-connect test cases*
28 | ...
29 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology with
30 | ... | single links between nodes; TG=DUT1=DUT2=TG 3-node circular topology
31 | ... | with double parallel links and TG=DUT=VM 3-node topology with VM and
32 | ... | double parallel links.
33 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-ICMPv4 for L2 switching of IPv4;
34 | ... | Eth-IPv6-ICMPv6 for L2 switching of IPv6 use. Both apply to all links.
35 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with L2
36 | ... | cross-connect (L2XC) switching.
37 | ... | *[Ver] TG verification:* Test ICMPv4 (or ICMPv6) Echo Request packets are
38 | ... | sent in both directions by TG on links to DUT1 and DUT2; on receive TG
39 | ... | verifies packets for correctness and their IPv4 (IPv6) src-addr,
40 | ... | dst-addr and MAC addresses.
41 | ... | *[Ref] Applicable standard specifications:*
42
43 *** Variables ***
44 | ${sock1}= | /tmp/sock1
45 | ${sock2}= | /tmp/sock2
46
47 *** Test Cases ***
48 | TC01: DUT1 and DUT2 with L2XC switch ICMPv4 between two TG links
49 | | [Documentation]
50 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT1 and \
51 | | ... | DUT2 configure L2 cross-connect (L2XC), each with one interface
52 | | ... | to TG and one Ethernet interface towards the other DUT. [Ver]
53 | | ... | Make TG send ICMPv4 Echo Req in both directions between two of
54 | | ... | its interfaces to be switched by DUT1 and DUT2; verify all
55 | | ... | packets are received. [Ref]
56 | | Given Path for 3-node testing is set
57 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
58 | | And Interfaces in 3-node path are up
59 | | And L2 setup xconnect on DUT
60 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_dut2}
61 | | And L2 setup xconnect on DUT
62 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
63 | | When All Vpp Interfaces Ready Wait | ${nodes}
64 | | Then Send and receive ICMPv4 bidirectionally
65 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
66 | | [Teardown] | Run Keyword | Show vpp trace dump on all DUTs
67
68 | TC02: DUT1 and DUT2 with L2XC switch ICMPv6 between two TG links
69 | | [Documentation]
70 | | ... | [Top] TG-DUT1-DUT2-TG. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT1 and \
71 | | ... | DUT2 configure L2 cross-connect (L2XC), each with one interface
72 | | ... | to TG and one Ethernet interface towards the other DUT. [Ver]
73 | | ... | Make TG send ICMPv6 Echo Req in both directions between two of
74 | | ... | its interfaces to be switched by DUT1 and DUT2; verify all
75 | | ... | packets are received. [Ref]
76 | | Given Path for 3-node testing is set
77 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
78 | | And Interfaces in 3-node path are up
79 | | And L2 setup xconnect on DUT
80 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_dut2}
81 | | And L2 setup xconnect on DUT
82 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
83 | | When All Vpp Interfaces Ready Wait | ${nodes}
84 | | Then Send and receive ICMPv6 bidirectionally
85 | | ... | ${tg_node} | ${tg_to_dut1} | ${tg_to_dut2}
86 | | [Teardown] | Run Keyword | Show vpp trace dump on all DUTs
87
88 | TC03: DUT with two L2XCs switches ICMPv4 between TG and local VM links
89 | | [Documentation]
90 | | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv4-ICMPv4. [Cfg] On DUT configure \
91 | | ... | two L2 cross-connects (L2XC), each with one untagged interface
92 | | ... | to TG and untagged i/f to local VM over vhost-user. [Ver] Make
93 | | ... | TG send ICMPv4 Echo Reqs in both directions between two of its
94 | | ... | i/fs to be switched by DUT to and from VM; verify all packets
95 | | ... | are received. [Ref]
96 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
97 | | Given Path for 2-node testing is set
98 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
99 | | And Interfaces in 2-node path are up
100 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
101 | | ...                                                     | ${sock1}
102 | | ...                                                     | ${sock2}
103 | | And L2 Setup Xconnect on DUT | ${dut_node} | ${dut_to_tg_if1} | ${vhost_if1}
104 | | And L2 Setup Xconnect on DUT | ${dut_node} | ${dut_to_tg_if2} | ${vhost_if2}
105 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
106 | | ...                                       | ${sock2}
107 | | Then Send and receive ICMPv4 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
108 | | ...                                          | ${tg_to_dut_if2}
109 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
110 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}
111 | | ...        | AND          | Show vpp trace dump on all DUTs
112
113 | TC04: DUT with two L2XCs switches ICMPv6 between TG and local VM links
114 | | [Documentation]
115 | | ... | [Top] TG=DUT=VM. [Enc] Eth-IPv6-ICMPv6. [Cfg] On DUT configure \
116 | | ... | two L2 cross-connects (L2XC), each with one untagged i/f to TG
117 | | ... | and untagged i/f to local VM over vhost-user. [Ver] Make TG send
118 | | ... | ICMPv6 Echo Reqs in both directions between two of its i/fs to
119 | | ... | be switched by DUT to and from VM; verify all packets are
120 | | ... | received. [Ref]
121 | | [Tags] | 3_NODE_DOUBLE_LINK_TOPO | VPP_VM_ENV
122 | | Given Path for 2-node testing is set
123 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
124 | | And Interfaces in 2-node path are up
125 | | When VPP Vhost interfaces for L2BD forwarding are setup | ${dut_node}
126 | | ...                                                     | ${sock1}
127 | | ...                                                     | ${sock2}
128 | | And L2 Setup Xconnect on DUT | ${dut_node} | ${dut_to_tg_if1} | ${vhost_if1}
129 | | And L2 Setup Xconnect on DUT | ${dut_node} | ${dut_to_tg_if2} | ${vhost_if2}
130 | | And VM for Vhost L2BD forwarding is setup | ${dut_node} | ${sock1}
131 | | ...                                       | ${sock2}
132 | | Then Send and receive ICMPv6 bidirectionally | ${tg_node} | ${tg_to_dut_if1}
133 | | ...                                          | ${tg_to_dut_if2}
134 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
135 | | ...        | AND          | Stop and Clear QEMU | ${dut_node} | ${vm_node}
136 | | ...        | AND          | Show vpp trace dump on all DUTs
137