SXP: Fix 020_Sxp_Node_Switching.robot 24/75424/18
authorIvan Hrasko <ihrasko@cisco.com>
Thu, 23 Aug 2018 15:02:58 +0000 (17:02 +0200)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 7 Sep 2018 18:10:02 +0000 (18:10 +0000)
Change-Id: If3d2df7e0dde8499489b527ebfc142a7f5423da4
Signed-off-by: Ivan Hrasko <ihrasko@cisco.com>
csit/libraries/SxpClusterLib.robot
csit/libraries/SxpLib.robot
csit/suites/sxp/basic/040_SSL_Passwords.robot
csit/suites/sxp/cluster-routing/020_Sxp_Node_Switching.robot

index 755ba15e9b509046b7ea81a74c9d23a0c13619f3..27b6c936bf483ae1e003c4cbc0a4db4228616878 100644 (file)
@@ -11,13 +11,13 @@ Resource          ./SxpLib.robot
 @{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
 ${VIRTUAL_IP}     ${TOOLS_SYSTEM_2_IP}
 ${VIRTUAL_IP_MASK}    255.255.255.0
 ${VIRTUAL_INTERFACE}    eth0
 ${MAC_ADDRESS_TABLE}    &{EMPTY}
+${DEVICE_NODE_ID}    ${TOOLS_SYSTEM_IP}
+${CLUSTER_NODE_ID}    ${TOOLS_SYSTEM_2_IP}
 
 *** Keywords ***
 Setup SXP Cluster Session
@@ -26,6 +26,10 @@ Setup SXP Cluster Session
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     SetupUtils.Setup_Logging_For_Debug_Purposes_On_List_Or_All    ${SXP_LOG_LEVEL}    ${SXP_PACKAGE}
 
+Setup Device Session
+    [Documentation]    Create session on the SXP device
+    RequestsLibrary.Create Session    ${DEVICE_SESSION}    url=http://${DEVICE_NODE_ID}:${RESTCONFPORT}    auth=${AUTH}    timeout=${DEFAULT_TIMEOUT_HTTP}    max_retries=0
+
 Clean SXP Cluster Session
     [Documentation]    Clean sessions asociated with SXP cluster setup
     ClusterManagement.Flush_Iptables_From_List_Or_All
@@ -50,9 +54,9 @@ Setup SXP Cluster
     \    SxpLib.Add Connection    version4    ${peer_mode}    ${ODL_SYSTEM_${i+1}_IP}    64999    ${DEVICE_NODE_ID}
     \    ...    session=${DEVICE_SESSION}
     ${controller_id} =    Get Any Controller
-    SxpLib.Add Node    ${CLUSTER_NODE_ID}    ip=0.0.0.0    session=controller${controller_id}
+    SxpLib.Add Node    ${CLUSTER_NODE_ID}    ip=0.0.0.0    session=ClusterManagement__session_${controller_id}
     BuiltIn.Wait Until Keyword Succeeds    20    1    Check Cluster Node started    ${CLUSTER_NODE_ID}
-    SxpLib.Add Connection    version4    ${cluster_mode}    ${TOOLS_SYSTEM_IP}    64999    ${CLUSTER_NODE_ID}    session=controller${controller_id}
+    SxpLib.Add Connection    version4    ${cluster_mode}    ${TOOLS_SYSTEM_IP}    64999    ${CLUSTER_NODE_ID}    session=ClusterManagement__session_${controller_id}
     BuiltIn.Wait Until Keyword Succeeds    120    1    Check Device is Connected    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
 
 Clean SXP Cluster
@@ -60,12 +64,11 @@ Clean SXP Cluster
     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 Owner Controller
     SxpLib.Delete Node    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
-    SxpLib.Delete Node    ${CLUSTER_NODE_ID}    session=controller${controller_index}
+    SxpLib.Delete Node    ${CLUSTER_NODE_ID}    session=${CONTROLLER_SESSION}
 
 Check Cluster Node started
-    [Arguments]    ${node}    ${port}=64999    ${ip}=${EMPTY}
+    [Arguments]    ${node}    ${port}=64999    ${ip}=${node}
     [Documentation]    Verify that SxpNode has data written to Operational datastore and Node is running on one of cluster nodes
     ${started} =    BuiltIn.Set Variable    ${False}
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
@@ -76,21 +79,20 @@ Check Cluster Node started
 
 Check Device is Connected
     [Arguments]    ${node}    ${version}=version4    ${port}=64999    ${session}=session
-    [Documentation]    Checks if SXP device is connected to at least one cluster node
-    ${is_connected} =    BuiltIn.Set Variable    ${False}
+    [Documentation]    Checks if SXP device is connected to the cluster. It means it has connection in state "on" with one of the cluster members.
     ${resp} =    SxpLib.Get Connections    node=${node}    session=${session}
+    ${is_connected} =    BuiltIn.Set Variable    ${False}
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
-    \    ${follower} =    Sxp.Find Connection    ${resp}    ${version}    any    ${ODL_SYSTEM_${i+1}_IP}
+    \    ${is_connected} =    Sxp.Find Connection    ${resp}    ${version}    any    ${ODL_SYSTEM_${i+1}_IP}
     \    ...    ${port}    on
-    \    ${is_connected} =    BuiltIn.Run Keyword If    ${follower}    BuiltIn.Set Variable    ${True}
-    \    ...    ELSE    BuiltIn.Set Variable    ${is_connected}
+    \    BuiltIn.Exit For Loop If    ${is_connected}
     BuiltIn.Should Be True    ${is_connected}
 
 Check Cluster is Connected
     [Arguments]    ${node}    ${version}=version4    ${port}=64999    ${mode}=speaker    ${session}=session
-    [Documentation]    Checks if SXP device is connected to at least one cluster node
+    [Documentation]    Get SXP connections from cluster and verify that they contain a connection to the device in state "on"
     ${resp} =    SxpLib.Get Connections    node=${node}    session=${session}
-    SxpLib.Should Contain Connection    ${resp}    ${TOOLS_SYSTEM_IP}    ${port}    ${mode}    ${version}
+    SxpLib.Should Contain Connection    ${resp}    ${DEVICE_NODE_ID}    ${port}    ${mode}    ${version}    on
 
 Get Owner Controller
     [Arguments]    ${running_member}=1
index ccf5c2011fbd84ba311c070215cdc9d9b07a6296..1af5567d951cb86f3fd84aa7947f6030847ae715 100644 (file)
@@ -28,7 +28,7 @@ Post To Controller
     BuiltIn.Should Be True    ${result}    RPC result is False
 
 Add Node
-    [Arguments]    ${node}    ${password}=${EMPTY}    ${version}=version4    ${port}=64999    ${session}=session    ${ip}=${EMPTY}
+    [Arguments]    ${node}    ${password}=${EMPTY}    ${version}=version4    ${port}=64999    ${session}=session    ${ip}=${node}
     ...    ${ssl_stores}=${EMPTY}    ${retry_open_timer}=1
     [Documentation]    Add node via RPC to ODL
     ${data} =    Sxp.Add Node Xml    ${node}    ${port}    ${password}    ${version}    ${ip}
@@ -191,7 +191,7 @@ Should Contain Connection
     [Documentation]    Test if data contains specified connection
     ${out} =    Sxp.Find Connection    ${resp}    ${version}    ${mode}    ${ip}    ${port}
     ...    ${state}
-    BuiltIn.Should Be True    ${out}    Doesn't have ${ip}:${port} ${mode} ${version}
+    BuiltIn.Should Be True    ${out}    Doesn't have ${ip}:${port} ${mode} ${version} in state ${state}
 
 Should Not Contain Connection
     [Arguments]    ${resp}    ${ip}    ${port}    ${mode}    ${version}    ${state}=none
@@ -316,7 +316,7 @@ Setup SXP Environment
     \    BuiltIn.Wait Until Keyword Succeeds    20    1    Check Node Started    ${ip}
 
 Check Node Started
-    [Arguments]    ${node}    ${port}=64999    ${system}=${ODL_SYSTEM_IP}    ${session}=session    ${ip}=${node}
+    [Arguments]    ${node}    ${port}=64999    ${system}=${node}    ${session}=session    ${ip}=${node}
     [Documentation]    Verify that SxpNode has data writed to Operational datastore
     ${resp} =    RequestsLibrary.Get Request    ${session}    /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/
     BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
index bde87b2948187d563bd5eb5f0f1f80894253e9b9..92e48e753f3a408ed2c1c6873747d7944b289a0f 100644 (file)
@@ -129,7 +129,6 @@ SSL ConectivityCase 4
 Setup SXP Environment Local
     [Arguments]    ${node_range}
     [Documentation]    Create session to Controller, copy keystores to ODL machines and setup topology for testing
-    SxpLib.Setup SXP Session
     SSHKeywords.Open_Connection_To_ODL_System
     ${ODL_SYSTEM_JAVA_HOME}    SSHLibrary.Execute_Command    java -XshowSettings:properties -version 2>&1 | grep java.home | sed 's/.*= //'
     : FOR    ${node}    IN RANGE    1    ${node_range}
index 6ce389c86b087ad1c80b84f36e4e428900651f5f..c07d2a925e1d4f4f931597ba86ec275cd7e8ff01 100644 (file)
@@ -1,7 +1,7 @@
 *** Settings ***
-Documentation     Test suite to test cluster connection and propagation switchover using virtual ip, this suite requires additional TOOLS_SYSTEM VM.
+Documentation     Test suite to test cluster connection and propagation switchover using virtual IP, this suite requires additional TOOLS_SYSTEM_2 VM.
 ...               VM is used for its assigned ip-address that will be overlayed by virtual-ip used in test suites.
-...               Resources of this VM are not required and after start of Test suite this node shutted down and to reduce routing conflicts.
+...               Resources of this VM are not required. At suite start this node is shutted down to reduce routing conflicts.
 Suite Setup       Setup Custom SXP Cluster Session
 Suite Teardown    Clean Custom SXP Cluster Session
 Test Teardown     Clean SXP Cluster
@@ -9,39 +9,54 @@ Library           ../../../libraries/Sxp.py
 Resource          ../../../libraries/ClusterManagement.robot
 Resource          ../../../libraries/SxpClusterLib.robot
 
+*** Variables ***
+${BINDINGS}       4
+
 *** Test Cases ***
-Isolation of SXP service follower Test
+Isolation Of SXP Service Follower W/O Bindings Listener Test
     [Documentation]    Test SXP connection switchover only if Controller with SCS is isolated
-    SxpClusterLib.Check Shards Status
-    Setup Custom SXP Cluster    ${VIRTUAL_IP}    listener
+    Setup Nodes And Connections    listener
     ${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
+Isolation Of SXP Service Follower W/O Bindings Speaker Test
+    [Documentation]    Test SXP connection switchover only if Controller with SCS is isolated
+    Setup Nodes And Connections    speaker
     ${controller_index} =    SxpClusterLib.Get Owner Controller
-    Setup Custom SXP Cluster    ${VIRTUAL_IP}    listener
-    Setup SXP Cluster Bindings    ${CLUSTER_NODE_ID}    ClusterManagement__session_${controller_index}
+    Isolate SXP Controller    ${controller_index}    speaker
+
+Isolation Of SXP Service Follower Listener Test
+    [Documentation]    Test SXP binding propagation only if Controller with SCS is isolated
+    Setup Nodes And Connections    listener
     ${controller_index} =    SxpClusterLib.Get Owner Controller
+    Add Bindings To Node    ${CLUSTER_NODE_ID}    ClusterManagement__session_${controller_index}
     Isolate SXP Controller With Bindings    ${controller_index}    ${DEVICE_NODE_ID}    listener    ${DEVICE_SESSION}
 
-Isolation of SXP service follower Test Speaker Part
+Isolation Of SXP Service Follower Speaker Test
     [Documentation]    Test SXP binding propagation only if Controller with SCS is isolated,
     ...    the same case as above but with initiator of connection between nodes in oposite mode
-    SxpClusterLib.Check Shards Status
-    Setup Custom SXP Cluster    ${VIRTUAL_IP}    speaker
-    Setup SXP Cluster Bindings    ${DEVICE_NODE_ID}    ${DEVICE_SESSION}
+    Setup Nodes And Connections    speaker
+    Add Bindings To Node    ${DEVICE_NODE_ID}    ${DEVICE_SESSION}
     ${controller_index} =    SxpClusterLib.Get Owner Controller
-    Isolate SXP Controller With Bindings    ${controller_index}    ${CLUSTER_NODE_ID}    speaker
+    Isolate SXP Controller With Bindings    ${controller_index}    ${CLUSTER_NODE_ID}    speaker    ClusterManagement__session_${controller_index}
 
 *** Keywords ***
 Setup Custom SXP Cluster Session
     [Documentation]    Prepare topology for testing, creates sessions and generate Route definitions based on Cluster nodes ip
     SxpClusterLib.Shutdown Tools Node
+    SxpClusterLib.Create Virtual Interface
     SxpClusterLib.Setup SXP Cluster Session
+    SxpClusterLib.Setup Device Session
+    Retrieve Mac-addresses
+    Setup Virtual IP
+
+Retrieve Mac-addresses
+    [Documentation]    Create list of ODL nodes mac-addresses
     ${mac_addresses} =    SxpClusterLib.Map Followers To Mac Addresses
     BuiltIn.Set Suite Variable    ${MAC_ADDRESS_TABLE}    ${mac_addresses}
+
+Setup Virtual IP
+    [Documentation]    Enable routing to cluster through virtual IP
     ${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_SESSION}
@@ -50,21 +65,23 @@ Clean Custom SXP Cluster Session
     [Documentation]    Cleans up resources generated by test
     SxpLib.Clean Routing Configuration To Controller    ${CONTROLLER_SESSION}
     SxpClusterLib.Clean SXP Cluster Session
+    SxpClusterLib.Delete Virtual Interface
 
-Setup Custom SXP Cluster
-    [Arguments]    ${peer_address}    ${peer_mode}
+Setup Nodes And Connections
+    [Arguments]    ${peer_mode}
     [Documentation]    Setup and connect SXP cluster topology
-    SxpLib.Add Node    ${DEVICE_NODE_ID}    ip=0.0.0.0    session=${DEVICE_SESSION}
-    BuiltIn.Wait Until Keyword Succeeds    20    1    SxpLib.Check Node Started    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}    system=${TOOLS_SYSTEM_IP}
-    ...    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}
-    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_SESSION}
-    BuiltIn.Wait Until Keyword Succeeds    120    1    SxpClusterLib.Check Cluster is Connected    ${CLUSTER_NODE_ID}    mode=${cluster_mode}    session=${CONTROLLER_SESSION}
+    ${controller_id} =    SxpClusterLib.Get Owner Controller
+    SxpLib.Add Node    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
+    SxpLib.Add Connection    version4    ${peer_mode}    ${VIRTUAL_IP}    64999    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
+    SxpLib.Add Node    ${CLUSTER_NODE_ID}    session=ClusterManagement__session_${controller_id}
+    SxpLib.Add Connection    version4    ${cluster_mode}    ${DEVICE_NODE_ID}    64999    ${CLUSTER_NODE_ID}    session=ClusterManagement__session_${controller_id}
+    BuiltIn.Wait Until Keyword Succeeds    20    1    SxpLib.Check Node Started    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
+    BuiltIn.Wait Until Keyword Succeeds    20    1    SxpLib.Check Node started    ${CLUSTER_NODE_ID}    system=${ODL_SYSTEM_${controller_id}_IP}    session=ClusterManagement__session_${controller_id}
+    BuiltIn.Wait Until Keyword Succeeds    120    1    Check Device is Connected    mode=${peer_mode}
+    BuiltIn.Wait Until Keyword Succeeds    120    1    SxpClusterLib.Check Cluster is Connected    ${CLUSTER_NODE_ID}    mode=${cluster_mode}    session=ClusterManagement__session_${controller_id}
 
-Setup SXP Cluster Bindings
+Add Bindings To Node
     [Arguments]    ${node}    ${session}
     [Documentation]    Setup initial bindings to SXP device
     : FOR    ${i}    IN RANGE    1    ${BINDINGS}
@@ -80,44 +97,37 @@ Isolate SXP Controller
     ${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=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    240    1    SxpClusterLib.Check Cluster is Connected    ${CLUSTER_NODE_ID}    mode=${cluster_mode}    session=ClusterManagement__session_${active_follower}
+    BuiltIn.Wait Until Keyword Succeeds    240    1    Check Device is Connected    mode=${peer_mode}
     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=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    240    1    SxpClusterLib.Check Cluster is Connected    ${CLUSTER_NODE_ID}    mode=${cluster_mode}    session=ClusterManagement__session_${active_follower}
+    BuiltIn.Wait Until Keyword Succeeds    240    1    Check Device is Connected    mode=${peer_mode}
 
 Isolate SXP Controller With Bindings
     [Arguments]    ${controller_index}    ${node}    ${peer_mode}    ${session}=${EMPTY}
     [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}    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}
     ${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=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}    ClusterManagement__session_${active_follower}    ${session}
+    BuiltIn.Wait Until Keyword Succeeds    240    1    SxpClusterLib.Check Cluster is Connected    ${CLUSTER_NODE_ID}    mode=${cluster_mode}    session=ClusterManagement__session_${active_follower}
+    BuiltIn.Wait Until Keyword Succeeds    240    1    Check Device is Connected    mode=${peer_mode}
     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=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    240    1    SxpClusterLib.Check Cluster is Connected    ${CLUSTER_NODE_ID}    mode=${cluster_mode}    session=ClusterManagement__session_${active_follower}
+    BuiltIn.Wait Until Keyword Succeeds    240    1    Check Device is Connected    mode=${peer_mode}
     BuiltIn.Wait Until Keyword Succeeds    30    1    Check Bindings    ${node}    ${session}
 
 Check Device is Connected
-    [Arguments]    ${node}    ${remote_ip}    ${mode}=any    ${version}=version4    ${port}=64999    ${session}=session
-    [Documentation]    Checks if SXP device is connected to at least one cluster node
-    ${resp} =    SxpLib.Get Connections    node=${node}    session=${session}
-    SxpLib.Should Contain Connection    ${resp}    ${remote_ip}    ${port}    ${mode}    ${version}
+    [Arguments]    ${mode}=any    ${version}=version4    ${port}=64999
+    [Documentation]    Checks if SXP device is connected to the cluster. It means it has connection to ${VIRTUAL_IP} in state "on"
+    ${resp} =    SxpLib.Get Connections    node=${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
+    SxpLib.Should Contain Connection    ${resp}    ${VIRTUAL_IP}    ${port}    ${mode}    ${version}    on
 
 Check Bindings
     [Arguments]    ${node}    ${session}