From ef128bd3f37944eabebf28dc03383bc9096bcd7f Mon Sep 17 00:00:00 2001 From: "priya.ramasubbu" Date: Tue, 15 Dec 2015 20:14:34 +0530 Subject: [PATCH] Ovsdb 3-node data shard csit test Put a bridge in config topology via PUT Retrieve the same bridge from operational topology via GET after clustering Create Port and verfiy both in config and operational topology Change-Id: I04e2b61b7847fd5571f72d1df78a4812f7cebbf9 Signed-off-by: priya.ramasubbu --- csit/libraries/ClusterOvsdb.robot | 64 +++++++++++++++++-- .../010__Ovsdb_Southbound_Cluster.robot | 59 ++++++++++++++++- csit/variables/ovsdb/create_port_3node.json | 15 +++++ 3 files changed, 131 insertions(+), 7 deletions(-) create mode 100644 csit/variables/ovsdb/create_port_3node.json diff --git a/csit/libraries/ClusterOvsdb.robot b/csit/libraries/ClusterOvsdb.robot index 436fe82b61..c97d311339 100644 --- a/csit/libraries/ClusterOvsdb.robot +++ b/csit/libraries/ClusterOvsdb.robot @@ -26,7 +26,7 @@ Check Ovsdb Shards Status After Cluster Event Get Ovsdb Entity Owner Status For One Device [Arguments] ${controller_index_list} [Documentation] Check Entity Owner Status and identify owner and candidate. - ${owner} ${candidates_list} Wait Until Keyword Succeeds 10s 1s Get Cluster Entity Owner For Ovsdb ${controller_index_list} + ${owner} ${candidates_list} Wait Until Keyword Succeeds 20s 1s Get Cluster Entity Owner For Ovsdb ${controller_index_list} ... ovsdb ovsdb:1 [Return] ${owner} ${candidates_list} @@ -65,22 +65,25 @@ Get Cluster Entity Owner For Ovsdb [Return] ${owner} ${candidates_list} Create Bridge And Verify - [Arguments] ${controller_index_list} ${controller_index} + [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}"=="AfterFail" br02 br01 + 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 - 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 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 Bridge Manually And Verify @@ -103,11 +106,42 @@ 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 + ${ovsdb_uuid}= Get OVSDB UUID controller_http_session=controller${controller_index} ${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} + 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} +Create Port Via Controller + [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}"=="AfterFail" br02 br01 + 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} + +Modify the destination IP of Port + [Arguments] ${controller_index_list} ${controller_index} ${status}=${NONE} + [Documentation] This will modify the dst ip of existing port + ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port_3node.json + ${body} Replace String ${sample} 192.168.1.10 10.0.0.19 + ${BRIDGE}= Set Variable If "${status}"=="AfterFail" br02 br01 + Log URL is ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE}/termination-point/vx2/ + Log ${body} + 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} + +Delete Port And Verify + [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}"=="AfterFail" br02 br01 + 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} + 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}. @@ -116,3 +150,23 @@ Add Port To The Manual Bridge And Verify ${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} + +Get Operational Topology with modified Port + [Arguments] ${controller_index_list} ${controller_index} ${status}=${NONE} + [Documentation] This request will fetch the operational topology after the Port is added to the bridge + ${port_dictionary_before_fail} Create Dictionary br01=7 vx2=3 10.0.0.19=1 + ${port_dictionary_after_fail} Create Dictionary br02=7 vx2=3 10.0.0.19=1 + ${port_dictionary}= Set Variable If "${status}"=="AfterFail" ${port_dictionary_after_fail} ${port_dictionary_before_fail} + 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} + [Documentation] Verify Bridge in Restarted node, which is created when the node is down. + ${dictionary} Create Dictionary br02=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} + [Documentation] Verify Port in Restarted node, which is created when the node is down. + ${dictionary} Create Dictionary vx2=3 + 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 27385d75be..de3ecde76d 100644 --- a/csit/suites/ovsdb/Southbound_Cluster/010__Ovsdb_Southbound_Cluster.robot +++ b/csit/suites/ovsdb/Southbound_Cluster/010__Ovsdb_Southbound_Cluster.robot @@ -47,6 +47,22 @@ 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} +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 Via Controller ${original_cluster_list} ${original_owner} + +Modify the destination IP of Port Before Fail + [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 Before Fail + [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 Before Fail + [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 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} @@ -85,7 +101,23 @@ Add Port Manually In Owner and Verify After Fail 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} + Create Bridge And Verify ${new_cluster_list} ${new_owner} AfterFail + +Create Port Via Controller In Owner and Verify After Fail + [Documentation] Create Port in Owner and verify it gets applied from all instances. + Create Port Via Controller ${new_cluster_list} ${new_owner} AfterFail + +Modify the destination IP of Port After Fail + [Documentation] This will modify the dst ip of existing port + Modify the destination IP of Port ${new_cluster_list} ${new_owner} AfterFail + +Get Operational Topology with modified Port After Fail + [Documentation] This request will fetch the operational topology after the modified port is added to the bridge + Get Operational Topology with modified Port ${new_cluster_list} ${new_owner} AfterFail + +Delete the Port After Fail + [Documentation] This request will delete the port node from the bridge node and data store. + Delete Port And Verify ${new_cluster_list} ${new_owner} AfterFail 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. @@ -120,6 +152,30 @@ 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} +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} + +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 Via Controller ${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} + +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} ${new_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} ${new_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} ${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} @@ -131,4 +187,3 @@ Delete Bridge Via Rest Call And Verify In Owner After Recover 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 diff --git a/csit/variables/ovsdb/create_port_3node.json b/csit/variables/ovsdb/create_port_3node.json new file mode 100644 index 0000000000..98be202163 --- /dev/null +++ b/csit/variables/ovsdb/create_port_3node.json @@ -0,0 +1,15 @@ +{ + "termination-point": [ + { + "ovsdb:options": [ + { + "option": "remote_ip", + "value" : "192.168.1.10" + } + ], + "ovsdb:interface-type": "ovsdb:interface-type-vxlan", + "ovsdb:name": "vx2", + "tp-id": "vx2" + } + ] +} -- 2.36.6