Ovsdb 3node clustering csit corner cases. 31/26431/58
authorpriya.ramasubbu <priya.ramasubbu@hcl.com>
Thu, 3 Sep 2015 10:56:56 +0000 (16:26 +0530)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 15 Jan 2016 17:55:18 +0000 (17:55 +0000)
    Add Test Cases for Southbound Clustering.
    Create bridge in switch and verify in all the cluster instances.

Change-Id: Iabcd6908bd7830409b417d5beee27156ae6c8af2
Signed-off-by: priya.ramasubbu <priya.ramasubbu@hcl.com>
csit/libraries/ClusterKeywords.robot
csit/libraries/ClusterOvsdb.robot
csit/suites/ovsdb/Southbound_Cluster/010__Ovsdb_Southbound_Cluster.robot

index b85bed1f9b8b344f0aee499f39c325496e8ced7d..0ba4b682e24ac7ab5ea8efe6149ea5292112c847 100644 (file)
@@ -110,7 +110,7 @@ Put And Check At URI In Cluster
     \    Should Be Equal    ${expected_body}    ${received_body}
 
 Delete And Check At URI In Cluster
-    [Arguments]    ${controller_index_list}    ${controller_index}    ${uri}    ${headers}=${HEADERS}
+    [Arguments]    ${controller_index_list}    ${controller_index}    ${uri}    ${headers}=${HEADERS_YANG_JSON}
     [Documentation]    Send a DELETE with the supplied ${uri} to a ${controller_index}
     ...    and check the data is removed from all instances in ${controller_index_list}.
     ${resp}    RequestsLibrary.Delete Request    controller${controller_index}    ${uri}    ${headers}
index 3565d83f8d37896c2ed33e3202e945f4a3128afc..ac32ec896610d369dfe3209357e447627a91076a 100644 (file)
@@ -63,7 +63,7 @@ Get Cluster Entity Owner For Ovsdb
 Create Bridge And Verify
     [Arguments]    ${controller_index_list}    ${controller_index}
     [Documentation]    Create bridge in ${controller_index} and verify it gets applied in all instances in ${controller_index_list}.
-    # need to get UUID which should be the same on all controllers in cluster, so asking controller1
+     # need to get UUID which should be the same on all controllers in cluster, so asking controller1
     ${ovsdb_uuid}=    Get OVSDB UUID    controller_http_session=controller1
     ${body}=    OperatingSystem.Get File    ${CURDIR}/../variables/ovsdb/create_bridge_3node.json
     ${body}    Replace String    ${body}    ovsdb://127.0.0.1:61644    ovsdb://uuid/${ovsdb_uuid}
@@ -74,6 +74,41 @@ Create Bridge And Verify
     ${body}    Replace String    ${body}    br01    ${BRIDGE}
     ${body}    Replace String    ${body}    61644    ${OVSDB_PORT}
     Log    ${body}
-    ${dictionary}=    Create Dictionary    ${MININET}=1    ${OVSDBPORT}=4    ${BRIDGE}=1
+    ${TOOLS_SYSTEM_IP1}    Replace String    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_IP}    "${TOOLS_SYSTEM_IP}"
+    ${dictionary}=    Create Dictionary    ${TOOLS_SYSTEM_IP1}=1    ${OVSDBPORT}=4    ${BRIDGE}=1
     Put And Check At URI In Cluster    ${controller_index_list}    ${controller_index}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}    ${body}    ${HEADERS}
     Wait Until Keyword Succeeds    5s    1s    Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary}    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}
+
+Create Bridge Manually And Verify
+    [Arguments]    ${controller_index_list}    ${controller_index}
+    [Documentation]    Create bridge in ${controller_index} and verify it gets applied in all instances in ${controller_index_list}.
+    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br br-s1
+    ${dictionary_operational}=    Create Dictionary    br-s1=5
+    ${dictionary_config}=    Create Dictionary    br-s1=0
+    Wait Until Keyword Succeeds    5s    1s    Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_config}    ${CONFIG_TOPO_API}
+    Wait Until Keyword Succeeds    5s    1s    Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_operational}    ${OPERATIONAL_TOPO_API}
+
+Delete Bridge Manually And Verify
+    [Arguments]    ${controller_index_list}    ${controller_index}
+    [Documentation]    Delete bridge in ${controller_index} and verify it gets applied in all instances in ${controller_index_list}.
+    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-br br-s1
+    ${dictionary}=    Create Dictionary    br-s1=0
+    Wait Until Keyword Succeeds    5s    1s    Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary}    ${OPERATIONAL_TOPO_API}
+
+Delete Bridge Via Rest Call And Verify
+    [Arguments]    ${controller_index_list}    ${controller_index}
+    [Documentation]    Delete bridge in ${controller_index} and verify it gets applied in all instances in ${controller_index_list}.
+    # need to get UUID which should be the same on all controllers in cluster, so asking controller1
+    ${ovsdb_uuid}=    Get OVSDB UUID    controller_http_session=controller1
+    ${dictionary}=    Create Dictionary    ${BRIDGE}=0
+    Delete And Check At URI In Cluster    ${controller_index_list}    ${controller_index}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}    ${HEADERS}
+    Wait Until Keyword Succeeds    5s    1s    Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary}    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}
+
+Add Port To The Manual Bridge And Verify
+    [Arguments]    ${controller_index_list}    ${controller_index}
+    [Documentation]    Add Port in ${controller_index} and verify it gets applied in all instances in ${controller_index_list}.
+    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-port br-s1 vx1 -- set Interface vx1 type=vxlan
+    ${dictionary_operational}=    Create Dictionary    vx1=2
+    ${dictionary_config}=    Create Dictionary    vx1=0
+    Wait Until Keyword Succeeds    5s    1s    Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_config}    ${CONFIG_TOPO_API}
+    Wait Until Keyword Succeeds    5s    1s    Check Item Occurrence At URI In Cluster    ${controller_index_list}    ${dictionary_operational}    ${OPERATIONAL_TOPO_API}
index ef7b02dc879d04ef9d0ed2be8a7edecd12009550..2a830f2f5838767d8c269e7f0a874d5b88a3a7db 100644 (file)
@@ -9,7 +9,6 @@ Resource          ../../../libraries/MininetKeywords.robot
 Variables         ../../../variables/Variables.py
 
 *** Variables ***
-${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${MININET}:${OVSDBPORT}
 ${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
 ${BRIDGE}         br01
 
@@ -36,7 +35,98 @@ Check Entity Owner Status And Find Owner and Candidate Before Fail
     Set Suite Variable    ${original_owner}
     Set Suite Variable    ${original_candidate}
 
-Create Bridge In Owner and Verify Before Fail
+Create Bridge Manually In Owner and Verify Before Fail
+    [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
+    Create Bridge Manually And Verify    ${original_cluster_list}    ${original_owner}
+
+Add Port Manually In Owner and Verify Before Fail
+    [Documentation]    Add Port in Owner and verify it gets applied from all instances.
+    Add Port To The Manual Bridge And Verify    ${original_cluster_list}    ${original_owner}
+
+Create Bridge Via Controller In Owner and Verify Before Fail
+    [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
+    Create Bridge And Verify    ${original_cluster_list}    ${original_owner}
+
+Delete the Bridge In Owner and Verify Before Fail
+    [Documentation]    This request will delete the bridge node from the operational data store.
+    Delete Bridge Manually And Verify    ${original_cluster_list}    ${original_owner}
+
+Delete Bridge Via Rest Call And Verify In Owner Before Fail
+    [Documentation]    This request will delete the bridge node from the config data store and operational data store.
+    Delete Bridge Via Rest Call And Verify    ${original_cluster_list}    ${original_owner}
+
+Kill Owner Instance
+    [Documentation]    Kill Owner Instance and verify it is dead
+    Kill Multiple Controllers    ${original_owner}
+    ${new_cluster_list}    Create Controller Index List
+    Remove Values From List    ${new_cluster_list}    ${original_owner}
+    Set Suite Variable    ${new_cluster_list}
+
+Check Shards Status After Fail
+    [Documentation]    Create original cluster list and check Status for all shards in Ovsdb application.
+    Wait Until Keyword Succeeds    10s    1s    Check Ovsdb Shards Status    ${new_cluster_list}
+
+Check Entity Owner Status And Find Owner and Candidate After Fail
+    [Documentation]    Check Entity Owner Status and identify owner and candidate.
+    ${new_owner}    ${new_candidates_list}    Wait Until Keyword Succeeds    10s    1s    Get Ovsdb Entity Owner Status For One Device    ${new_cluster_list}
+    ${new_candidate}=    Get From List    ${new_candidates_list}    0
+    Set Suite Variable    ${new_owner}
+    Set Suite Variable    ${new_candidate}
+
+Create Bridge Manually In Owner and Verify After Fail
+    [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
+    Create Bridge Manually And Verify    ${new_cluster_list}    ${new_owner}
+
+Add Port Manually In Owner and Verify After Fail
+    [Documentation]    Add Port in Owner and verify it gets applied from all instances.
+    Add Port To The Manual Bridge And Verify    ${original_cluster_list}    ${original_owner}
+
+Create Bridge Via Controller In Owner and Verify After Fail
+    [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
+    Create Bridge And Verify    ${new_cluster_list}    ${new_owner}
+
+Delete the Bridge In Owner and Verify After Fail
+    [Documentation]    This request will delete the bridge node from the config data store and operational data store.
+    Delete Bridge Manually And Verify    ${new_cluster_list}    ${new_owner}
+
+Delete Bridge Via Rest Call And Verify In Owner After Fail
+    [Documentation]    This request will delete the bridge node from the config data store and operational data store.
+    Delete Bridge Via Rest Call And Verify    ${new_cluster_list}    ${new_owner}
+
+Start Old Owner Instance
+    [Documentation]    Start Owner Instance and verify it is active
+    Start Multiple Controllers    300s    ${original_owner}
+
+Check Shards Status After Recover
+    [Documentation]    Create original cluster list and check Status for all shards in Ovsdb application.
+    Wait Until Keyword Succeeds    10s    1s    Check Ovsdb Shards Status    ${original_cluster_list}
+
+Check Entity Owner Status After Recover
+    [Documentation]    Check Entity Owner Status and identify owner and candidate.
+    ${new_owner}    ${new_candidates_list}    Wait Until Keyword Succeeds    10s    1s    Get Ovsdb Entity Owner Status For One Device    ${original_cluster_list}
+    Set Suite Variable    ${new_owner}
+
+Create Bridge Manually In Owner and Verify After Recover
+    [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
+    Create Bridge Manually And Verify    ${original_cluster_list}    ${new_owner}
+
+Add Port Manually In Owner and Verify After Recover
+    [Documentation]    Add Port in Owner and verify it gets applied from all instances.
+    Add Port To The Manual Bridge And Verify    ${original_cluster_list}    ${original_owner}
+
+Create Bridge Via Controller In Owner and Verify After Recover
+    [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
+    Create Bridge And Verify    ${original_cluster_list}    ${new_owner}
+
+Delete the Bridge In Owner and Verify After Recover
+    [Documentation]    This request will delete the bridge node from the operational data store.
+    Delete Bridge Manually And Verify    ${original_cluster_list}    ${new_owner}
+
+Delete Bridge Via Rest Call And Verify In Owner After Recover
+    [Documentation]    This request will delete the bridge node from the config data store and operational data store.
+    Delete Bridge Via Rest Call And Verify    ${original_cluster_list}    ${new_owner}
+
+Create Bridge Via Controller In Old Owner and Verify After Recover
     [Documentation]    Create Bridge in Owner and verify it gets applied from all instances.
     Create Bridge And Verify    ${original_cluster_list}    ${original_owner}
     [Teardown]    Report_Failure_Due_To_Bug    4908