3f71f831c491d36c52b7c01c7e325ed5774c4c34
[csit.git] / tests / vpp / device / vm_vhost / ip6 / eth2p-ethip6-ip6base-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.InterfaceUtil
16 | Library | resources.libraries.python.IPUtil
17 | Library | resources.libraries.python.NodePath
18 | Library | resources.libraries.python.topology.Topology
19 | Library | resources.libraries.python.Trace
20 | Library | resources.libraries.python.VhostUser
21 | Library | resources.libraries.python.VPPUtil
22 | ...
23 | Resource | resources/libraries/robot/ip/ip6.robot
24 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
25 | Resource | resources/libraries/robot/shared/default.robot
26 | Resource | resources/libraries/robot/shared/interfaces.robot
27 | Resource | resources/libraries/robot/shared/testing_path.robot
28 | Resource | resources/libraries/robot/shared/traffic.robot
29 | ...
30 | Force Tags | 2_NODE_SINGLE_LINK_TOPO | DEVICETEST | HW_ENV | DCR_ENV
31 | ... | FUNCTEST | IP6FWD | BASE | ETH | VHOST | 1VM
32 | ...
33 | Test Setup | Set up VPP device test
34 | ...
35 | Test Teardown | Tear down test | packet_trace | vhost
36 | ...
37 | Documentation | *IPv4 routing test cases with vhost user interface*
38 | ...
39 | ... | *[Top] Network Topologies:* TG-DUT1-TG 2-node circular topology with \
40 | ... | VM and single links between nodes.
41 | ... | *[Enc] Packet Encapsulations:* Eth-IPv6-ICMPv6 for IPv6 routing on \
42 | ... | both links.
43 | ... | *[Cfg] DUT configuration:* DUT1 is configured with IPv6 routing and \
44 | ... | two static IPv6 /64 route entries. Qemu Guest is connected to VPP via \
45 | ... | vhost-user interfaces. Guest is configured with linux bridge \
46 | ... | interconnecting vhost-user interfaces.
47 | ... | *[Ver] TG verification:* Test ICMPv6 Echo Request packets are sent in \
48 | ... | one direction by TG on links to DUT1; on receive TG verifies packets \
49 | ... | for correctness and their IPv6 src-addr, dst-addr and MAC addresses.
50 | ... | *[Ref] Applicable standard specifications:* RFC2460, RFC4443, RFC4861
51
52 *** Variables ***
53 | ${net1}= | 2001:1::0
54 | ${net3}= | 2001:3::0
55 | ${net1_ip1}= | 2001:1::1
56 | ${net1_ip2}= | 2001:1::2
57 | ${net2_ip1}= | 2001:2::1
58 | ${net2_ip2}= | 2001:2::2
59 | ${net3_ip1}= | 2001:3::1
60 | ${net3_ip2}= | 2001:3::2
61 | ${prefix_length}= | 64
62 | ${fib_table_2}= | 20
63 | ${sock1}= | /tmp/sock1
64 | ${sock2}= | /tmp/sock2
65
66 *** Test Cases ***
67 | tc01-eth2p-ethip6-ip6base-eth-2vhost-1vm-device
68 | | [Documentation]
69 | | ... | Test uses two VRFs to route IPv6 traffic through two vhost-user \
70 | | ... | interfaces. Both interfaces are configured with IP addresses from \
71 | | ... | the same network. There is created linux bridge on VM to pass packet \
72 | | ... | from one vhost-user interface to another one.
73 | | ...
74 | | Given Configure path in 2-node circular topology
75 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
76 | | And Configure interfaces in path up
77 | | ${vhost1}= | And Vpp Create Vhost User Interface | ${dut_node} | ${sock1}
78 | | ${vhost2}= | And Vpp Create Vhost User Interface | ${dut_node} | ${sock2}
79 | | And Set Interface State | ${dut_node} | ${vhost1} | up
80 | | And Set Interface State | ${dut_node} | ${vhost2} | up
81 | | And Add Fib Table | ${dut_node} | ${fib_table_2} | ipv6=${True}
82 | | And Assign Interface To Fib Table
83 | | ... | ${dut_node} | ${vhost2} | ${fib_table_2} | ipv6=${True}
84 | | And Assign Interface To Fib Table
85 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${fib_table_2} | ipv6=${True}
86 | | And VPP Interface Set IP Address
87 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${net1_ip1} | ${prefix_length}
88 | | And VPP Interface Set IP Address
89 | | ... | ${dut_node} | ${vhost1} | ${net2_ip1} | ${prefix_length}
90 | | And VPP Interface Set IP Address
91 | | ... | ${dut_node} | ${vhost2} | ${net2_ip2} | ${prefix_length}
92 | | And VPP Interface Set IP Address
93 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${net3_ip1} | ${prefix_length}
94 | | And Suppress ICMPv6 router advertisement message | ${nodes}
95 | | ${vhost2_mac}= | And Get Vhost User Mac By SW Index
96 | | ... | ${dut_node} | ${vhost2}
97 | | And Vpp Route Add
98 | | ... | ${dut_node} | ${net3} | ${prefix_length}
99 | | ... | gateway=${net2_ip2} | interface=${vhost1}
100 | | And Vpp Route Add
101 | | ... | ${dut_node} | ${net1} | ${prefix_length}
102 | | ... | gateway=${net2_ip1} | interface=${vhost2} | vrf=${fib_table_2}
103 | | VPP Add IP Neighbor
104 | | ... | ${dut_node} | ${vhost1} | ${net2_ip2} | ${vhost2_mac}
105 | | VPP Add IP Neighbor
106 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${net3_ip2} | ${tg_to_dut_if2_mac}
107 | | When Configure VM for vhost L2BD forwarding
108 | | ... | ${dut_node} | ${sock1} | ${sock2}
109 | | Then Send packet and verify headers
110 | | ... | ${tg_node} | ${net1_ip2} | ${net3_ip2}
111 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
112 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}