Tidied new and updated test suites
[integration/test.git] / csit / libraries / ClusterOvsdb.robot
index ac32ec896610d369dfe3209357e447627a91076a..436fe82b610daf6e9831dfdb582882d86d464c10 100644 (file)
@@ -11,12 +11,17 @@ Variables         ../variables/Variables.py
 Check Ovsdb Shards Status
     [Arguments]    ${controller_index_list}
     [Documentation]    Check Status for all shards in Ovsdb application.
-    ${topo_conf_leader}    ${topo_conf_followers_list}    Wait Until Keyword Succeeds    10s    1s    Get Cluster Shard Status    ${controller_index_list}
-    ...    config    topology
-    ${topo_oper_leader}    ${topo_oper_followers_list}    Wait Until Keyword Succeeds    10s    1s    Get Cluster Shard Status    ${controller_index_list}
-    ...    operational    topology
+    ${topo_conf_leader}    ${topo_conf_followers_list}    Get Cluster Shard Status    ${controller_index_list}    config    topology
+    ${topo_oper_leader}    ${topo_oper_followers_list}    Get Cluster Shard Status    ${controller_index_list}    operational    topology
+    ${owner_oper_leader}    ${owner_oper_followers_list}    Get Cluster Shard Status    ${controller_index_list}    operational    entity-ownership
     Log    config topology Leader is ${topo_conf_leader} and followers are ${topo_conf_followers_list}
     Log    operational topology Leader is ${topo_oper_leader} and followers are ${topo_oper_followers_list}
+    Log    operational entity-ownership Leader is ${owner_oper_leader} and followers are ${owner_oper_followers_list}
+
+Check Ovsdb Shards Status After Cluster Event
+    [Arguments]    ${controller_index_list}
+    [Documentation]    Check Shard Status after some cluster event.
+    Wait Until Keyword Succeeds    90s    1s    Check Ovsdb Shards Status    ${controller_index_list}
 
 Get Ovsdb Entity Owner Status For One Device
     [Arguments]    ${controller_index_list}
@@ -56,15 +61,14 @@ Get Cluster Entity Owner For Ovsdb
     : FOR    ${entity_candidate}    IN    @{entity_candidates_list}
     \    ${candidate}=    Replace String    &{entity_candidate}[name]    member-    ${EMPTY}
     \    ${candidate}=    Convert To Integer    ${candidate}
-    \    List Should Contain Value    ${controller_index_list}    ${candidate}    Candidate ${candidate} not exisiting in ${controller_index_list}
     \    Run Keyword If    '${candidate}' != '${owner}'    Append To List    ${candidates_list}    ${candidate}
     [Return]    ${owner}    ${candidates_list}
 
 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
-    ${ovsdb_uuid}=    Get OVSDB UUID    controller_http_session=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=controller${controller_index}
     ${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}
     ${body}    Replace String    ${body}    tcp:controller1:6633    tcp:${ODL_SYSTEM_1_IP}:6640
@@ -76,7 +80,7 @@ Create Bridge And Verify
     Log    ${body}
     ${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}
+    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}
     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
@@ -101,7 +105,7 @@ Delete Bridge Via Rest Call And Verify
     # 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}
+    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}
     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