389b1bfb40d5c3b486eb526bed364a18d47a4ad6
[csit.git] / resources / libraries / robot / overlay / lisp_static_adjacency.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 | Documentation | Lisp static adjacency suite keywords
16 | Resource | resources/libraries/robot/overlay/lisp_api.robot
17 | Library  | resources.libraries.python.LispSetup.LispLocatorSet
18 | Library  | resources.libraries.python.LispSetup.LispLocator
19 | Library  | resources.libraries.python.LispSetup.LispLocalEid
20 | Library  | resources.libraries.python.LispSetup.LispAdjacency
21 | Library  | resources.libraries.python.LispSetup.LispRemoteMapping
22 | Library  | resources.libraries.python.IPv4Util.IPv4Util
23
24 *** Keywords ***
25 | Configure LISP topology in 3-node circular topology
26 | | [Documentation] | Set up Lisp static adjacency topology.
27 | | ...
28 | | ... | *Arguments:*
29 | | ... | - dut1_node - DUT1 node. Type: dictionary
30 | | ... | - dut1_int_name - DUT1 node interface name. Type: string
31 | | ... | - dut1_int_index - DUT1 node interface index. Type: integer
32 | | ... | - dut2_node - DUT2 node. Type: dictionary
33 | | ... | - dut2_int_name - DUT2 node interface name. Type: string
34 | | ... | - dut2_int_index - DUT2 node interface index. Type: integer
35 | | ... | - locator_set - Locator set values. Type: dictionary
36 | | ... | - dut1_eid - Dut1 node eid address. Type: dictionary
37 | | ... | - dut2_eid - Dut2 node eid address. Type: dictionary
38 | | ... | - dut1_static_adjacency - Dut1 static adjacency. Type: dictionary
39 | | ... | - dut2_static_adjacency - Dut2 static address. Type: dictionary
40 | | ...
41 | | ... | *Return:*
42 | | ... | - No value returned
43 | | ...
44 | | ... | *Example:*
45 | | ... | \| Configure LISP topology in 3-node circular topology \
46 | | ... | \| ${dut1_node} \| ${interface_name} \| None \
47 | | ... | \| ${dut2_node} \| ${interface_name} \| None \
48 | | ... | \| ${locator_set} \| ${dut1_eid} \| ${dut2_eid} \
49 | | ... | \| ${dut1_static_adjacency} \| ${dut2_static_adjacency} \|
50 | | ...
51 | | [Arguments] | ${dut1_node} | ${dut1_int_name} | ${dut1_int_index}
52 | | ...         | ${dut2_node} | ${dut2_int_name} | ${dut2_int_index}
53 | | ...         | ${locator_set} | ${dut1_eid} | ${dut2_eid}
54 | | ...         | ${dut1_static_adjacency} | ${dut2_static_adjacency}
55 | | ${dut1_int_index}= | Run Keyword If | ${dut1_int_index} is None
56 | |                    | ... | Get Interface Sw Index | ${dut1_node}
57 | |                    | ...                          | ${dut1_int_name}
58 | |                    | ... | ELSE | Set Variable | ${dut1_int_index}
59 | | ${dut2_int_index}= | Run Keyword If | ${dut2_int_index} is None
60 | |                    | ... | Get Interface Sw Index | ${dut2_node}
61 | |                    | ...                          | ${dut2_int_name}
62 | |                    | ... | ELSE | Set Variable | ${dut2_int_index}
63 | | Enable Lisp | ${dut1_node}
64 | | Vpp Add Lisp Locator Set | ${dut1_node} | ${locator_set['locator_name']}
65 | | Vpp Add Lisp Locator | ${dut1_node} | ${locator_set['locator_name']}
66 | | ...                  | ${dut1_int_index} | ${locator_set['priority']}
67 | | ...                  | ${locator_set['weight']}
68 | | Vpp Add Lisp Local Eid | ${dut1_node} | ${dut1_eid['locator_name']}
69 | | ...                    | ${dut1_eid['vni']} | ${dut1_eid['eid']}
70 | | ...                    | ${dut1_eid['prefix']}
71 | | Vpp Add Lisp Remote Mapping | ${dut1_node} | ${dut1_static_adjacency['vni']}
72 | | ...                         | ${dut1_static_adjacency['deid']}
73 | | ...                         | ${dut1_static_adjacency['prefix']}
74 | | ...                         | ${dut1_static_adjacency['seid']}
75 | | ...                         | ${dut1_static_adjacency['prefix']}
76 | | ...                         | ${dut1_static_adjacency['rloc']}
77 | | Vpp Add Lisp Adjacency | ${dut1_node} | ${dut1_static_adjacency['vni']}
78 | | ...                    | ${dut1_static_adjacency['deid']}
79 | | ...                    | ${dut1_static_adjacency['prefix']}
80 | | ...                    | ${dut1_static_adjacency['seid']}
81 | | ...                    | ${dut1_static_adjacency['prefix']}
82 | | Enable Lisp | ${dut2_node}
83 | | Vpp Add Lisp Locator Set | ${dut2_node} | ${locator_set['locator_name']}
84 | | Vpp Add Lisp Locator | ${dut2_node} | ${locator_set['locator_name']}
85 | | ...                  | ${dut2_int_index} | ${locator_set['priority']}
86 | | ...                  | ${locator_set['weight']}
87 | | Vpp Add Lisp Local Eid | ${dut2_node} | ${dut2_eid['locator_name']}
88 | | ...                    | ${dut2_eid['vni']} | ${dut2_eid['eid']}
89 | | ...                    | ${dut2_eid['prefix']}
90 | | Vpp Add Lisp Remote Mapping | ${dut2_node} | ${dut2_static_adjacency['vni']}
91 | | ...                         | ${dut2_static_adjacency['deid']}
92 | | ...                         | ${dut2_static_adjacency['prefix']}
93 | | ...                         | ${dut2_static_adjacency['seid']}
94 | | ...                         | ${dut2_static_adjacency['prefix']}
95 | | ...                         | ${dut2_static_adjacency['rloc']}
96 | | Vpp Add Lisp Adjacency | ${dut2_node} | ${dut2_static_adjacency['vni']}
97 | | ...                    | ${dut2_static_adjacency['deid']}
98 | | ...                    | ${dut2_static_adjacency['prefix']}
99 | | ...                    | ${dut2_static_adjacency['seid']}
100 | | ...                    | ${dut2_static_adjacency['prefix']}
101
102 | Change LISP Configuration
103 | | [Documentation] | Change configuration of the Lisp protocol.
104 | | ...
105 | | ... | *Arguments:*
106 | | ... | - dut1_node - DUT1 node. Type: dictionary
107 | | ... | - dut2_node - DUT2 node. Type: dictionary
108 | | ... | - dut1_to_dut2 - DUT1 towards DUT2 interface name. Type: string
109 | | ... | - dut2_to_dut1 - DUT2 towards DUT1 interface name. Type: string
110 | | ... | - dut1_to_dut2_mac - DUT1 towards DUT2 interface mac address.
111 | | ... |                      Type: string
112 | | ... | - dut2_to_dut1_mac - DUT2 towards DUT1 interface mac address.
113 | | ... |                      Type: string
114 | | ... | - new_dut1_ip - New DUT1 towards DUT2 interface IP address.
115 | | ... |                 Type: string
116 | | ... | - new_dut2_ip - New DUT2 towards DUT1 interface IP address.
117 | | ... |                 Type: string
118 | | ... | - prefix - Prefix of the DUT nodes. Type: integer
119 | | ... | - old_dut1_static_adjacency - Old DUT1 static adjacency.
120 | | ... |                               Type: dictionary
121 | | ... | - new_dut1_static_adjacency - New DUT1 static adjacency.
122 | | ... |                               Type: dictionary
123 | | ...
124 | | ... | *Return:*
125 | | ... | - No value returned
126 | | ...
127 | | ... | *Example:*
128 | | ... | \| Change LISP Configuration \| ${dut1_node} \| ${dut2_node} \
129 | | ... | \| ${dut1_to_dut2} \| ${dut2_to_dut1} | "08:00:27:20:e0:0d" \
130 | | ... | \| "08:00:27:b1:94:b1" \| "6.3.0.1" \| "6.3.0.20" \| "24" \
131 | | ... | \| ${old_dut1_static_adjacency} \| ${new_dut1_static_adjacency} \|
132 | | ...
133 | | [Arguments] | ${dut1_node} | ${dut2_node} | ${dut1_to_dut2}
134 | | ...         | ${dut2_to_dut1} | ${dut1_to_dut2_mac} | ${dut2_to_dut1_mac}
135 | | ...         | ${new_dut1_ip} | ${new_dut2_ip} | ${prefix}
136 | | ...         | ${old_dut1_static_adjacency} | ${new_dut1_static_adjacency}
137 | | Flush IPv4 Addresses "${dut2_to_dut1}" "${dut2_node}"
138 | | Vpp Del Lisp Remote Mapping | ${dut1_node}
139 | | ...                         | ${old_dut1_static_adjacency['vni']}
140 | | ...                         | ${old_dut1_static_adjacency['deid']}
141 | | ...                         | ${old_dut1_static_adjacency['prefix']}
142 | | ...                         | ${old_dut1_static_adjacency['seid']}
143 | | ...                         | ${old_dut1_static_adjacency['prefix']}
144 | | ...                         | ${old_dut1_static_adjacency['rloc']}
145 | | Vpp Del Lisp Adjacency | ${dut1_node}
146 | | ...                    | ${old_dut1_static_adjacency['vni']}
147 | | ...                    | ${old_dut1_static_adjacency['deid']}
148 | | ...                    | ${old_dut1_static_adjacency['prefix']}
149 | | ...                    | ${old_dut1_static_adjacency['seid']}
150 | | ...                    | ${old_dut1_static_adjacency['prefix']}
151 | | Set Interface Address | ${dut2_node} | ${dut2_to_dut1}
152 | | ...                   | ${new_dut2_ip} | ${prefix}
153 | | Add Arp On Dut | ${dut1_node} | ${dut1_to_dut2} | ${new_dut2_ip}
154 | | ...            | ${dut2_to_dut1_mac}
155 | | Add Arp On Dut | ${dut2_node} | ${dut2_to_dut1} | ${new_dut1_ip}
156 | | ...            | ${dut1_to_dut2_mac}
157 | | Vpp Add Lisp Remote Mapping | ${dut1_node}
158 | | ...                         | ${new_dut1_static_adjacency['vni']}
159 | | ...                         | ${new_dut1_static_adjacency['deid']}
160 | | ...                         | ${new_dut1_static_adjacency['prefix']}
161 | | ...                         | ${new_dut1_static_adjacency['seid']}
162 | | ...                         | ${new_dut1_static_adjacency['prefix']}
163 | | ...                         | ${new_dut1_static_adjacency['rloc']}
164 | | Vpp Add Lisp Adjacency | ${dut1_node}
165 | | ...                    | ${new_dut1_static_adjacency['vni']}
166 | | ...                    | ${new_dut1_static_adjacency['deid']}
167 | | ...                    | ${new_dut1_static_adjacency['prefix']}
168 | | ...                    | ${new_dut1_static_adjacency['seid']}
169 | | ...                    | ${new_dut1_static_adjacency['prefix']}