2 Documentation Test suite to test cluster binding propagation
3 Suite Setup SxpClusterLib.Setup SXP Cluster Session With Device
4 Suite Teardown SxpClusterLib.Clean SXP Cluster Session
5 Library ../../../libraries/Sxp.py
6 Resource ../../../libraries/ClusterManagement.robot
7 Resource ../../../libraries/SxpClusterLib.robot
8 Resource ../../../libraries/SxpLib.robot
11 ${RUNNING_MEMBER} ${EMPTY}
14 Isolation of SXP service follower Test Speaker Part
15 [Documentation] Test SXP binding propagation from device to cluster after cluster owner is isolated
16 [Setup] Setup Custom SXP Cluster speaker
17 ${controller_index} = SxpClusterLib.Get Owner Controller
18 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${INADDR_ANY} ClusterManagement__session_${controller_index}
19 Isolate SXP Controller ${controller_index} ${INADDR_ANY}
20 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${INADDR_ANY} ClusterManagement__session_${RUNNING_MEMBER}
21 UnIsolate SXP Controller ${controller_index}
22 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${INADDR_ANY} ClusterManagement__session_${controller_index}
23 [Teardown] SxpClusterLib.Clean SXP Cluster
25 Isolation of SXP noservice follower Test Speaker Part
26 [Documentation] Test SXP binding propagation from device to cluster after cluster (not owner) node is isolated
27 [Setup] Setup Custom SXP Cluster speaker
28 ${controller_index} = SxpClusterLib.Get Not Owner Controller
29 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${INADDR_ANY} ClusterManagement__session_${controller_index}
30 Isolate SXP Controller ${controller_index} ${INADDR_ANY}
31 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${INADDR_ANY} ClusterManagement__session_${RUNNING_MEMBER}
32 UnIsolate SXP Controller ${controller_index}
33 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${INADDR_ANY} ClusterManagement__session_${controller_index}
34 [Teardown] SxpClusterLib.Clean SXP Cluster
36 Isolation of SXP service follower Test Listener Part
37 [Documentation] Test SXP binding propagation from cluster to device after cluster owner is isolated
38 [Setup] Setup Custom SXP Cluster listener ${INADDR_ANY} ${CONTROLLER_SESSION}
39 ${controller_index} = SxpClusterLib.Get Owner Controller
40 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
41 Isolate SXP Controller ${controller_index} ${DEVICE_NODE_ID} ${DEVICE_SESSION}
42 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
43 UnIsolate SXP Controller ${controller_index}
44 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
45 [Teardown] SxpClusterLib.Clean SXP Cluster
47 Isolation of SXP noservice follower Test Listener Part
48 [Documentation] Test SXP binding propagation from cluster to device after cluster (not owner) node is isolated
49 [Setup] Setup Custom SXP Cluster listener ${INADDR_ANY} ${CONTROLLER_SESSION}
50 ${controller_index} = SxpClusterLib.Get Not Owner Controller
51 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
52 Isolate SXP Controller ${controller_index} ${DEVICE_NODE_ID} ${DEVICE_SESSION}
53 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
54 UnIsolate SXP Controller ${controller_index}
55 BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
56 [Teardown] SxpClusterLib.Clean SXP Cluster
59 Setup Custom SXP Cluster
60 [Arguments] ${mode} ${node}=${DEVICE_NODE_ID} ${session}=${DEVICE_SESSION}
61 [Documentation] Setup custom SXP cluster topology with ${NUM_ODL_SYSTEM} nodes and one device
62 SxpClusterLib.Setup SXP Cluster ${mode}
63 : FOR ${i} IN RANGE 1 25
64 \ SxpLib.Add Bindings ${i}0 ${i}.${i}.${i}.${i}/32 node=${node} session=${session}
66 Isolate SXP Controller
67 [Arguments] ${controller_index} ${node} ${session}=ClusterManagement__session_${controller_index}
68 [Documentation] Isolate one of cluster nodes and perform check that device is connected
69 @{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index}
70 ${running_member} = Collections.Get From List ${running_members} 0
71 BuiltIn.Set Test Variable ${RUNNING_MEMBER} ${running_member}
72 BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_False ${controller_index}
73 BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Device is Connected ${DEVICE_NODE_ID} session=${DEVICE_SESSION}
75 UnIsolate SXP Controller
76 [Arguments] ${controller_index}
77 [Documentation] Un-Isolate one of cluster nodes and perform check that device is connected
78 ClusterManagement.Flush_Iptables_From_List_Or_All
79 BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_True ${controller_index}
80 BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Device is Connected ${DEVICE_NODE_ID} session=${DEVICE_SESSION}
83 [Arguments] ${node} ${session}
84 [Documentation] Checks that bindings were propagated to Peer
85 ${resp} = SxpLib.Get Bindings node=${node} session=${session}
86 : FOR ${i} IN RANGE 1 25
87 \ SxpLib.Should Contain Binding ${resp} ${i}0 ${i}.${i}.${i}.${i}/32