Align suite/test teardown/setup
[csit.git] / tests / vpp / device / container_memif / eth2p-ethip6-ip6base-eth-2memif-1dcr-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.InterfaceUtil
16 | Library | resources.libraries.python.IPUtil
17 | ...
18 | Resource | resources/libraries/robot/shared/default.robot
19 | Resource | resources/libraries/robot/shared/testing_path.robot
20 | Resource | resources/libraries/robot/shared/traffic.robot
21 | ...
22 | Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV
23 | ... | FUNCTEST | IP6FWD | BASE | ETH | MEMIF | DOCKER
24 | ...
25 | Suite Setup | Setup suite single link
26 | Test Setup | Setup test
27 | Test Teardown | Tear down test | packet_trace | container
28 | ...
29 | Documentation | *IPv4 routing test cases with memif interface*
30 | ...
31 | ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \
32 | ... | single links between nodes.
33 | ... | *[Enc] Packet Encapsulations:* Eth-IPv6-ICMPv6 for IPv6 routing on \
34 | ... | both links.
35 | ... | *[Cfg] DUT configuration:* DUT1 is configured with IPv6 routing and \
36 | ... | two static IPv6 /64 route entries. Container is connected to VPP via \
37 | ... | Memif interface. Container is running same VPP version as running on \
38 | ... | DUT.
39 | ... | *[Ver] TG verification:* Test ICMPv6 Echo Request packets are sent in \
40 | ... | one direction by TG on links to DUT1 and via container; on receive TG \
41 | ... | verifies packets for correctness and their IPv6 src-addr, dst-addr and \
42 | ... | MAC addresses.
43 | ... | *[Ref] Applicable standard specifications:* RFC791, RFC826, RFC792
44
45 *** Variables ***
46 | @{plugins_to_enable}= | dpdk_plugin.so | memif_plugin.so
47 | ${nic_name}= | virtual
48 # IP
49 | ${net1}= | 2001:1::0
50 | ${net3}= | 2001:3::0
51 | ${net1_ip1}= | 2001:1::1
52 | ${net1_ip2}= | 2001:1::2
53 | ${net2_ip1}= | 2001:2::1
54 | ${net2_ip2}= | 2001:2::2
55 | ${net3_ip1}= | 2001:3::1
56 | ${net3_ip2}= | 2001:3::2
57 | ${prefix_length}= | 64
58 | ${fib_table_2}= | 20
59 # Memif
60 | ${sock_base}= | memif-DUT1_CNF
61 # Container
62 | ${container_engine}= | Docker
63 | ${container_chain_topology}= | chain_functional
64
65 *** Test Cases ***
66 | tc01-eth2p-ethip6-ip6base-eth-2memif-1dcr-device
67 | | [Documentation]
68 | | ... | [Top] TG=DUT=DCR. [Enc] Eth-IPv6-ICMPv6. [Cfg] Configure two VRFs to \
69 | | ... | route IPv6 traffic through two memif interfaces. Both interfaces are \
70 | | ... | configured with IP addresses from the same network. [Ver] Make TG to \
71 | | ... | send ICMPv6 Echo Reqest form one TG interface to another one to be \
72 | | ... | switched by DUT1; verify header of received packet.
73 | | ...
74 | | Given Add PCI devices to all DUTs
75 | | And Apply startup configuration on all VPP DUTs
76 | | And VPP Enable Traces On All Duts | ${nodes}
77 | | When Configure path in 2-node circular topology
78 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
79 | | And Start containers for device test
80 | | And Configure interfaces in path up
81 | | When Set up memif interfaces on DUT node
82 | | ... | ${dut_node} | ${sock_base} | ${sock_base} | dcr_uuid=${dcr_uuid}
83 | | ... | memif_if1=memif_if1 | memif_if2=memif_if2 | rxq=${0} | txq=${0}
84 | | And Add Fib Table | ${dut_node} | ${fib_table_2} | ipv6=${True}
85 | | And Assign Interface To Fib Table
86 | | ... | ${dut_node} | ${memif_if2} | ${fib_table_2} | ipv6=${True}
87 | | And Assign Interface To Fib Table
88 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${fib_table_2} | ipv6=${True}
89 | | And VPP Interface Set IP Address
90 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${net1_ip1} | ${prefix_length}
91 | | And VPP Interface Set IP Address
92 | | ... | ${dut_node} | ${memif_if1} | ${net2_ip1} | ${prefix_length}
93 | | And VPP Interface Set IP Address
94 | | ... | ${dut_node} | ${memif_if2} | ${net2_ip2} | ${prefix_length}
95 | | And VPP Interface Set IP Address
96 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${net3_ip1} | ${prefix_length}
97 | | ${memif_if2_key}= | Get interface by sw index | ${nodes['DUT1']}
98 | | ... | ${memif_if2}
99 | | ${memif_if2_mac}= | Get interface MAC | ${nodes['DUT1']} | ${memif_if2_key}
100 | | And Vpp Route Add
101 | | ... | ${dut_node} | ${net3} | ${prefix_length}
102 | | ... | gateway=${net2_ip2} | interface=${memif_if1}
103 | | And Vpp Route Add
104 | | ... | ${dut_node} | ${net1} | ${prefix_length}
105 | | ... | gateway=${net2_ip1} | interface=${memif_if2} | vrf=${fib_table_2}
106 | | VPP Add IP Neighbor
107 | | ... | ${dut_node} | ${memif_if1} | ${net2_ip2} | ${memif_if2_mac}
108 | | VPP Add IP Neighbor
109 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${net3_ip2} | ${tg_to_dut_if2_mac}
110 | | Then Send packet and verify headers
111 | | ... | ${tg_node} | ${net1_ip2} | ${net3_ip2}
112 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
113 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}