${SINGLETON_NETCONF_DEVICE_ID_SUFFIX} ]]]]}']
${SINGLETON_BGPCEP_DEVICE_ID_PREFIX} /odl-general-entity:entity[odl-general-entity:name='
${SINGLETON_BGPCEP_DEVICE_ID_SUFFIX} -service-group']
+${SINGLETON_SXP_DEVICE_ID_PREFIX} /odl-general-entity:entity[odl-general-entity:name='
+${SINGLETON_SXP_DEVICE_ID_SUFFIX} ']
${SINGLETON_ELECTION_ENTITY_TYPE} org.opendaylight.mdsal.ServiceEntityType
${SINGLETON_CHANGE_OWNERSHIP_ENTITY_TYPE} org.opendaylight.mdsal.AsyncServiceCloseEntityType
${NODE_ROLE_INDEX_START} 1
BuiltIn.Should_Be_Equal_As_Integers ${owner_1} ${owner_2} Owners for device ${device_name} are not same
[Return] ${owner_1} ${candidate_list_1}
+Get_Owner_And_Candidates_For_Device_Singleton_Sxp
+ [Arguments] ${device_name} ${member_index} ${http_timeout}=${EMPTY}
+ [Documentation] Returns the owner and a list of candidates for the SB device ${device_name}. Request is sent to member ${member_index}.
+ # Get election entity type results
+ ${type} = BuiltIn.Set_Variable ${SINGLETON_ELECTION_ENTITY_TYPE}
+ ${id} = BuiltIn.Set_Variable ${SINGLETON_SXP_DEVICE_ID_PREFIX}${device_name}${SINGLETON_SXP_DEVICE_ID_SUFFIX}
+ ${owner_1} ${candidate_list_1} = Get_Owner_And_Candidates_For_Type_And_Id ${type} ${id} ${member_index} http_timeout=${http_timeout}
+ # Get change ownership entity type results
+ ${type} = BuiltIn.Set_Variable ${SINGLETON_CHANGE_OWNERSHIP_ENTITY_TYPE}
+ ${id} = BuiltIn.Set_Variable ${SINGLETON_SXP_DEVICE_ID_PREFIX}${device_name}${SINGLETON_SXP_DEVICE_ID_SUFFIX}
+ ${owner_2} ${candidate_list_2} = Get_Owner_And_Candidates_For_Type_And_Id ${type} ${id} ${member_index} http_timeout=${http_timeout}
+ # Owners must be same, if not, there is still some election or change ownership in progress
+ BuiltIn.Should_Be_Equal_As_Integers ${owner_1} ${owner_2} Owners for device ${device_name} are not same
+ [Return] ${owner_1} ${candidate_list_1}
+
Get_Owner_And_Candidates_For_Device
[Arguments] ${device_name} ${device_type} ${member_index} ${http_timeout}=${EMPTY}
[Documentation] Returns the owner and a list of candidates for the SB device ${device_name} of type ${device_type}. Request is sent to member ${member_index}.
Resource ./ClusterManagement.robot
Resource ./SetupUtils.robot
Resource ./SxpLib.robot
-Resource ../variables/Variables.robot
*** Variables ***
@{SHARD_OPER_LIST} inventory topology default entity-ownership
@{SHARD_CONF_LIST} inventory topology default
@{SXP_PACKAGE} org.opendaylight.sxp
${DEVICE_SESSION} device_1
+${CONTROLLER_SESSION} ClusterManagement__session_1
${DEVICE_NODE_ID} 1.1.1.1
${CLUSTER_NODE_ID} 2.2.2.2
${SXP_LOG_LEVEL} INFO
*** Keywords ***
Setup SXP Cluster Session
[Documentation] Create sessions asociated with SXP cluster setup
- : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM}
- \ BuiltIn.Wait Until Keyword Succeeds 120 10 SxpLib.Prepare SSH Keys On Karaf ${ODL_SYSTEM_${i+1}_IP}
- \ SxpLib.Setup SXP Session controller${i+1} ${ODL_SYSTEM_${i+1}_IP}
ClusterManagement.ClusterManagement_Setup
SetupUtils.Setup_Utils_For_Setup_And_Teardown
SetupUtils.Setup_Logging_For_Debug_Purposes_On_List_Or_All ${SXP_LOG_LEVEL} ${SXP_PACKAGE}
ClusterManagement.Flush_Iptables_From_List_Or_All
: FOR ${i} IN RANGE ${NUM_ODL_SYSTEM}
\ BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_True ${i+1}
- ${controller_index} = Get Leader Controller
+ ${controller_index} = Get Owner Controller
SxpLib.Delete Node ${DEVICE_NODE_ID} session=${DEVICE_SESSION}
SxpLib.Delete Node ${CLUSTER_NODE_ID} session=controller${controller_index}
${resp} = SxpLib.Get Connections node=${node} session=${session}
SxpLib.Should Contain Connection ${resp} ${TOOLS_SYSTEM_IP} ${port} ${mode} ${version}
-Get Leader Controller
- [Documentation] Find cluster controller that is marked as leader in cluster with all members running
- @{running_members} = BuiltIn.Create List
- : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM}
- \ Collections.Append To List ${running_members} ${i+1}
- ${active_controller} = Get Leader Controller From Running @{running_members}
- [Return] ${active_controller}
-
-Get Leader Controller From Running
- [Arguments] @{running_members}
- [Documentation] Find cluster controller that is marked as leader in cluster with only some members running
- BuiltIn.Log ${running_members}
- @{votes} = BuiltIn.Create List
- : FOR ${i} IN @{running_members}
- \ ${resp} = RequestsLibrary.Get Request controller${i} /restconf/operational/entity-owners:entity-owners
- \ BuiltIn.Continue For Loop If ${resp.status_code} != 200
- \ ${controller} = Sxp.Get Leader Controller From Json ${resp.content} SxpControllerInstance
- \ Collections.Append To List ${votes} ${controller}
- ${length} = BuiltIn.Get Length ${votes}
- BuiltIn.Should Not Be Equal As Integers ${length} 0
- ${active_controller} = BuiltIn.Evaluate collections.Counter(${votes}).most_common(1)[0][0] collections
- [Return] ${active_controller}
-
-Get Inactive Controller
- [Documentation] Find cluster controller that is not marked as leader for SXP service in cluster
- ${active_controller} = Get Leader Controller
- ${controller} = BuiltIn.Evaluate random.choice( filter( lambda i: i!=${active_controller}, range(1, ${NUM_ODL_SYSTEM} + 1))) random
+Get Owner Controller
+ [Arguments] ${running_member}=1
+ [Documentation] Find cluster controller that is marked as cluster owner by requesting ownership data from ${running_member} node of the cluster
+ ${owner} ${candidates} = BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ClusterManagement.Get_Owner_And_Successors_For_Device org.opendaylight.sxp.controller.boot.SxpControllerInstance
+ ... Sxp ${running_member}
+ [Return] ${owner}
+
+Get Not Owner Controller
+ [Documentation] Find cluster controller that is not marked as owner for SXP service in cluster
+ ${owner_controller} = Get Owner Controller
+ ${controller} = BuiltIn.Evaluate random.choice( filter( lambda i: i!=${owner_controller}, range(1, ${NUM_ODL_SYSTEM} + 1))) random
[Return] ${controller}
Get Any Controller
${output} = Utils.Run Command On Controller ${ODL_SYSTEM_IP} cat ${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log* | grep -c 'Successfully pushed configuration snapshot.*${snapshot_string}'
BuiltIn.Should Not Be Equal As Strings ${output} 0
-Prepare SSH Keys On Karaf
- [Arguments] ${system}=${ODL_SYSTEM_IP} ${user}=${ODL_SYSTEM_USER} ${passwd}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT} ${system_workspace}=${WORKSPACE}
- [Documentation] Executes client login on karaf VM in so that SSH keys will be generated by defualt karaf callback,
- ... expecting echo affter succesfull login. TODO: test on multiple runs if this aproach reduce SSHExceptions in robotframework
- ${stdout} = Utils.Run Command On Remote System ${system} ${system_workspace}${/}${BUNDLEFOLDER}/bin/client echo READY ${user} ${passwd} prompt=${prompt}
- BuiltIn.Should Match "${stdout}" "*READY"
-
-Setup SXP Session
- [Arguments] ${session}=session ${controller}=${ODL_SYSTEM_IP}
- [Documentation] Create session to Controller
- KarafKeywords.Verify Feature Is Installed odl-sxp-controller ${controller}
- RequestsLibrary.Create Session ${session} url=http://${controller}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
- ${resp} = RequestsLibrary.Get Request ${session} ${MODULES_API}
- BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
- BuiltIn.Should Contain ${resp.content} ietf-restconf
-
Clean SXP Session
[Documentation] Destroy created sessions
RequestsLibrary.Delete All Sessions
Route Definition Test
[Documentation] Test Route update mechanism without cluster node isolation
SxpClusterLib.Check Shards Status
- ${active_controller} = SxpClusterLib.Get Leader Controller
- BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Not Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${active_controller}
- Add Route Definition To Cluster ${VIRTUAL_IP} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE} ${active_controller}
- BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${active_controller}
- SxpLib.Clean Routing Configuration To Controller controller${active_controller}
- BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Not Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${active_controller}
- Put Route Definition To Cluster ${VIRTUAL_IP} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE} ${active_controller}
- BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${active_controller}
+ ${owner_controller} = SxpClusterLib.Get Owner Controller
+ BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Not Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${owner_controller}
+ Add Route Definition To Cluster ${VIRTUAL_IP} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE} ${owner_controller}
+ BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${owner_controller}
+ SxpLib.Clean Routing Configuration To Controller ClusterManagement__session_${owner_controller}
+ BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Not Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${owner_controller}
+ Put Route Definition To Cluster ${VIRTUAL_IP} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE} ${owner_controller}
+ BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${owner_controller}
Isolation of SXP service follower Test
[Documentation] Test Route update mechanism during Cluster isolation,
- ... after each isolation virtual ip should be pre-routed to new leader
+ ... after each isolation virtual IP should be pre-routed to new leader
SxpClusterLib.Check Shards Status
${any_controller} = SxpClusterLib.Get Any Controller
Add Route Definition To Cluster ${VIRTUAL_IP} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE} ${any_controller}
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ ${controller_index} = SxpClusterLib.Get Owner Controller
Isolate SXP Controller ${controller_index}
*** Keywords ***
[Documentation] Put Route definition to DS replacing all present
${route} = Sxp.Route Definition Xml ${virtual_ip} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE}
${routes} = Sxp.Route Definitions Xml ${route}
- SxpLib.Put Routing Configuration To Controller ${routes} controller${follower}
+ SxpLib.Put Routing Configuration To Controller ${routes} ClusterManagement__session_${follower}
Add Route Definition To Cluster
[Arguments] ${VIRTUAL_IP} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE} ${follower}
[Documentation] Add Route definition to DS
- ${old_routes} = SxpLib.Get Routing Configuration From Controller controller${follower}
+ ${old_routes} = SxpLib.Get Routing Configuration From Controller ClusterManagement__session_${follower}
${route} = Sxp.Route Definition Xml ${VIRTUAL_IP} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE}
${routes} = Sxp.Route Definitions Xml ${route} ${old_routes}
- SxpLib.Put Routing Configuration To Controller ${routes} controller${follower}
+ SxpLib.Put Routing Configuration To Controller ${routes} ClusterManagement__session_${follower}
Custom Clean SXP Cluster
[Documentation] Cleans up Route definitions
- ${follower} = SxpClusterLib.Get Leader Controller
- SxpLib.Clean Routing Configuration To Controller controller${follower}
+ SxpLib.Clean Routing Configuration To Controller ${CONTROLLER_SESSION}
Setup Custom SXP Cluster Session
[Documentation] Prepare topology for testing, creates sessions and generate Route definitions based on Cluster nodes ip
Clean Custom SXP Cluster Session
[Documentation] Cleans up resources generated by test
- ${controller_index} = SxpClusterLib.Get Leader Controller
- SxpLib.Clean Routing Configuration To Controller controller${controller_index}
+ SxpLib.Clean Routing Configuration To Controller ${CONTROLLER_SESSION}
SxpClusterLib.Clean SXP Cluster Session
SxpClusterLib.Delete Virtual Interface
Isolate SXP Controller
[Arguments] ${controller_index}
- [Documentation] Isolate one of cluster nodes and perform check that virtual ip is routed to another cluster node,
+ [Documentation] Isolate the cluster leader node and perform check that virtual IP is routed to a new leader,
... afterwards unisolate old leader.
@{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_False ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Not Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${controller_index}
- ${active_follower} = SxpClusterLib.Get Leader Controller From Running @{running_members}
+ ${running_member} = Collections.Get From List ${running_members} 0
+ ${active_follower} = SxpClusterLib.Get Owner Controller ${running_member}
BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${active_follower}
ClusterManagement.Flush_Iptables_From_List_Or_All
BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_True ${controller_index}
[Documentation] Test SXP connection switchover only if Controller with SCS is isolated
SxpClusterLib.Check Shards Status
Setup Custom SXP Cluster ${VIRTUAL_IP} listener
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ ${controller_index} = SxpClusterLib.Get Owner Controller
Isolate SXP Controller ${controller_index} listener
Isolation of SXP service follower Test Listener Part
[Documentation] Test SXP binding propagation only if Controller with SCS is isolated
SxpClusterLib.Check Shards Status
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ ${controller_index} = SxpClusterLib.Get Owner Controller
Setup Custom SXP Cluster ${VIRTUAL_IP} listener
- Setup SXP Cluster Bindings ${CLUSTER_NODE_ID} controller${controller_index}
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ Setup SXP Cluster Bindings ${CLUSTER_NODE_ID} ClusterManagement__session_${controller_index}
+ ${controller_index} = SxpClusterLib.Get Owner Controller
Isolate SXP Controller With Bindings ${controller_index} ${DEVICE_NODE_ID} listener ${DEVICE_SESSION}
Isolation of SXP service follower Test Speaker Part
SxpClusterLib.Check Shards Status
Setup Custom SXP Cluster ${VIRTUAL_IP} speaker
Setup SXP Cluster Bindings ${DEVICE_NODE_ID} ${DEVICE_SESSION}
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ ${controller_index} = SxpClusterLib.Get Owner Controller
Isolate SXP Controller With Bindings ${controller_index} ${CLUSTER_NODE_ID} speaker
*** Keywords ***
[Documentation] Prepare topology for testing, creates sessions and generate Route definitions based on Cluster nodes ip
SxpClusterLib.Shutdown Tools Node
SxpClusterLib.Setup SXP Cluster Session
- ${controller_index} = SxpClusterLib.Get Leader Controller
${mac_addresses} = SxpClusterLib.Map Followers To Mac Addresses
BuiltIn.Set Suite Variable ${MAC_ADDRESS_TABLE} ${mac_addresses}
${route} = Sxp.Route Definition Xml ${VIRTUAL_IP} ${VIRTUAL_IP_MASK} ${VIRTUAL_INTERFACE}
${routes} = Sxp.Route Definitions Xml ${route}
- SxpLib.Put Routing Configuration To Controller ${routes} controller${controller_index}
+ SxpLib.Put Routing Configuration To Controller ${routes} ${CONTROLLER_SESSION}
Clean Custom SXP Cluster Session
[Documentation] Cleans up resources generated by test
- ${controller_index} = SxpClusterLib.Get Leader Controller
- SxpLib.Clean Routing Configuration To Controller controller${controller_index}
+ SxpLib.Clean Routing Configuration To Controller ${CONTROLLER_SESSION}
SxpClusterLib.Clean SXP Cluster Session
Setup Custom SXP Cluster
... ip=${EMPTY}
${cluster_mode} = Sxp.Get Opposing Mode ${peer_mode}
SxpLib.Add Connection version4 ${peer_mode} ${peer_address} 64999 ${DEVICE_NODE_ID} session=${DEVICE_SESSION}
- ${controller_id} = SxpClusterLib.Get Leader Controller
- SxpLib.Add Node ${CLUSTER_NODE_ID} ip=${peer_address} session=controller${controller_id}
+ SxpLib.Add Node ${CLUSTER_NODE_ID} ip=${peer_address} session=${CONTROLLER_SESSION}
BuiltIn.Wait Until Keyword Succeeds 20 1 SxpClusterLib.Check Cluster Node started ${CLUSTER_NODE_ID}
- SxpLib.Add Connection version4 ${cluster_mode} ${TOOLS_SYSTEM_IP} 64999 ${CLUSTER_NODE_ID} session=controller${controller_id}
- BuiltIn.Wait Until Keyword Succeeds 120 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=controller${controller_id}
+ SxpLib.Add Connection version4 ${cluster_mode} ${TOOLS_SYSTEM_IP} 64999 ${CLUSTER_NODE_ID} session=${CONTROLLER_SESSION}
+ BuiltIn.Wait Until Keyword Succeeds 120 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=${CONTROLLER_SESSION}
Setup SXP Cluster Bindings
[Arguments] ${node} ${session}
@{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_False ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Not Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${controller_index}
- ${active_follower} = SxpClusterLib.Get Leader Controller From Running @{running_members}
+ ${running_member} = Collections.Get From List ${running_members} 0
+ ${active_follower} = SxpClusterLib.Get Owner Controller ${running_member}
BuiltIn.Wait Until Keyword Succeeds 240 1 SXpClusterLib.Ip Addres Should Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${active_follower}
- BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=controller${active_follower}
+ BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=ClusterManagement__session_${active_follower}
BuiltIn.Wait Until Keyword Succeeds 60 1 Check Device is Connected ${DEVICE_NODE_ID} ${VIRTUAL_IP} ${peer_mode}
... session=${DEVICE_SESSION}
ClusterManagement.Flush_Iptables_From_List_Or_All
BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_True ${controller_index}
- BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=controller${active_follower}
+ BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=ClusterManagement__session_${active_follower}
BuiltIn.Wait Until Keyword Succeeds 60 1 Check Device is Connected ${DEVICE_NODE_ID} ${VIRTUAL_IP} ${peer_mode}
... session=${DEVICE_SESSION}
[Documentation] Isolate one of cluster nodes and perform check that bindings were propagated then revert isolation (and check connection again).
${find_session} = BuiltIn.Set Variable If '${session}' == '${EMPTY}' ${True} ${False}
${cluster_mode} = Sxp.Get Opposing Mode ${peer_mode}
- ${session} = BuiltIn.Set Variable If ${find_session} controller${controller_index} ${session}
+ ${session} = BuiltIn.Set Variable If ${find_session} ClusterManagement__session_${controller_index} ${session}
@{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_False ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 240 1 SxpClusterLib.Ip Addres Should Not Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${controller_index}
- ${active_follower} = SxpClusterLib.Get Leader Controller From Running @{running_members}
+ ${running_member} = Collections.Get From List ${running_members} 0
+ ${active_follower} = SxpClusterLib.Get Owner Controller ${running_member}
BuiltIn.Wait Until Keyword Succeeds 240 1 SXpClusterLib.Ip Addres Should Be Routed To Follower ${MAC_ADDRESS_TABLE} ${VIRTUAL_IP} ${active_follower}
- BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=controller${active_follower}
+ BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=ClusterManagement__session_${active_follower}
BuiltIn.Wait Until Keyword Succeeds 60 1 Check Device is Connected ${DEVICE_NODE_ID} ${VIRTUAL_IP} ${peer_mode}
... session=${DEVICE_SESSION}
- ${session} = BuiltIn.Set Variable If ${find_session} controller${active_follower} ${session}
+ ${session} = BuiltIn.Set Variable If ${find_session} ClusterManagement__session_${active_follower} ${session}
BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${node} ${session}
ClusterManagement.Flush_Iptables_From_List_Or_All
BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_True ${controller_index}
- BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=controller${active_follower}
+ BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Cluster is Connected ${CLUSTER_NODE_ID} mode=${cluster_mode} session=ClusterManagement__session_${active_follower}
BuiltIn.Wait Until Keyword Succeeds 60 1 Check Device is Connected ${DEVICE_NODE_ID} ${VIRTUAL_IP} ${peer_mode}
... session=${DEVICE_SESSION}
BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${node} ${session}
Isolation of SXP service follower Test
[Documentation] Test SXP connection switchover only if Controller with SCS is isolated
SxpClusterLib.Check Shards Status
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ ${controller_index} = SxpClusterLib.Get Owner Controller
Isolate SXP Controller ${controller_index}
Isolation of SXP noservice follower Test
[Documentation] Test SXP connection switchover only if Controller without SCS are isolated
SxpClusterLib.Check Shards Status
- ${controller_index} = SxpClusterLib.Get Inactive Controller
+ ${controller_index} = SxpClusterLib.Get Not Owner Controller
Isolate SXP Controller ${controller_index}
*** Keywords ***
[Documentation] Test SXP binding propagation only if Controller with SCS is isolated
SxpClusterLib.Check Shards Status
Setup Custom SXP Cluster listener ${CLUSTER_NODE_ID} controller1
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ ${controller_index} = SxpClusterLib.Get Owner Controller
Isolate SXP Controller ${controller_index} ${DEVICE_NODE_ID} ${DEVICE_SESSION}
Isolation of SXP service follower Test Speaker Part
[Documentation] Test SXP binding propagation only if Controller with SCS is isolated
SxpClusterLib.Check Shards Status
Setup Custom SXP Cluster speaker
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ ${controller_index} = SxpClusterLib.Get Owner Controller
Isolate SXP Controller ${controller_index} ${CLUSTER_NODE_ID}
Isolation of SXP noservice follower Test Listener Part
[Documentation] Test SXP binding propagation only if Controller without SCS are isolated
SxpClusterLib.Check Shards Status
Setup Custom SXP Cluster listener ${CLUSTER_NODE_ID} controller1
- ${controller_index} = SxpClusterLib.Get Inactive Controller
+ ${controller_index} = SxpClusterLib.Get Not Owner Controller
Isolate SXP Controller ${controller_index} ${DEVICE_NODE_ID} ${DEVICE_SESSION}
Isolation of SXP noservice follower Test Speaker Part
[Documentation] Test SXP binding propagation only if Controller without SCS are isolated
SxpClusterLib.Check Shards Status
Setup Custom SXP Cluster speaker
- ${controller_index} = SxpClusterLib.Get Inactive Controller
+ ${controller_index} = SxpClusterLib.Get Not Owner Controller
Isolate SXP Controller ${controller_index} ${CLUSTER_NODE_ID}
*** Keywords ***
@{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_False ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 60 1 SxpClusterLib.Check Device is Connected ${DEVICE_NODE_ID} session=${DEVICE_SESSION}
- ${active_controller} = SxpClusterLib.Get Leader Controller From Running @{running_members}
- ${session} = BuiltIn.Set Variable If ${find_session} controller${active_controller} ${session}
+ ${running_member} = Collections.Get From List ${running_members} 0
+ ${owner_controller} = SxpClusterLib.Get Owner Controller ${running_member}
+ ${session} = BuiltIn.Set Variable If ${find_session} controller${owner_controller} ${session}
BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings ${node} ${session}
ClusterManagement.Flush_Iptables_From_List_Or_All
BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_True ${controller_index}
Isolation of RCP service Test
[Documentation] Test SXP RPC functionality only if Controller with SCS is isolated
SxpClusterLib.Check Shards Status
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ ${controller_index} = SxpClusterLib.Get Owner Controller
Isolate SXP Controller ${controller_index}
Isolation of RPC noservice Test
[Documentation] Test SXP RPC functionality only if Controller without SCS are isolated
SxpClusterLib.Check Shards Status
- ${controller_index} = SxpClusterLib.Get Inactive Controller
+ ${controller_index} = SxpClusterLib.Get Not Owner Controller
Isolate SXP Controller ${controller_index}
*** Keywords ***
Isolate SXP Controller
[Arguments] ${controller_index}
[Documentation] Isolate one of cluster nodes and perform check that RPC changes were performed afterwards reverts isolation
- ${active_controller} = SxpClusterLib.Get Leader Controller
+ ${owner_controller} = SxpClusterLib.Get Owner Controller
: FOR ${i} IN RANGE ${NUM_ODL_SYSTEM}
- \ SxpLib.Add Bindings ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 node=${CLUSTER_NODE_ID} session=controller${active_controller}
+ \ SxpLib.Add Bindings ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 node=${CLUSTER_NODE_ID} session=controller${owner_controller}
@{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_False ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings Exist
- ${active_controller} = SxpClusterLib.Get Leader Controller From Running @{running_members}
+ ${running_member} = Collections.Get From List ${running_members} 0
+ ${owner_controller} = SxpClusterLib.Get Owner Controller ${running_member}
: FOR ${i} IN RANGE ${NUM_ODL_SYSTEM}
- \ SXpLib.Delete Bindings ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 node=${CLUSTER_NODE_ID} session=controller${active_controller}
+ \ SXpLib.Delete Bindings ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 node=${CLUSTER_NODE_ID} session=controller${owner_controller}
ClusterManagement.Flush_Iptables_From_List_Or_All
BuiltIn.Wait Until Keyword Succeeds 240 1 ClusterManagement.Sync_Status_Should_Be_True ${controller_index}
BuiltIn.Wait Until Keyword Succeeds 30 1 Check Bindings Does Not Exist
Check Bindings Exist
[Documentation] Check that bindings exists in Cluster datastore
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ ${controller_index} = SxpClusterLib.Get Owner Controller
${resp} = SxpLib.Get Bindings node=${CLUSTER_NODE_ID} session=controller${controller_index}
: FOR ${i} IN RANGE ${NUM_ODL_SYSTEM}
\ SxpLib.Should Contain Binding ${resp} ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32
Check Bindings Does Not Exist
[Documentation] Check that bindings does not exist in Cluster datastore
- ${controller_index} = SxpClusterLib.Get Leader Controller
+ ${controller_index} = SxpClusterLib.Get Owner Controller
${resp} = SxpLib.Get Bindings node=${CLUSTER_NODE_ID} session=controller${controller_index}
: FOR ${i} IN RANGE ${NUM_ODL_SYSTEM}
\ SxpLib.Should Not Contain Binding ${resp} ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32