f9da0be399d499575cecb6a4c5299e0d4a829ce2
[csit.git] / resources / libraries / robot / overlay / lisp.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.LispSetup.LispAdjacency
16 | Library  | resources.libraries.python.LispSetup.LispEidTableMap
17 | Library  | resources.libraries.python.LispSetup.LispLocalEid
18 | Library  | resources.libraries.python.LispSetup.LispLocator
19 | Library  | resources.libraries.python.LispSetup.LispLocatorSet
20 | Library  | resources.libraries.python.LispSetup.LispRemoteMapping
21 | Resource | resources/libraries/robot/shared/default.robot
22
23 *** Keywords ***
24 | Configure topology for IPv4 LISP testing
25 | | [Documentation] | Setup topology for IPv4 LISP testing.
26 | |
27 | | ... | *Example:*
28 | | ... | \| Configure topology for IPv4 LISP testing \|
29 | |
30 | | Set interfaces in path up
31 | | VPP Interface Set IP Address
32 | | ... | ${dut1} | ${dut1_if1} | ${dut_if1_ip4} | ${ip4_plen}
33 | | VPP Interface Set IP Address
34 | | ... | ${dut1} | ${dut1_if2} | ${dut_if2_ip4} | ${ip4_plen}
35 | | VPP Add IP Neighbor
36 | | ... | ${dut1} | ${dut1_if1} | ${src_ip4} | ${tg_if1_mac}
37 | | VPP Add IP Neighbor
38 | | ... | ${dut1} | ${dut1_if2} | ${dst_ip4} | ${tg_if2_mac}
39 | | VPP Add IP Neighbor
40 | | ... | ${dut1} | ${dut1_if2} | ${tg_if2_ip4} | ${tg_if2_mac}
41
42 | Configure topology for IPv6 LISP testing
43 | | [Documentation] | Setup topology fo IPv6 LISP testing.
44 | |
45 | | ... | *Example:*
46 | | ... | \| Configure topology for IPv6 LISP testing \|
47 | |
48 | | Set interfaces in path up
49 | | VPP Interface Set IP Address
50 | | ... | ${dut1} | ${dut1_if1} | ${dut_if1_ip6} | ${ip6_plen}
51 | | VPP Interface Set IP Address
52 | | ... | ${dut1} | ${dut1_if2} | ${dut_if2_ip6} | ${ip6_plen}
53 | | VPP Add IP Neighbor
54 | | ... | ${dut1} | ${dut1_if1} | ${src_ip6} | ${tg_if1_mac}
55 | | VPP Add IP Neighbor
56 | | ... | ${dut1} | ${dut1_if2} | ${dst_ip6} | ${tg_if2_mac}
57 | | VPP Add IP Neighbor
58 | | ... | ${dut1} | ${dut1_if2} | ${tg_if2_ip6} | ${tg_if2_mac}
59
60 | Configure LISP in 2-node circular topology
61 | | [Documentation] | Configure LISP topology in 2-node circular topology.
62 | |
63 | | ... | *Arguments:*
64 | | ... | - dut1 - DUT1 node. Type: dictionary
65 | | ... | - dut1_if - DUT1 node interface. Type: string
66 | | ... | - dut1_int_index - DUT1 node interface index. Type: integer
67 | | ... | - locator_set - Locator set values. Type: dictionary
68 | | ... | - dut1_eid - DUT1 node eid address. Type: dictionary
69 | | ... | - dut1_static_adjacency - DUT1 static adjacency. Type: dictionary
70 | | ... | - is_gpe - To enable GPE. Other than zero to enable Type: integer
71 | | ... | - vni_table - vni table Eid Table Mapping Type: integer
72 | | ... | - vrf_table - vrf table Eid Table Mapping Type: integer
73 | |
74 | | ... | *Return:*
75 | | ... | - No value returned
76 | |
77 | | ... | *Example:*
78 | | ... | \| Configure LISP in 2-node circular topology \
79 | | ... | \| ${dut1} \| ${interface_name} \
80 | | ... | \| None \| ${locator_set} \| ${dut1_eid} \
81 | | ... | \| ${dut1_static_adjacency} \|
82 | |
83 | | [Arguments]
84 | | ... | ${dut1} | ${dut1_if} | ${dut1_int_index}
85 | | ... | ${locator_set} | ${dut1_eid}
86 | | ... | ${dut1_static_adjacency}
87 | | ... | ${is_gpe}=0
88 | | ... | ${vni_table}=0 | ${vrf_table}=0
89 | |
90 | | # DUT1 settings:
91 | | ${dut1_int_index}= | Run Keyword If | ${dut1_int_index} is None
92 | | ... | Get Interface Sw Index | ${dut1} | ${dut1_if}
93 | | ... | ELSE | Set Variable | ${dut1_int_index}
94 | | Enable Lisp | ${dut1}
95 | | Run keyword if | ${is_gpe} != 0
96 | | ... | Enable Lisp GPE | ${dut1}
97 | | Vpp Add Lisp Locator Set | ${dut1} | ${locator_set['locator_name']}
98 | | Vpp Add Lisp Locator | ${dut1} | ${locator_set['locator_name']}
99 | | ... | ${dut1_int_index} | ${locator_set['priority']}
100 | | ... | ${locator_set['weight']}
101 | | Run keyword if | ${is_gpe} != 0
102 | | ... | Vpp Lisp Eid Table Mapping | ${dut1}
103 | | ... | ${vni_table}
104 | | ... | vrf=${vrf_table}
105 | | Vpp Add Lisp Local Eid | ${dut1} | ${dut1_eid['locator_name']}
106 | | ... | ${dut1_eid['vni']} | ${dut1_eid['eid']} | ${dut1_eid['prefix']}
107 | | Vpp Add Lisp Remote Mapping | ${dut1} | ${dut1_static_adjacency['vni']}
108 | | ... | ${dut1_static_adjacency['deid']}
109 | | ... | ${dut1_static_adjacency['prefix']}
110 | | ... | ${dut1_static_adjacency['seid']}
111 | | ... | ${dut1_static_adjacency['prefix']}
112 | | ... | ${dut1_static_adjacency['rloc']}
113 | | Vpp Add Lisp Adjacency | ${dut1} | ${dut1_static_adjacency['vni']}
114 | | ... | ${dut1_static_adjacency['deid']}
115 | | ... | ${dut1_static_adjacency['prefix']}
116 | | ... | ${dut1_static_adjacency['seid']}
117 | | ... | ${dut1_static_adjacency['prefix']}
118
119 | Configure topology for IPv6 LISPoIP4 testing
120 | | [Documentation] | Setup topology fo IPv6 LISPoIPV4 testing.
121 | |
122 | | ... | *Example:*
123 | | ... | \| Configure topology for IPv6 LISPoIP4 testing \|
124 | |
125 | | Set interfaces in path up
126 | | VPP Interface Set IP Address
127 | | ... | ${dut1} | ${dut1_if1} | ${dut_if1_ip6} | ${ip6_plen}
128 | | VPP Interface Set IP Address
129 | | ... | ${dut1} | ${dut1_if2} | ${dut_if2_ip4} | ${ip4_plen}
130 | | VPP Add IP Neighbor
131 | | ... | ${dut1} | ${dut1_if1} | ${src_ip6} | ${tg_if1_mac}
132 | | VPP Add IP Neighbor
133 | | ... | ${dut1} | ${dut1_if2} | ${dst_ip6} | ${tg_if2_mac}
134 | | VPP Add IP Neighbor
135 | | ... | ${dut1} | ${dut1_if2} | ${tg_if2_ip4} | ${tg_if2_mac}
136
137 | Configure topology for IPv4 LISPoIP6 testing
138 | | [Documentation] | Setup topology fo IPv4 LISPoIPV6 testing.
139 | |
140 | | ... | *Example:*
141 | | ... | \| Configure topology for IPv4 LISPoIP6 testing \|
142 | |
143 | | Set interfaces in path up
144 | | VPP Interface Set IP Address
145 | | ... | ${dut1} | ${dut1_if1} | ${dut_if1_ip4} | ${ip4_plen}
146 | | VPP Interface Set IP Address
147 | | ... | ${dut1} | ${dut1_if2} | ${dut_if2_ip6} | ${ip6_plen}
148 | | VPP Add IP Neighbor
149 | | ... | ${dut1} | ${dut1_if1} | ${src_ip4} | ${tg_if1_mac}
150 | | VPP Add IP Neighbor
151 | | ... | ${dut1} | ${dut1_if2} | ${dst_ip4} | ${tg_if2_mac}
152 | | VPP Add IP Neighbor
153 | | ... | ${dut1} | ${dut1_if2} | ${tg_if2_ip6} | ${tg_if2_mac}