FIB table add/delete
[csit.git] / tests / vpp / func / vm_vhost / ip4 / eth2p-ethip4-ip4base-eth-2vhost-1vm.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 | Library | resources.libraries.python.topology.Topology
16 | Library | resources.libraries.python.NodePath
17 | Library | resources.libraries.python.Trace
18 | Library | resources.libraries.python.IPUtil
19 | Library | resources.libraries.python.VPPUtil
20 | Library | resources.libraries.python.InterfaceUtil
21 | Library | resources.libraries.python.VhostUser
22 | Resource | resources/libraries/robot/shared/traffic.robot
23 | Resource | resources/libraries/robot/shared/default.robot
24 | Resource | resources/libraries/robot/shared/interfaces.robot
25 | Resource | resources/libraries/robot/shared/testing_path.robot
26 | Resource | resources/libraries/robot/ip/ip4.robot
27 | Resource | resources/libraries/robot/vm/qemu.robot
28 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
29 | Force Tags | VM_ENV | HW_ENV | 3_NODE_DOUBLE_LINK_TOPO
30 | Test Setup | Set up functional test
31 | Test Teardown | Tear down functional test
32 | Documentation | *IPv4 routing test cases with vhost user interface*
33 | ...
34 | ... | RFC791 IPv4, RFC826 ARP, RFC792 ICMPv4. Encapsulations: Eth-IPv4-ICMPv4
35 | ... | on links TG=DUT1. IPv4 routing tests use circular 2-node
36 | ... | topology TG - DUT1 - TG with two link between the nodes. DUT is
37 | ... | configured with IPv4 routing and static routes. Test sends packets
38 | ... | by TG on links to DUT and received on TG link on the other side of
39 | ... | circular topology. On receive TG verifies packets IPv4 src-addr,
40 | ... | dst-addr and MAC addresses.
41
42 *** Variables ***
43 | ${net1}= | 10.0.1.0
44 | ${net3}= | 10.0.3.0
45 | ${net1_ip1}= | 10.0.1.1
46 | ${net1_ip2}= | 10.0.1.2
47 | ${net2_ip1}= | 10.0.2.1
48 | ${net2_ip2}= | 10.0.2.2
49 | ${net3_ip1}= | 10.0.3.1
50 | ${net3_ip2}= | 10.0.3.2
51 | ${prefix_length}= | 24
52 | ${fib_table_2}= | 20
53 | ${sock1}= | /tmp/sock1
54 | ${sock2}= | /tmp/sock2
55
56 *** Test Cases ***
57 | TC01: IPv4 forward via vhost to another VRF
58 | | [Documentation]
59 | | ... | Test uses VRF to route IPv4 traffic through 2 vhost user interfaces.
60 | | ... | Both have IP addresses from same network. On VM is set bridge to pass
61 | | ... | packet from a one vhost user interface to another one.
62 | | [Teardown] | Run Keywords
63 | | ... | Stop and clear QEMU | ${dut_node} | ${vm_node} | AND
64 | | ... | Tear down functional test
65 | |
66 | | Given Configure path in 2-node circular topology
67 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
68 | | And Set interfaces in 2-node circular topology up
69 | | ${vhost1}= | And Vpp Create Vhost User Interface | ${dut_node} | ${sock1}
70 | | ${vhost2}= | And Vpp Create Vhost User Interface | ${dut_node} | ${sock2}
71 | | And Set Interface State | ${dut_node} | ${vhost1} | up
72 | | And Set Interface State | ${dut_node} | ${vhost2} | up
73 | | And Add Fib Table | ${dut_node} | ${fib_table_2}
74 | | And Assign Interface To Fib Table | ${dut_node}
75 | | ... | ${vhost2} | ${fib_table_2}
76 | | And Assign Interface To Fib Table | ${dut_node}
77 | | ... | ${dut_to_tg_if2} | ${fib_table_2}
78 | | And Configure IP addresses on interfaces
79 | | ... | ${dut_node} | ${dut_to_tg_if1} | ${net1_ip1} | ${prefix_length}
80 | | ... | ${dut_node} | ${vhost1} | ${net2_ip1} | ${prefix_length}
81 | | ... | ${dut_node} | ${vhost2} | ${net2_ip2} | ${prefix_length}
82 | | ... | ${dut_node} | ${dut_to_tg_if2} | ${net3_ip1} | ${prefix_length}
83 | | ${vhost2_mac}= | And Get Vhost User Mac By SW Index
84 | | ... | ${dut_node} | ${vhost2}
85 | | And Vpp Route Add | ${dut_node} | ${net3} | 24 | ${net2_ip2}
86 | | ... | ${vhost1} | resolve_attempts=${NONE} | count=${NONE}
87 | | And Vpp Route Add | ${dut_node} | ${net1} | 24 | ${net2_ip1}
88 | | ... | ${vhost2} | resolve_attempts=${NONE} | count=${NONE}
89 | | ... | vrf=${fib_table_2}
90 | | Add IP Neighbor | ${dut_node} | ${vhost1} | ${net2_ip2} | ${vhost2_mac}
91 | | Add IP Neighbor | ${dut_node} | ${dut_to_tg_if2} | ${net3_ip2}
92 | | ... | ${tg_to_dut_if2_mac}
93 | | When Configure VM for vhost L2BD forwarding
94 | | ... | ${dut_node} | ${sock1} | ${sock2}
95 | | Then Send packet and verify headers
96 | | ... | ${tg_node} | ${net1_ip2} | ${net3_ip2}
97 | | ... | ${tg_to_dut_if1} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_mac}
98 | | ... | ${tg_to_dut_if2} | ${dut_to_tg_if2_mac} | ${tg_to_dut_if2_mac}

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.