FIB table add/delete
[csit.git] / tests / vpp / func / vm_vhost / ip6 / eth2p-ethip6lispgpe-ip6basevrf-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 | 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.IPv6Setup
20 | Library | resources.libraries.python.VPPUtil
21 | Resource | resources/libraries/robot/shared/traffic.robot
22 | Resource | resources/libraries/robot/shared/default.robot
23 | Resource | resources/libraries/robot/shared/interfaces.robot
24 | Resource | resources/libraries/robot/shared/testing_path.robot
25 | Resource | resources/libraries/robot/vm/qemu.robot
26 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
27 | Resource | resources/libraries/robot/overlay/lispgpe.robot
28 # Import configuration and test data:
29 | Variables | resources/test_data/lisp/ipv6_lispgpe_ipv6/ipv6_lispgpe_ipv6.py
30 | ...
31 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | VM_ENV | LISP
32 | ...
33 | Test Setup | Run Keywords | Set up functional test
34 | ... | AND | Vpp All Ra Suppress Link Layer | ${nodes}
35 | ...
36 | Test Teardown | Tear down LISP functional test with QEMU | ${vm_node}
37 | ...
38 | Documentation | *ip6-lispgpe-ip6 encapsulation test cases*
39 | ...
40 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
41 | ... | with single links between nodes.
42 | ... | *[Enc] Packet Encapsulations:* Eth-IPv6-LISP-IPv6-ICMPv6 on DUT1-DUT2,\
43 | ... | Eth-IPv6-ICMPv6 on TG-DUTn for IPv6 routing over LISPoIPv6 tunnel.
44 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv6\
45 | ... | routing and static routes. LISPoIPv6 tunnel is configured between\
46 | ... | DUT1 and DUT2.
47 | ... | *[Ver] TG verification:* Test ICMPv6 Echo Request packets are sent in\
48 | ... | both directions by TG on links to DUT1 and DUT2; on receive\
49 | ... | TG verifies packets for correctness and their IPv6 src-addr, dst-addr\
50 | ... | and MAC addresses.
51 | ... | *[Ref] Applicable standard specifications:* RFC6830.
52
53 *** Test Cases ***
54 | TC01: DUT1 and DUT2 route IPv6 bidirectionally over LISP GPE tunnel using vhost interfaces and VRF is enabled
55 | | [Documentation]
56 | | ... | [Top] TG-DUT1-DUT2-TG.
57 | | ... | [Enc] Eth-IPv6-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on\
58 | | ... | TG-DUTn.
59 | | ... | [Cfg] Configure IPv6 LISP static adjacencies on DUT1 and DUT2.
60 | | ... | [Ver] Case: ip6-lispgpe-ip6 - vrf, virt2lisp
61 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across both\
62 | | ... | DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
63 | | ... | received packets are correct.
64 | | ... | [Ref] RFC6830.
65 | | ...
66 | | ...
67 | | Given Configure path in 3-node circular topology
68 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
69 | | And Set interfaces in 3-node circular topology up
70 | | And Add Fib Table | ${dut1_node} | ${fib_table_1} | ipv6=${TRUE}
71 | | And Add Fib Table | ${dut2_node} | ${fib_table_1} | ipv6=${TRUE}
72 | | And Assign Interface To Fib Table | ${dut1_node}
73 | | ... | ${dut1_to_tg} | ${fib_table_1} | ipv6=${TRUE}
74 | | And Assign Interface To Fib Table | ${dut2_node}
75 | | ... | ${dut2_to_tg} | ${fib_table_1} | ipv6=${TRUE}
76 | | And Vpp Set If IPv6 Addr
77 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6} | ${prefix6}
78 | | And Vpp Set If IPv6 Addr
79 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip6} | ${prefix6}
80 | | And Vpp Set If IPv6 Addr
81 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip6} | ${prefix6}
82 | | And Vpp Set If IPv6 Addr
83 | | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip6} | ${prefix6}
84 | | And Add IP Neighbors
85 | | And Vpp All RA Suppress Link Layer | ${nodes}
86 | | When Configure LISP GPE topology in 3-node circular topology
87 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
88 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
89 | | ... | ${duts_locator_set} | ${dut1_ip6_eid} | ${dut2_ip6_eid}
90 | | ... | ${dut1_to_dut2_ip6_static_adjacency}
91 | | ... | ${dut2_to_dut1_ip6_static_adjacency}
92 | | ... | ${dut1_dut2_vni} | ${fib_table_1}
93 | | And Setup Qemu DUT1 | ${fib_table_1}
94 | | Then Send packet and verify headers
95 | | ... | ${tg_node} | ${tg1_ip6} | ${tg2_ip6}
96 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
97 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
98 | | And Send packet and verify headers
99 | | ... | ${tg_node} | ${tg2_ip6} | ${tg1_ip6}
100 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
101 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
102
103 *** Keywords ***
104 | Setup Qemu DUT1
105 | | [Documentation] | Setup Vhosts on DUT1 and setup IP on one of them. Setup\
106 | | ... | Qemu and bridge the vhosts. Optionally, you can set fib table ID\
107 | | ... | where the vhost2 interface should be assigned to.
108 | | ...
109 | | [Arguments] | ${fib_table}=0
110 | | ...
111 | | ${vhost1}= | Vpp Create Vhost User Interface | ${dut1_node} | ${sock1}
112 | | ${vhost2}= | Vpp Create Vhost User Interface | ${dut1_node} | ${sock2}
113 | | And Add Fib Table | ${dut1_node} | ${fib_table} | ipv6=${TRUE}
114 | | Assign Interface To Fib Table | ${dut1_node}
115 | | ... | ${vhost2} | ${fib_table} | ipv6=${TRUE}
116 | | Vpp Set If IPv6 Addr | ${dut1_node} | ${vhost2} | ${vhost_ip}
117 | | ... | ${prefix6}
118 | | Set Interface State | ${dut1_node} | ${vhost1} | up
119 | | Set Interface State | ${dut1_node} | ${vhost2} | up
120 | | Create bridge domain | ${dut1_node} | ${bid} | learn=${TRUE}
121 | | Add interface to bridge domain | ${dut1_node}
122 | | ... | ${dut1_to_tg} | ${bid} | 0
123 | | Add interface to bridge domain | ${dut1_node}
124 | | ... | ${vhost1} | ${bid} | 0
125 | | ${vhost_mac}= | Get Vhost User Mac By SW Index | ${dut1_node} | ${vhost2}
126 | | Set test variable | ${dst_vhost_mac} | ${vhost_mac}
127 | | Configure VM for vhost L2BD forwarding | ${dut1_node} | ${sock1} | ${sock2}
128
129 | Add IP Neighbors
130 | | [Documentation]
131 | | ... | Add IP neighbors to physical interfaces on DUTs.
132 | | ...
133 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6}
134 | | ... | ${tg_to_dut1_mac}
135 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6}
136 | | ... | ${tg_to_dut2_mac}
137 | | Add IP Neighbor | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6}
138 | | ... | ${dut2_to_dut1_mac}
139 | | Add IP Neighbor | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6}
140 | | ... | ${dut1_to_dut2_mac}