CSIT-1386 KernelVM - Part I
[csit.git] / tests / vpp / func / vm_vhost / ip4 / eth2p-ethip4lispgpe-ip6base-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 | Resource | resources/libraries/robot/shared/default.robot
16 | Resource | resources/libraries/robot/shared/testing_path.robot
17 | Resource | resources/libraries/robot/ip/ip4.robot
18 | Resource | resources/libraries/robot/shared/traffic.robot
19 | Resource | resources/libraries/robot/overlay/lisp_static_adjacency.robot
20 | Resource | resources/libraries/robot/l2/l2_traffic.robot
21 | Resource | resources/libraries/robot/overlay/lispgpe.robot
22 | Resource | resources/libraries/robot/l2/l2_bridge_domain.robot
23 | Library  | resources.libraries.python.IPUtil
24 | Library | resources.libraries.python.VhostUser
25 | Library  | resources.libraries.python.Trace
26 | Library  | resources.libraries.python.VPPUtil
27 # import additional Lisp settings from resource file
28 | Variables | resources/test_data/lisp/static_adjacency/lisp_static_adjacency.py
29 | ...
30 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO
31 | ... | VM_ENV | HW_ENV
32 | ...
33 | Test Setup | Set up functional test
34 | ...
35 | Test Teardown | Tear down LISP functional test with QEMU
36 | ...
37 | Documentation | *LISP static adjacency test cases*
38 | ...
39 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
40 | ... | with single links between nodes.
41 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-LISP-IPv6-ICMPv6 on DUT1-DUT2,\
42 | ... | Eth-IPv6-ICMPv6 on TG-DUTn for IPv6 routing over LISPoIPv4 tunnel.
43 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv6\
44 | ... | routing and static routes. LISPoIPv4 tunnel is configured\
45 | ... | between DUT1 and DUT2.
46 | ... | *[Ver] TG verification:* Test ICMPv6 Echo Request packets\
47 | ... | are sent in both directions by TG on links to DUT1 and DUT2; on receive\
48 | ... | TG verifies packets for correctness and their IPv6 src-addr,\
49 | ... | dst-addr and MAC addresses.
50 | ... | *[Ref] Applicable standard specifications:* RFC6830.
51
52 *** Test Cases ***
53 | TC01: DUT1 and DUT2 route IPv6 bidirectionally over LISP GPE tunnel using vhost interfaces
54 | | [Documentation]
55 | | ... | [Top] TG-DUT1-DUT2-TG.
56 | | ... | [Enc] Eth-IPv4-LISPGPE-IPv6-ICMPv6 on DUT1-DUT2, Eth-IPv6-ICMPv6 on\
57 | | ... | TG-DUTn.
58 | | ... | [Cfg] Configure IPv4 LISP static adjacencies on DUT1 and DUT2.
59 | | ... | [Ver] Case: ip6-lispgpe-ip4 - main fib, virt2lisp
60 | | ... | Make TG send ICMPv6 Echo Req between its interfaces across both\
61 | | ... | DUTs and LISP GPE tunnel between them; verify IPv6 headers on\
62 | | ... | received packets are correct.
63 | | ...
64 | | Given Configure path in 3-node circular topology
65 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
66 | | And Set interfaces in 3-node circular topology up
67 | | And Configure IP addresses on interfaces
68 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip6o4}
69 | | ... | ${dut_prefix6o4}
70 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip6o4} | ${tg_prefix6o4}
71 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_dut1_ip6o4}
72 | | ... | ${dut_prefix6o4}
73 | | ... | ${dut2_node} | ${dut2_to_tg} | ${dut2_to_tg_ip6o4} | ${tg_prefix6o4}
74 | | And Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip6o4}
75 | | ... | ${tg_to_dut1_mac}
76 | | And Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip6o4}
77 | | ... | ${tg_to_dut2_mac}
78 | | And Add Arp On Dut | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip6o4}
79 | | ... | ${dut2_to_dut1_mac}
80 | | And Add Arp On Dut | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip6o4}
81 | | ... | ${dut1_to_dut2_mac}
82 | | And Vpp All RA Suppress Link Layer | ${nodes}
83 | | When Configure LISP GPE topology in 3-node circular topology
84 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
85 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
86 | | ... | ${duts_locator_set} | ${dut1_ip6o4_eid} | ${dut2_ip6o4_eid}
87 | | ... | ${dut1_ip6o4_static_adjacency}
88 | | ... | ${dut2_ip6o4_static_adjacency}
89 | | And Setup Qemu DUT1
90 | | Then Send packet and verify headers
91 | | ... | ${tg_node} | ${tg1_ip6o4} | ${tg2_ip6o4}
92 | | ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dst_vhost_mac}
93 | | ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
94 | | And Send packet and verify headers
95 | | ... | ${tg_node} | ${tg2_ip6o4} | ${tg1_ip6o4}
96 | | ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
97 | | ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
98
99 *** Keywords ***
100 | Setup Qemu DUT1
101 | | [Documentation] | Setup Vhosts on DUT1 and setup IP on one of them. Setup\
102 | | ... | Qemu and bridge the vhosts.
103 | | ...
104 | | ${vhost1}= | Vpp Create Vhost User Interface | ${dut1_node} | ${sock1}
105 | | ${vhost2}= | Vpp Create Vhost User Interface | ${dut1_node} | ${sock2}
106 | | Set Interface Address | ${dut1_node} | ${vhost2} | ${vhost_ip} | ${prefix6}
107 | | Set Interface State | ${dut1_node} | ${vhost1} | up
108 | | Set Interface State | ${dut1_node} | ${vhost2} | up
109 | | Create bridge domain | ${dut1_node} | ${bid} | learn=${TRUE}
110 | | Add interface to bridge domain | ${dut1_node}
111 | | ... | ${dut1_to_tg} | ${bid} | 0
112 | | Add interface to bridge domain | ${dut1_node}
113 | | ... | ${vhost1} | ${bid} | 0
114 | | ${vhost_mac}= | Get Vhost User Mac By SW Index | ${dut1_node} | ${vhost2}
115 | | Set test variable | ${dst_vhost_mac} | ${vhost_mac}
116 | | Configure VM for vhost L2BD forwarding | ${dut1_node} | ${sock1} | ${sock2}