CSIT-456: IPv4 - ip4-ipsec-lispgpe-ip6 - main fib, vrf, phy2lisp, virt2lisp
[csit.git] / tests / func / lisp / dataplane_generic.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/default.robot
16 | Resource | resources/libraries/robot/testing_path.robot
17 | Resource | resources/libraries/robot/ipv4.robot
18 | Resource | resources/libraries/robot/traffic.robot
19 | Resource | resources/libraries/robot/lisp/lisp_static_adjacency.robot
20 | Resource | resources/libraries/robot/l2_traffic.robot
21 | Library  | resources.libraries.python.IPUtil
22 | Library  | resources.libraries.python.Trace
23 # import additional Lisp settings from resource file
24 | Variables | resources/test_data/lisp/static_adjacency/lisp_static_adjacency.py
25 | Force Tags | 3_NODE_SINGLE_LINK_TOPO | 3_NODE_DOUBLE_LINK_TOPO
26 | ... | VM_ENV | HW_ENV
27 | Test Setup | Run Keywords | Setup all DUTs before test
28 | ...        | AND          | Setup all TGs before traffic script
29 | ...        | AND          | Update All Interface Data On All Nodes | ${nodes}
30 | Test Teardown | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
31 | ...           | AND          | Show vpp trace dump on all DUTs
32 | Documentation | *IP AFI independent functional tests.*
33 | ...
34 | ... | *[Top] Network Topologies:* TG-DUT1-DUT2-TG 3-node circular topology\
35 | ... | with single links between nodes.
36 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-LISP-IPv4-ICMPv4 on DUT1-DUT2,\
37 | ... | Eth-IPv4-ICMPv4 on TG-DUTn for IPv4 routing over LISPoIPv4 tunnel.
38 | ... | *[Cfg] DUT configuration:* DUT1 and DUT2 are configured with IPv4\
39 | ... | routing and static routes. LISPoIPv4 tunnel is\
40 | ... | configured between DUT1 and DUT2.
41 | ... | *[Ver] TG verification:* Test ICMPv4 Echo Request packets\
42 | ... | are sent in both directions by TG on links to DUT1 and DUT2; on receive\
43 | ... | TG verifies packets for correctness and their IPv4 src-addr,\
44 | ... | dst-addr and MAC addresses.
45 | ... | *[Ref] Applicable standard specifications:* RFC6830.
46
47 *** Test Cases ***
48 | TC01: DUT1 and DUT2 route IPv4 over LISPoIPv4 tunnel after disable-enable
49 | | [Documentation]
50 | | ... | [Top] TG-DUT1-DUT2-TG.
51 | | ... | [Enc] Eth-IPv4-LISP-IPv4-ICMPv4 on DUT1-DUT2, Eth-IPv4-ICMPv4 on\
52 | | ... | TG-DUTn.
53 | | ... | [Cfg1] On DUT1 and DUT2 configure IPv4 LISP static adjacencies.
54 | | ... | [Ver1] Make TG send ICMPv4 Echo Req between its interfaces across\
55 | | ... | both DUTs and LISP tunnel between them; verify IPv4 headers on\
56 | | ... | received packets are correct.
57 | | ... | [Cfg2] Disable LISP.
58 | | ... | [Ver2] Verify packets are not received via LISP tunnel.
59 | | ... | [Cfg3] Re-enable LISP.
60 | | ... | [Ver3] Verify packets are received again via LISP tunnel.
61 | | ... | [Ref] RFC6830.
62 | | Given Path for 3-node testing is set
63 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
64 | | And   Interfaces in 3-node path are up
65 | | And   IP addresses are set on interfaces
66 | |       ... | ${dut1_node} | ${dut1_to_dut2}
67 | |       ... | ${dut1_to_dut2_ip4} | ${prefix4}
68 | |       ... | ${dut1_node} | ${dut1_to_tg}
69 | |       ... | ${dut1_to_tg_ip4} | ${prefix4}
70 | |       ... | ${dut2_node} | ${dut2_to_dut1}
71 | |       ... | ${dut2_to_dut1_ip4} | ${prefix4}
72 | |       ... | ${dut2_node} | ${dut2_to_tg}
73 | |       ... | ${dut2_to_tg_ip4} | ${prefix4}
74 | | And   VPP IP Probe | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip4}
75 | | And   VPP IP Probe | ${dut2_node} | ${dut2_to_dut1} | ${dut1_to_dut2_ip4}
76 | | And   Add Arp On Dut | ${dut2_node} | ${dut2_to_tg} | ${tg2_ip4}
77 | |       ... | ${tg_to_dut2_mac}
78 | | And   Add Arp On Dut | ${dut1_node} | ${dut1_to_tg} | ${tg1_ip4}
79 | |       ... | ${tg_to_dut1_mac}
80 | | When Set up Lisp topology
81 | |      ... | ${dut1_node} | ${dut1_to_dut2} | ${NONE}
82 | |      ... | ${dut2_node} | ${dut2_to_dut1} | ${NONE}
83 | |      ... | ${duts_locator_set} | ${dut1_ip4_eid} | ${dut2_ip4_eid}
84 | |      ... | ${dut1_to_dut2_ip4_static_adjacency}
85 | |      ... | ${dut2_to_dut1_ip4_static_adjacency}
86 | | Then Send Packet And Check Headers
87 | |      ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
88 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
89 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
90 | | And Send Packet And Check Headers
91 | |      ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
92 | |      ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
93 | |      ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
94 | | When Disable Lisp | ${dut1_node}
95 | | Then Send packet from Port to Port should failed
96 | |      ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
97 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
98 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
99 | | And Send packet from Port to Port should failed
100 | |      ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
101 | |      ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
102 | |      ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
103 | | When Enable Lisp | ${dut1_node}
104 | | And Vpp Add Lisp Adjacency | ${dut1_node}
105 | |     ... | ${dut1_to_dut2_ip4_static_adjacency['vni']}
106 | |     ... | ${dut1_to_dut2_ip4_static_adjacency['deid']}
107 | |     ... | ${dut1_to_dut2_ip4_static_adjacency['prefix']}
108 | |     ... | ${dut1_to_dut2_ip4_static_adjacency['seid']}
109 | |     ... | ${dut1_to_dut2_ip4_static_adjacency['prefix']}
110 | | And Vpp Add Lisp Adjacency | ${dut2_node}
111 | |     ... | ${dut2_to_dut1_ip4_static_adjacency['vni']}
112 | |     ... | ${dut2_to_dut1_ip4_static_adjacency['deid']}
113 | |     ... | ${dut2_to_dut1_ip4_static_adjacency['prefix']}
114 | |     ... | ${dut2_to_dut1_ip4_static_adjacency['seid']}
115 | |     ... | ${dut2_to_dut1_ip4_static_adjacency['prefix']}
116 | | Then Wait Until Keyword Succeeds | 2x | 5s | Send Packet And Check Headers
117 | |      ... | ${tg_node} | ${tg1_ip4} | ${tg2_ip4}
118 | |      ... | ${tg_to_dut1} | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
119 | |      ... | ${tg_to_dut2} | ${dut2_to_tg_mac} | ${tg_to_dut2_mac}
120 | | And Wait Until Keyword Succeeds | 2x | 5s | Send Packet And Check Headers
121 | |      ... | ${tg_node} | ${tg2_ip4} | ${tg1_ip4}
122 | |      ... | ${tg_to_dut2} | ${tg_to_dut2_mac} | ${dut2_to_tg_mac}
123 | |      ... | ${tg_to_dut1} | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}