2 Documentation Test suite to test cluster connection and propagation switchover using virtual IP, this suite requires additional TOOLS_SYSTEM_2 VM.
3 ... VM is used for its assigned ip-address that will be overlayed by virtual-ip used in test suites.
4 ... Resources of this VM are not required. At suite start this node is shutted down to reduce routing conflicts.
6 Library ../../../libraries/Sxp.py
7 Resource ../../../libraries/ClusterManagement.robot
8 Resource ../../../libraries/SxpClusterLib.robot
10 Suite Setup Setup Custom SXP Cluster Session
11 Suite Teardown Clean Custom SXP Cluster Session
20 Isolation Of SXP Service Follower W/O Bindings Listener Test
21 [Documentation] Device is listener. Connection between device and cluster must be established despite of cluster owner isolation
22 [Setup] Setup Nodes And Connections listener
23 ${cluster_owner} = SxpClusterLib.Get Owner Controller
24 BuiltIn.Wait Until Keyword Succeeds
27 ... SxpClusterLib.Ip Addres Should Be Routed To Follower
28 ... ${MAC_ADDRESS_TABLE}
31 Check Connections ${cluster_owner} listener
32 Isolate SXP Controller ${cluster_owner}
33 BuiltIn.Wait Until Keyword Succeeds
36 ... SxpClusterLib.Ip Addres Should Be Routed To Follower
37 ... ${MAC_ADDRESS_TABLE}
40 Check Connections ${NEW_OWNER} listener
41 [Teardown] Clean Custom SXP Cluster
43 Isolation Of SXP Service Follower W/O Bindings Speaker Test
44 [Documentation] Device is speaker. Connection between device and cluster must be established despite of cluster owner isolation
45 [Setup] Setup Nodes And Connections speaker
46 ${cluster_owner} = SxpClusterLib.Get Owner Controller
47 BuiltIn.Wait Until Keyword Succeeds
50 ... SxpClusterLib.Ip Addres Should Be Routed To Follower
51 ... ${MAC_ADDRESS_TABLE}
54 Check Connections ${cluster_owner} speaker
55 Isolate SXP Controller ${cluster_owner}
56 BuiltIn.Wait Until Keyword Succeeds
59 ... SxpClusterLib.Ip Addres Should Be Routed To Follower
60 ... ${MAC_ADDRESS_TABLE}
63 Check Connections ${NEW_OWNER} speaker
64 [Teardown] Clean Custom SXP Cluster
66 Isolation Of SXP Service Follower Listener Test
67 [Documentation] Device is listener. Cluster owner is isolated but bindings must be propagated to the device throught virtual IP
68 [Setup] Setup Nodes And Connections listener
69 ${cluster_owner} = SxpClusterLib.Get Owner Controller
70 BuiltIn.Wait Until Keyword Succeeds
73 ... SxpClusterLib.Ip Addres Should Be Routed To Follower
74 ... ${MAC_ADDRESS_TABLE}
77 Check Connections ${cluster_owner} listener
78 Add Bindings To Node ${CLUSTER_NODE_ID} ClusterManagement__session_${cluster_owner}
79 BuiltIn.Wait Until Keyword Succeeds 240x 1s Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
80 Isolate SXP Controller ${cluster_owner}
81 BuiltIn.Wait Until Keyword Succeeds
84 ... SxpClusterLib.Ip Addres Should Be Routed To Follower
85 ... ${MAC_ADDRESS_TABLE}
88 Check Connections ${NEW_OWNER} listener
89 BuiltIn.Wait Until Keyword Succeeds 240x 1s Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
90 [Teardown] Clean Custom SXP Cluster
92 Isolation Of SXP Service Follower Speaker Test
93 [Documentation] Device is speaker. Cluster owner is isolated but bindings must be propagated to the cluster throught virtual IP
94 [Setup] Setup Nodes And Connections speaker
95 ${cluster_owner} = SxpClusterLib.Get Owner Controller
96 BuiltIn.Wait Until Keyword Succeeds
99 ... SxpClusterLib.Ip Addres Should Be Routed To Follower
100 ... ${MAC_ADDRESS_TABLE}
103 Check Connections ${cluster_owner} speaker
104 Add Bindings To Node ${DEVICE_NODE_ID} ${DEVICE_SESSION}
105 BuiltIn.Wait Until Keyword Succeeds
109 ... ${CLUSTER_NODE_ID}
110 ... ClusterManagement__session_${cluster_owner}
111 Isolate SXP Controller ${cluster_owner}
112 BuiltIn.Wait Until Keyword Succeeds
115 ... SxpClusterLib.Ip Addres Should Be Routed To Follower
116 ... ${MAC_ADDRESS_TABLE}
119 Check Connections ${NEW_OWNER} speaker
120 BuiltIn.Wait Until Keyword Succeeds
124 ... ${CLUSTER_NODE_ID}
125 ... ClusterManagement__session_${NEW_OWNER}
126 [Teardown] Clean Custom SXP Cluster
130 Setup Custom SXP Cluster Session
131 [Documentation] Prepare topology for testing, creates sessions and generate Route definitions based on Cluster nodes IP
132 SxpClusterLib.Shutdown Tools Node
133 SxpClusterLib.Create Virtual Interface
134 SxpClusterLib.Setup SXP Cluster Session
135 SxpClusterLib.Setup Device Session
136 Retrieve Mac-addresses
139 Retrieve Mac-addresses
140 [Documentation] Create list of ODL nodes mac-addresses
141 ${mac_addresses} = SxpClusterLib.Map Followers To Mac Addresses
142 BuiltIn.Set Suite Variable ${MAC_ADDRESS_TABLE} ${mac_addresses}
145 [Documentation] Enable routing to cluster through virtual IP
146 ${route} = Sxp.Route Definition Xml ${VIRTUAL_IP} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE}
147 ${routes} = Sxp.Route Definitions Xml ${route}
148 SxpLib.Put Routing Configuration To Controller ${routes} ${CONTROLLER_SESSION}
150 Setup Nodes And Connections
151 [Documentation] Setup and connect SXP cluster topology and one device
152 [Arguments] ${peer_mode}
153 SxpClusterLib.Check Shards Status
154 SxpLib.Add Node ${DEVICE_NODE_ID} session=${DEVICE_SESSION} retry_open_timer=2
155 BuiltIn.Wait Until Keyword Succeeds
158 ... SxpLib.Check Node Started
159 ... ${DEVICE_NODE_ID}
160 ... session=${DEVICE_SESSION}
161 SxpLib.Add Connection
166 ... ${DEVICE_NODE_ID}
167 ... session=${DEVICE_SESSION}
168 ${cluster_mode} = Sxp.Get Opposing Mode ${peer_mode}
169 SxpLib.Add Node ${CLUSTER_NODE_ID} session=${CONTROLLER_SESSION} retry_open_timer=5
170 BuiltIn.Wait Until Keyword Succeeds 240x 1s SxpClusterLib.Check Cluster Node Started ${CLUSTER_NODE_ID}
171 SxpLib.Add Connection
174 ... ${DEVICE_NODE_ID}
176 ... ${CLUSTER_NODE_ID}
177 ... session=${CONTROLLER_SESSION}
179 Clean Custom SXP Cluster Session
180 [Documentation] Clean up resources generated by test
181 SxpLib.Clean Routing Configuration To Controller ${CONTROLLER_SESSION}
182 SxpClusterLib.Clean SXP Cluster Session
183 SxpClusterLib.Delete Virtual Interface
185 Clean Custom SXP Cluster
186 [Documentation] Disconnect SXP cluster topology
187 ClusterManagement.Flush_Iptables_From_List_Or_All
188 BuiltIn.Wait_Until_Keyword_Succeeds
191 ... ClusterManagement.Verify_Members_Are_Ready
192 ... member_index_list=${EMPTY}
193 ... verify_cluster_sync=True
194 ... verify_restconf=True
195 ... verify_system_status=False
196 ... service_list=${EMPTY_LIST}
197 SxpLib.Delete Node ${DEVICE_NODE_ID} session=${DEVICE_SESSION}
198 SxpLib.Delete Node ${CLUSTER_NODE_ID} session=${CONTROLLER_SESSION}
201 [Documentation] Setup initial bindings to SXP device/controller ${node} with ${session}
202 [Arguments] ${node} ${session}
203 FOR ${i} IN RANGE 1 ${BINDINGS}
204 SxpLib.Add Bindings ${i}0 ${i}.${i}.${i}.${i}/32 node=${node} session=${session}
207 Isolate SXP Controller
208 [Documentation] Isolate cluster node specified by ${controller_index} and find new owner
209 [Arguments] ${controller_index}
210 @{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index}
211 BuiltIn.Wait_Until_Keyword_Succeeds
214 ... ClusterManagement.Verify_Members_Are_Ready
215 ... member_index_list=${running_members}
216 ... verify_cluster_sync=True
217 ... verify_restconf=True
218 ... verify_system_status=False
219 ... service_list=${EMPTY_LIST}
220 BuiltIn.Wait Until Keyword Succeeds
223 ... ClusterManagement.Sync_Status_Should_Be_False
224 ... ${controller_index}
225 BuiltIn.Wait Until Keyword Succeeds
228 ... SxpClusterLib.Ip Addres Should Not Be Routed To Follower
229 ... ${MAC_ADDRESS_TABLE}
231 ... ${controller_index}
232 ${running_member} = Collections.Get From List ${running_members} 0
233 ${new_owner} = SxpClusterLib.Get Owner Controller ${running_member}
234 BuiltIn.Set Test Variable ${NEW_OWNER} ${new_owner}
237 [Documentation] Check that connection is established between device and the cluster
238 [Arguments] ${controller_index} ${peer_mode}
239 ${cluster_mode} = Sxp.Get Opposing Mode ${peer_mode}
240 BuiltIn.Wait Until Keyword Succeeds
243 ... SxpClusterLib.Check Cluster is Connected
244 ... ${CLUSTER_NODE_ID}
245 ... mode=${cluster_mode}
246 ... session=ClusterManagement__session_${controller_index}
247 BuiltIn.Wait Until Keyword Succeeds
250 ... Check Device is Connected
251 ... ${DEVICE_NODE_ID}
253 ... session=${DEVICE_SESSION}
255 Check Device is Connected
256 [Documentation] Check if SXP device is connected to the cluster. It means it has connection to ${VIRTUAL_IP} in state "on"
257 [Arguments] ${node} ${mode} ${session} ${version}=version4 ${port}=64999
258 ${resp} = SxpLib.Get Connections node=${node} session=${session}
259 SxpLib.Should Contain Connection ${resp} ${VIRTUAL_IP} ${port} ${mode} ${version} on
262 [Documentation] Check that bindings were propagated to the peer ${node}
263 [Arguments] ${node} ${session}
264 ${resp} = SxpLib.Get Bindings node=${node} session=${session}
265 FOR ${i} IN RANGE 1 ${BINDINGS}
266 SxpLib.Should Contain Binding ${resp} ${i}0 ${i}.${i}.${i}.${i}/32