From: priya.ramasubbu Date: Tue, 2 Feb 2016 18:32:20 +0000 (+0530) Subject: Ovsdb 3 node Cluster Extension X-Git-Tag: release/beryllium-sr1~101 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=c2e30e38166088daa1e498e428ce2f67b5176f33;p=integration%2Ftest.git Ovsdb 3 node Cluster Extension * As per requirement run the test cases one more time * Add test cases in Old Owner Instance * Add test cases for Non Owner Instance down Change-Id: Iebd9c92c7b0e9d3893a4cf62e6ec50d14eba9096 Signed-off-by: priya.ramasubbu --- diff --git a/csit/libraries/ClusterOvsdb.robot b/csit/libraries/ClusterOvsdb.robot index 4e6e8e102e..7544ed69c8 100644 --- a/csit/libraries/ClusterOvsdb.robot +++ b/csit/libraries/ClusterOvsdb.robot @@ -161,13 +161,76 @@ Get Operational Topology with modified Port Wait Until Keyword Succeeds 5s 1s Check Item Occurrence At URI In Cluster ${controller_index_list} ${port_dictionary} ${OPERATIONAL_TOPO_API} Verify Bridge in Restarted Node - [Arguments] ${controller_index_list} + [Arguments] ${controller_index_list} ${status}=${NONE} [Documentation] Verify Bridge in Restarted node, which is created when the node is down. - ${dictionary} Create Dictionary br02=6 + ${BRIDGE}= Set Variable If "${status}"=="AfterCandidateRecover" br04 br02 + ${dictionary} Create Dictionary ${BRIDGE}=6 Wait Until Keyword Succeeds 5s 1s Check Item Occurrence At URI In Cluster ${controller_index_list} ${dictionary} ${OPERATIONAL_TOPO_API} Verify Port in Restarted Node - [Arguments] ${controller_index_list} + [Arguments] ${controller_index_list} ${status}=${NONE} [Documentation] Verify Port in Restarted node, which is created when the node is down. - ${dictionary} Create Dictionary vx2=3 + ${BRIDGE}= Set Variable If "${status}"=="AfterCandidateRecover" br04 br02 + ${dictionary} Create Dictionary ${BRIDGE}=6 vx2=3 + Wait Until Keyword Succeeds 5s 1s Check Item Occurrence At URI In Cluster ${controller_index_list} ${dictionary} ${OPERATIONAL_TOPO_API} + +Create Bridge In Candidate + [Arguments] ${controller_index_list} ${controller_index} ${status}=${NONE} + [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=controller${controller_index} + Set Suite Variable ${ovsdb_uuid} + ${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 + ${body} Replace String ${body} tcp:controller2:6633 tcp:${ODL_SYSTEM_2_IP}:6640 + ${body} Replace String ${body} tcp:controller3:6633 tcp:${ODL_SYSTEM_3_IP}:6640 + ${body} Replace String ${body} 127.0.0.1 ${MININET} + ${BRIDGE}= Set Variable If "${status}"=="AfterCandidateFail" br04 br03 + Log ${BRIDGE} + ${body} Replace String ${body} br01 ${BRIDGE} + ${body} Replace String ${body} 61644 ${OVSDB_PORT} + 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 + Wait Until Keyword Succeeds 20s 1s 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 Port Vxlan in Candidate + [Arguments] ${controller_index_list} ${controller_index} ${status}=${NONE} + [Documentation] This will add port/interface to the config datastore + ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port_3node.json + ${body} Replace String ${sample} 192.168.1.10 ${TOOLS_SYSTEM_IP} + Log ${body} + ${BRIDGE}= Set Variable If "${status}"=="AfterCandidateFail" br04 br03 + Log ${BRIDGE} + Log URL is ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}/termination-point/vx2/ + ${port_dictionary}= Create Dictionary ${BRIDGE}=7 vx2=3 + 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}/termination-point/vx2/ ${body} + Wait Until Keyword Succeeds 5s 1s Check Item Occurrence At URI In Cluster ${controller_index_list} ${port_dictionary} ${OPERATIONAL_TOPO_API} + +Delete Bridge in Candidate + [Arguments] ${controller_index_list} ${controller_index} ${status}=${NONE} + [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=controller${controller_index} + ${BRIDGE}= Set Variable If "${status}"=="AfterCandidateFail" br04 br03 + ${dictionary}= Create Dictionary ${BRIDGE}=0 + Wait Until Keyword Succeeds 20s 1s 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} + +Delete Port In Candidate + [Arguments] ${controller_index_list} ${controller_index} ${status}=${NONE} + [Documentation] Delete port in ${controller_index} and verify it gets applied in all instances in ${controller_index_list}. + ${dictionary}= Create Dictionary vx2=0 + ${BRIDGE}= Set Variable If "${status}"=="AfterCandidateFail" br04 br03 + 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}/termination-point/vx2/ + Wait Until Keyword Succeeds 5s 1s Check Item Occurrence At URI In Cluster ${controller_index_list} ${dictionary} ${OPERATIONAL_TOPO_API} + +Configure Exit OVSDB Connection + [Arguments] ${controller_index_list} ${controller_index} + [Documentation] Cleans up test environment, close existing sessions. + Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP} + ${dictionary}= Create Dictionary ovsdb://uuid=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} Wait Until Keyword Succeeds 5s 1s Check Item Occurrence At URI In Cluster ${controller_index_list} ${dictionary} ${OPERATIONAL_TOPO_API} diff --git a/csit/suites/ovsdb/Southbound_Cluster/010__Ovsdb_Southbound_Cluster.robot b/csit/suites/ovsdb/Southbound_Cluster/010__Ovsdb_Southbound_Cluster.robot index de3ecde76d..08691249eb 100644 --- a/csit/suites/ovsdb/Southbound_Cluster/010__Ovsdb_Southbound_Cluster.robot +++ b/csit/suites/ovsdb/Southbound_Cluster/010__Ovsdb_Southbound_Cluster.robot @@ -23,7 +23,7 @@ Check Shards Status Before Fail [Documentation] Check Status for all shards in Ovsdb application. Check Ovsdb Shards Status ${original_cluster_list} -Start Mininet Multiple Connections +Start OVS Multiple Connections [Documentation] Start mininet with connection to all cluster instances. ${mininet_conn_id} Add Multiple Managers to OVS ${TOOLS_SYSTEM_IP} ${original_cluster_list} Set Suite Variable ${mininet_conn_id} @@ -184,6 +184,40 @@ 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 Manually In Old 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} ${original_owner} + +Add Port Manually In Old 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 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} + +Create Port Via Controller In Old Owner and Verify After Recover + [Documentation] Create Port in Owner and verify it gets applied from all instances. + Create Port Via Controller ${original_cluster_list} ${original_owner} + +Modify the destination IP of Port After Recover + [Documentation] This will modify the dst ip of existing port + Modify the destination IP of Port ${original_cluster_list} ${original_owner} + +Get Operational Topology with modified Port After Recover + [Documentation] This request will fetch the operational topology after the modified port is added to the bridge + Get Operational Topology with modified Port ${original_cluster_list} ${original_owner} + +Delete the Port After Recover + [Documentation] This request will delete the port node from the bridge node and data store. + Delete Port And Verify ${original_cluster_list} ${original_owner} + +Delete the Bridge In Old Owner and Verify After Recover + [Documentation] This request will delete the bridge node from the config data store and operational data store. + Delete Bridge Manually And Verify ${original_cluster_list} ${original_owner} + +Delete Bridge Via Rest Call And Verify In Old 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} ${original_owner} + + diff --git a/csit/suites/ovsdb/Southbound_Cluster/020__Southbound_Cluster_Extension.robot b/csit/suites/ovsdb/Southbound_Cluster/020__Southbound_Cluster_Extension.robot new file mode 100644 index 0000000000..4c11c47aaf --- /dev/null +++ b/csit/suites/ovsdb/Southbound_Cluster/020__Southbound_Cluster_Extension.robot @@ -0,0 +1,104 @@ +*** Settings *** +Documentation Test suite for Ovsdb Southbound Cluster Extension +Suite Setup Create Controller Sessions +Suite Teardown Delete All Sessions +Library RequestsLibrary +Resource ../../../libraries/ClusterOvsdb.robot +Resource ../../../libraries/ClusterKeywords.robot +Resource ../../../libraries/MininetKeywords.robot +Variables ../../../variables/Variables.py + +*** Variables *** +${OVSDB_CONFIG_DIR} ${CURDIR}/../../../variables/ovsdb +${BRIDGE} br01 + +*** Test Cases *** +Create Original Cluster List + [Documentation] Create original cluster list. + ${original_cluster_list} Create Controller Index List + Set Suite Variable ${original_cluster_list} + Log ${original_cluster_list} + +Check Shards Status Before Fail + [Documentation] Check Status for all shards in Ovsdb application. + Check Ovsdb Shards Status ${original_cluster_list} + +Check Entity Owner Status And Find Owner and Candidate Before Fail + [Documentation] Check Entity Owner Status and identify owner and candidate. + ${original_owner} ${original_candidates_list} Get Ovsdb Entity Owner Status For One Device ${original_cluster_list} + ${original_candidate}= Get From List ${original_candidates_list} 0 + Set Suite Variable ${original_owner} + Set Suite Variable ${original_candidate} + +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 In Candidate ${original_cluster_list} ${original_owner} BeforeCandidateFail + +Create Port Via Controller In Owner and Verify Before Fail + [Documentation] Create Port in Owner and verify it gets applied from all instances. + Create Port Vxlan in Candidate ${original_cluster_list} ${original_owner} BeforeCandidateFail + +Kill Non Owner Instance + [Documentation] Kill Non Owner Instance and verify it is dead + Kill Multiple Controllers ${original_candidate} + ${new_cluster_list} Create Controller Index List + Remove Values From List ${new_cluster_list} ${original_candidate} + 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. + Check Ovsdb Shards Status After Cluster Event ${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} Get Ovsdb Entity Owner Status For One Device ${new_cluster_list} + Run Keyword And Continue On Failure List Should Not Contain Value ${new_candidates_list} ${original_candidate} Original candidate ${original_candidate} still in candidate list. + Remove Values From List ${new_candidates_list} ${original_candidate} + ${new_candidate}= Get From List ${new_candidates_list} 0 + Set Suite Variable ${new_owner} + Set Suite Variable ${new_candidate} + +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 In Candidate ${new_cluster_list} ${new_owner} AfterCandidateFail + +Start Non Old Owner Instance + [Documentation] Start Non Owner Instance and verify it is active + Start Multiple Controllers 300s ${original_candidate} + +Check Shards Status After Recover + [Documentation] Create original cluster list and check Status for all shards in Ovsdb application. + Check Ovsdb Shards Status After Cluster Event ${original_cluster_list} + +Check Entity Owner Status After Recover + [Documentation] Check Entity Owner Status and verify owner is not changed. + ${new_owner} ${new_candidates_list} Get Ovsdb Entity Owner Status For One Device ${original_cluster_list} + Set Suite Variable ${new_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 In Candidate ${original_cluster_list} ${new_owner} + +Verify Bridge in Restarted Node Which Is Killed Earlier + [Documentation] Verify Bridge in Restarted node, which is created when the node is down. + Verify Bridge in Restarted Node ${original_cluster_list} AfterCandidateRecover + +Create Port Via Controller In Owner and Verify After Recover + [Documentation] Create Port in Owner and verify it gets applied from all instances. + Create Port Vxlan in Candidate ${original_cluster_list} ${new_owner} + +Verify Port in Restarted Node Which Is Killed Earlier + [Documentation] Verify Port in Restarted node, which is created when the node is down. + Verify Port in Restarted Node ${original_cluster_list} AfterCandidateRecover + +Delete the Port After Recover + [Documentation] This request will delete the port node from the bridge node and data store. + Delete Port In Candidate ${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 In Candidate ${original_cluster_list} ${new_owner} + +Cleans Up Test Environment For Next Suite + [Documentation] Cleans up test environment, close existing sessions in teardown. + Configure Exit OVSDB Connection ${original_cluster_list} ${new_owner} diff --git a/csit/testplans/ovsdb-clustering.txt b/csit/testplans/ovsdb-clustering.txt index 7b46bb6110..22afaefbe9 100644 --- a/csit/testplans/ovsdb-clustering.txt +++ b/csit/testplans/ovsdb-clustering.txt @@ -1,3 +1,3 @@ # Place the suites in run order: integration/test/csit/suites/ovsdb/Southbound_Cluster - +integration/test/csit/suites/ovsdb/Southbound_Cluster