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