2 Documentation Test suite to test cluster binding propagation
4 Library ../../../libraries/Sxp.py
5 Resource ../../../libraries/ClusterManagement.robot
6 Resource ../../../libraries/SxpClusterLib.robot
7 Resource ../../../libraries/SxpLib.robot
9 Suite Setup SxpClusterLib.Setup SXP Cluster Session With Device
10 Suite Teardown SxpClusterLib.Clean SXP Cluster Session
14 ${RUNNING_MEMBER} ${EMPTY}
18 Isolation of SXP service follower Test Speaker Part
19 [Documentation] Test SXP binding propagation from device to cluster after cluster owner is isolated
20 [Setup] Setup Custom SXP Cluster speaker
21 ${controller_index} = SxpClusterLib.Get Owner Controller
22 BuiltIn.Wait Until Keyword Succeeds
27 ... ClusterManagement__session_${controller_index}
28 Isolate SXP Controller ${controller_index} ${INADDR_ANY}
29 BuiltIn.Wait Until Keyword Succeeds
34 ... ClusterManagement__session_${RUNNING_MEMBER}
35 UnIsolate SXP Controller ${controller_index}
36 BuiltIn.Wait Until Keyword Succeeds
41 ... ClusterManagement__session_${controller_index}
42 [Teardown] SxpClusterLib.Clean SXP Cluster
44 Isolation of SXP noservice follower Test Speaker Part
45 [Documentation] Test SXP binding propagation from device to cluster after cluster (not owner) node is isolated
46 [Setup] Setup Custom SXP Cluster speaker
47 ${controller_index} = SxpClusterLib.Get Not Owner Controller
48 BuiltIn.Wait Until Keyword Succeeds
53 ... ClusterManagement__session_${controller_index}
54 Isolate SXP Controller ${controller_index} ${INADDR_ANY}
55 BuiltIn.Wait Until Keyword Succeeds
60 ... ClusterManagement__session_${RUNNING_MEMBER}
61 UnIsolate SXP Controller ${controller_index}
62 BuiltIn.Wait Until Keyword Succeeds
67 ... ClusterManagement__session_${controller_index}
68 [Teardown] SxpClusterLib.Clean SXP Cluster
70 Isolation of SXP service follower Test Listener Part
71 [Documentation] Test SXP binding propagation from cluster to device after cluster owner is isolated
72 [Setup] Setup Custom SXP Cluster listener ${INADDR_ANY} ${CONTROLLER_SESSION}
73 ${controller_index} = SxpClusterLib.Get Owner Controller
74 BuiltIn.Wait Until Keyword Succeeds 120x 1s Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
75 Isolate SXP Controller ${controller_index} ${DEVICE_NODE_ID} ${DEVICE_SESSION}
76 BuiltIn.Wait Until Keyword Succeeds 120x 1s Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
77 UnIsolate SXP Controller ${controller_index}
78 BuiltIn.Wait Until Keyword Succeeds 120x 1s Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
79 [Teardown] SxpClusterLib.Clean SXP Cluster
81 Isolation of SXP noservice follower Test Listener Part
82 [Documentation] Test SXP binding propagation from cluster to device after cluster (not owner) node is isolated
83 [Setup] Setup Custom SXP Cluster listener ${INADDR_ANY} ${CONTROLLER_SESSION}
84 ${controller_index} = SxpClusterLib.Get Not Owner Controller
85 BuiltIn.Wait Until Keyword Succeeds 120x 1s Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
86 Isolate SXP Controller ${controller_index} ${DEVICE_NODE_ID} ${DEVICE_SESSION}
87 BuiltIn.Wait Until Keyword Succeeds 120x 1s Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
88 UnIsolate SXP Controller ${controller_index}
89 BuiltIn.Wait Until Keyword Succeeds 120x 1s Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
90 [Teardown] SxpClusterLib.Clean SXP Cluster
94 Setup Custom SXP Cluster
95 [Documentation] Setup custom SXP cluster topology with ${NUM_ODL_SYSTEM} nodes and one device
96 [Arguments] ${mode} ${node}=${DEVICE_NODE_ID} ${session}=${DEVICE_SESSION}
97 SxpClusterLib.Check Shards Status
98 SxpClusterLib.Setup SXP Cluster ${mode}
99 FOR ${i} IN RANGE 1 25
100 SxpLib.Add Bindings ${i}0 ${i}.${i}.${i}.${i}/32 node=${node} session=${session}
103 Isolate SXP Controller
104 [Documentation] Isolate one of cluster nodes and perform check that device is connected
105 [Arguments] ${controller_index} ${node} ${session}=ClusterManagement__session_${controller_index}
106 @{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index}
107 BuiltIn.Wait Until Keyword Succeeds
110 ... ClusterManagement.Verify_Members_Are_Ready
111 ... member_index_list=${running_members}
112 ... verify_cluster_sync=True
113 ... verify_restconf=True
114 ... verify_system_status=False
115 ... service_list=${EMPTY_LIST}
116 ${running_member} = Collections.Get From List ${running_members} 0
117 BuiltIn.Set Test Variable ${RUNNING_MEMBER} ${running_member}
118 BuiltIn.Wait Until Keyword Succeeds
121 ... ClusterManagement.Sync_Status_Should_Be_False
122 ... ${controller_index}
123 BuiltIn.Wait Until Keyword Succeeds
126 ... SxpClusterLib.Check Device is Connected
127 ... ${DEVICE_NODE_ID}
128 ... session=${DEVICE_SESSION}
130 UnIsolate SXP Controller
131 [Documentation] Un-Isolate one of cluster nodes and perform check that device is connected
132 [Arguments] ${controller_index}
133 ClusterManagement.Flush_Iptables_From_List_Or_All
134 BuiltIn.Wait Until Keyword Succeeds
137 ... ClusterManagement.Verify_Members_Are_Ready
138 ... member_index_list=${EMPTY}
139 ... verify_cluster_sync=True
140 ... verify_restconf=True
141 ... verify_system_status=False
142 ... service_list=${EMPTY_LIST}
143 BuiltIn.Wait Until Keyword Succeeds
146 ... SxpClusterLib.Check Device is Connected
147 ... ${DEVICE_NODE_ID}
148 ... session=${DEVICE_SESSION}
151 [Documentation] Checks that bindings were propagated to Peer
152 [Arguments] ${node} ${session}
153 ${resp} = SxpLib.Get Bindings node=${node} session=${session}
154 FOR ${i} IN RANGE 1 25
155 SxpLib.Should Contain Binding ${resp} ${i}0 ${i}.${i}.${i}.${i}/32