SXP: format cluster suite 46/75346/7
authorIvan Hrasko <ihrasko@cisco.com>
Tue, 21 Aug 2018 07:09:41 +0000 (09:09 +0200)
committerIvan Hrasko <ihrasko@cisco.com>
Tue, 21 Aug 2018 11:58:37 +0000 (13:58 +0200)
Change-Id: Ib0331cce454d9cfd3ff53a430a996e4bb7340faa
Signed-off-by: Ivan Hrasko <ihrasko@cisco.com>
csit/suites/sxp/clustering/010_Connection_switchover.robot
csit/suites/sxp/clustering/020_Bindings_consistency.robot
csit/suites/sxp/clustering/030_RPC_functionality.robot

index 69481d80caecb10f8e83e95959290b7a6af48d6c..632255d5c792063f04c374152004d012c945b47a 100644 (file)
@@ -4,30 +4,29 @@ Suite Setup       Setup SXP Cluster Session
 Suite Teardown    Clean SXP Cluster Session
 Test Setup        Setup SXP Cluster
 Test Teardown     Clean SXP Cluster
 Suite Teardown    Clean SXP Cluster Session
 Test Setup        Setup SXP Cluster
 Test Teardown     Clean SXP Cluster
-Library           ../../../libraries/Sxp.py
 Resource          ../../../libraries/ClusterManagement.robot
 Resource          ../../../libraries/SxpClusterLib.robot
 
 *** Test Cases ***
 Isolation of SXP service follower Test
     [Documentation]    Test SXP connection switchover only if Controller with SCS is isolated
 Resource          ../../../libraries/ClusterManagement.robot
 Resource          ../../../libraries/SxpClusterLib.robot
 
 *** Test Cases ***
 Isolation of SXP service follower Test
     [Documentation]    Test SXP connection switchover only if Controller with SCS is isolated
-    Check Shards Status
-    ${controller_index} =    Get Active Controller
+    SxpClusterLib.Check Shards Status
+    ${controller_index} =    SxpClusterLib.Get Active Controller
     Isolate SXP Controller    ${controller_index}
 
 Isolation of SXP noservice follower Test
     [Documentation]    Test SXP connection switchover only if Controller without SCS are isolated
     Isolate SXP Controller    ${controller_index}
 
 Isolation of SXP noservice follower Test
     [Documentation]    Test SXP connection switchover only if Controller without SCS are isolated
-    Check Shards Status
-    ${controller_index} =    Get Inactive Controller
+    SxpClusterLib.Check Shards Status
+    ${controller_index} =    SxpClusterLib.Get Inactive Controller
     Isolate SXP Controller    ${controller_index}
 
 *** Keywords ***
 Isolate SXP Controller
     [Arguments]    ${controller_index}
     [Documentation]    Isolate one of cluster nodes and perform check that Device is still connected afterwards reverts isolation
     Isolate SXP Controller    ${controller_index}
 
 *** Keywords ***
 Isolate SXP Controller
     [Arguments]    ${controller_index}
     [Documentation]    Isolate one of cluster nodes and perform check that Device is still connected afterwards reverts isolation
-    Isolate_Member_From_List_Or_All    ${controller_index}
-    Wait Until Keyword Succeeds    240    1    Sync_Status_Should_Be_False    ${controller_index}
-    Wait Until Keyword Succeeds    60    1    Check Device is Connected    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
-    Flush_Iptables_From_List_Or_All
-    Wait Until Keyword Succeeds    240    1    Sync_Status_Should_Be_True    ${controller_index}
-    Wait Until Keyword Succeeds    60    1    Check Device is Connected    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
+    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}
+    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 Device is Connected    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
index 097374d21e476cc384fdda4f27575d3d36843793..bea2a6dd11ee54a38480c643c5cf46db2768bb3e 100644 (file)
@@ -11,59 +11,59 @@ Resource          ../../../libraries/SxpLib.robot
 *** Test Cases ***
 Isolation of SXP service follower Test Listener Part
     [Documentation]    Test SXP binding propagation only if Controller with SCS is isolated
 *** Test Cases ***
 Isolation of SXP service follower Test Listener Part
     [Documentation]    Test SXP binding propagation only if Controller with SCS is isolated
-    Check Shards Status
+    SxpClusterLib.Check Shards Status
     Setup Custom SXP Cluster    listener    ${CLUSTER_NODE_ID}    controller1
     Setup Custom SXP Cluster    listener    ${CLUSTER_NODE_ID}    controller1
-    ${controller_index} =    Get Active Controller
+    ${controller_index} =    SxpClusterLib.Get Active 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
     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
-    Check Shards Status
+    SxpClusterLib.Check Shards Status
     Setup Custom SXP Cluster    speaker
     Setup Custom SXP Cluster    speaker
-    ${controller_index} =    Get Active Controller
+    ${controller_index} =    SxpClusterLib.Get Active 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
     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
-    Check Shards Status
+    SxpClusterLib.Check Shards Status
     Setup Custom SXP Cluster    listener    ${CLUSTER_NODE_ID}    controller1
     Setup Custom SXP Cluster    listener    ${CLUSTER_NODE_ID}    controller1
-    ${controller_index} =    Get Inactive Controller
+    ${controller_index} =    SxpClusterLib.Get Inactive 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
     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
-    Check Shards Status
+    SxpClusterLib.Check Shards Status
     Setup Custom SXP Cluster    speaker
     Setup Custom SXP Cluster    speaker
-    ${controller_index} =    Get Inactive Controller
+    ${controller_index} =    SxpClusterLib.Get Inactive Controller
     Isolate SXP Controller    ${controller_index}    ${CLUSTER_NODE_ID}
 
 *** Keywords ***
 Setup Custom SXP Cluster
     [Arguments]    ${mode}    ${node}=${DEVICE_NODE_ID}    ${session}=${DEVICE_SESSION}
     [Documentation]    Setup custom SXP cluster topology
     Isolate SXP Controller    ${controller_index}    ${CLUSTER_NODE_ID}
 
 *** Keywords ***
 Setup Custom SXP Cluster
     [Arguments]    ${mode}    ${node}=${DEVICE_NODE_ID}    ${session}=${DEVICE_SESSION}
     [Documentation]    Setup custom SXP cluster topology
-    Setup SXP Cluster    ${mode}
+    SxpClusterLib.Setup SXP Cluster    ${mode}
     : FOR    ${i}    IN RANGE    1    25
     : FOR    ${i}    IN RANGE    1    25
-    \    Add Bindings    ${i}0    ${i}.${i}.${i}.${i}/32    node=${node}    session=${session}
+    \    SxpLib.Add Bindings    ${i}0    ${i}.${i}.${i}.${i}/32    node=${node}    session=${session}
+
+Isolate SXP Controller
+    [Arguments]    ${controller_index}    ${node}    ${session}=${EMPTY}
+    [Documentation]    Isolate one of cluster nodes and perform check that bindings were propagated afterwards reverts isolation
+    ${find_session} =    BuiltIn.Set Variable If    '${session}' == ''    ${True}    ${False}
+    ${session} =    BuiltIn.Set Variable If    ${find_session}    controller${controller_index}    ${session}
+    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 Active Controller
+    ${session} =    BuiltIn.Set Variable If    ${find_session}    controller${active_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}
+    BuiltIn.Wait Until Keyword Succeeds    60    1    SxpClusterLib.Check Device is Connected    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
+    BuiltIn.Wait Until Keyword Succeeds    30    1    Check Bindings    ${node}    ${session}
 
 Check Bindings
     [Arguments]    ${node}    ${session}
     [Documentation]    Checks that bindings were propagated to Peer
 
 Check Bindings
     [Arguments]    ${node}    ${session}
     [Documentation]    Checks that bindings were propagated to Peer
-    ${resp} =    Get Bindings    node=${node}    session=${session}
+    ${resp} =    SxpLib.Get Bindings    node=${node}    session=${session}
     : FOR    ${i}    IN RANGE    1    25
     : FOR    ${i}    IN RANGE    1    25
-    \    Should Contain Binding    ${resp}    ${i}0    ${i}.${i}.${i}.${i}/32
-
-Isolate SXP Controller
-    [Arguments]    ${controller_index}    ${node}    ${session}=${EMPTY}
-    [Documentation]    Isolate one of cluster nodes and perform check that bindings were propagated afterwards reverts isolation
-    ${find_session} =    Set Variable If    '${session}' == ''    ${True}    ${False}
-    ${session} =    Set Variable If    ${find_session}    controller${controller_index}    ${session}
-    Isolate_Member_From_List_Or_All    ${controller_index}
-    Wait Until Keyword Succeeds    240    1    Sync_Status_Should_Be_False    ${controller_index}
-    Wait Until Keyword Succeeds    60    1    Check Device is Connected    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
-    ${active_controller} =    Get Active Controller
-    ${session} =    Set Variable If    ${find_session}    controller${active_controller}    ${session}
-    Wait Until Keyword Succeeds    30    1    Check Bindings    ${node}    ${session}
-    Flush_Iptables_From_List_Or_All
-    Wait Until Keyword Succeeds    240    1    Sync_Status_Should_Be_True    ${controller_index}
-    Wait Until Keyword Succeeds    60    1    Check Device is Connected    ${DEVICE_NODE_ID}    session=${DEVICE_SESSION}
-    Wait Until Keyword Succeeds    30    1    Check Bindings    ${node}    ${session}
+    \    SxpLib.Should Contain Binding    ${resp}    ${i}0    ${i}.${i}.${i}.${i}/32
index 02650c2bf49226ec40605b8036d2ec29c04da137..41f7c0fbe1d91ef5f52b35e053300701a707cb46 100644 (file)
@@ -12,43 +12,43 @@ Resource          ../../../libraries/SxpLib.robot
 *** Test Cases ***
 Isolation of RCP service Test
     [Documentation]    Test SXP RPC functionality only if Controller with SCS is isolated
 *** Test Cases ***
 Isolation of RCP service Test
     [Documentation]    Test SXP RPC functionality only if Controller with SCS is isolated
-    Check Shards Status
-    ${controller_index} =    Get Active Controller
+    SxpClusterLib.Check Shards Status
+    ${controller_index} =    SxpClusterLib.Get Active Controller
     Isolate SXP Controller    ${controller_index}
 
 Isolation of RPC noservice Test
     [Documentation]    Test SXP RPC functionality only if Controller without SCS are isolated
     Isolate SXP Controller    ${controller_index}
 
 Isolation of RPC noservice Test
     [Documentation]    Test SXP RPC functionality only if Controller without SCS are isolated
-    Check Shards Status
-    ${controller_index} =    Get Inactive Controller
+    SxpClusterLib.Check Shards Status
+    ${controller_index} =    SxpClusterLib.Get Inactive 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
     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} =    Get Active Controller
+    ${active_controller} =    SxpClusterLib.Get Active Controller
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
-    \    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}
-    Isolate_Member_From_List_Or_All    ${controller_index}
-    Wait Until Keyword Succeeds    240    1    Sync_Status_Should_Be_False    ${controller_index}
-    Wait Until Keyword Succeeds    30    1    Check Bindings Exist
-    ${active_controller} =    Get 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${active_controller}
+    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 Active Controller
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
-    \    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}
-    Flush_Iptables_From_List_Or_All
-    Wait Until Keyword Succeeds    240    1    Sync_Status_Should_Be_True    ${controller_index}
-    Wait Until Keyword Succeeds    30    1    Check Bindings Does Not Exist
+    \    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}
+    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
 
 Check Bindings Exist
     [Documentation]    Check that bindings exists in Cluster datastore
-    ${controller_index} =    Get Active Controller
-    ${resp} =    Get Bindings    node=${CLUSTER_NODE_ID}    session=controller${controller_index}
+    ${controller_index} =    SxpClusterLib.Get Active Controller
+    ${resp} =    SxpLib.Get Bindings    node=${CLUSTER_NODE_ID}    session=controller${controller_index}
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
-    \    Should Contain Binding    ${resp}    ${i+1}0    ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32
+    \    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
 
 Check Bindings Does Not Exist
     [Documentation]    Check that bindings does not exist in Cluster datastore
-    ${controller_index} =    Get Active Controller
-    ${resp} =    Get Bindings    node=${CLUSTER_NODE_ID}    session=controller${controller_index}
+    ${controller_index} =    SxpClusterLib.Get Active Controller
+    ${resp} =    SxpLib.Get Bindings    node=${CLUSTER_NODE_ID}    session=controller${controller_index}
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
-    \    Should Not Contain Binding    ${resp}    ${i+1}0    ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32
+    \    SxpLib.Should Not Contain Binding    ${resp}    ${i+1}0    ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32