- [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}
- ... ovsdb ovsdb:1
- [Return] ${owner} ${candidates_list}
-
-Get Cluster Entity Owner For Ovsdb
- [Arguments] ${controller_index_list} ${device_type} ${device}
- [Documentation] Checks Entity Owner status for a ${device} and returns owner index and list of candidates from a ${controller_index_list}.
- ... ${device_type} is openflow, ovsdb, etc...
- ${length}= Get Length ${controller_index_list}
- ${candidates_list}= Create List
- ${data}= Get Data From URI controller@{controller_index_list}[0] /restconf/operational/entity-owners:entity-owners
- Log ${data}
- ${data}= Replace String ${data} /network-topology:network-topology/network-topology:topology[network-topology:topology-id=' ${EMPTY}
- # the UUID will not always be the same so need to use regexp to remove this string
- ${data}= Replace String Using Regexp ${data} \/network-topology:node\\[network-topology:node-id='ovsdb://uuid/........-....-....-....-............ ${EMPTY}
- Log ${data}
- ${clear_data}= Replace String ${data} '] ${EMPTY}
- Log ${clear_data}
- ${json}= To Json ${clear_data}
- ${entity_type_list}= Get From Dictionary &{json}[entity-owners] entity-type
- ${entity_type_index}= Get Index From List Of Dictionaries ${entity_type_list} type ${device_type}
- Should Not Be Equal ${entity_type_index} -1 No Entity Owner found for ${device_type}
- ${entity_list}= Get From Dictionary @{entity_type_list}[${entity_type_index}] entity
- ${entity_index}= Get Index From List Of Dictionaries ${entity_list} id ${device}
- Should Not Be Equal ${entity_index} -1 Device ${device} not found in Entity Owner ${device_type}
- ${entity_owner}= Get From Dictionary @{entity_list}[${entity_index}] owner
- Should Not Be Empty ${entity_owner} No owner found for ${device}
- ${owner}= Replace String ${entity_owner} member- ${EMPTY}
- ${owner}= Convert To Integer ${owner}
- List Should Contain Value ${controller_index_list} ${owner} Owner ${owner} not exisiting in ${controller_index_list}
- ${entity_candidates_list}= Get From Dictionary @{entity_list}[${entity_index}] candidate
- ${list_length}= Get Length ${entity_candidates_list}
- : 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
+ [Arguments] ${device} ${controller_index} ${controller_index_list}=${EMPTY}
+ [Documentation] Check Entity Owner Status and identify owner and successors for an ovs device ${device}. Request is sent to controller ${controller_index}.
+ ${owner} ${successor_list} Wait Until Keyword Succeeds 20s 1s ClusterManagement.Verify_Owner_And_Successors_For_Device device_name=${device}
+ ... device_type=ovsdb member_index=${controller_index} candidate_list=${controller_index_list}
+ [Return] ${owner} ${successor_list}
+
+Create Sample Bridge Manually And Verify
+ [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_index_list}=${EMPTY}
+ [Documentation] Create bridge br-s1 using OVS command and verify it gets created in all instances in ${controller_index_list}.
+ Utils.Run Command On Mininet ${ovs_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 ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${CONFIG_TOPO_API} dictionary=${dictionary_config} member_index_list=${controller_index_list}
+ Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${OPERATIONAL_TOPO_API} dictionary=${dictionary_operational} member_index_list=${controller_index_list}
+
+Add Sample Port To The Manual Bridge And Verify
+ [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_index_list}=${EMPTY}
+ [Documentation] Add Port vx1 to br-s1 using OVS command and verify it gets added in all instances in ${controller_index_list}.
+ Utils.Run Command On Mininet ${ovs_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 ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${CONFIG_TOPO_API} dictionary=${dictionary_config} member_index_list=${controller_index_list}
+ Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${OPERATIONAL_TOPO_API} dictionary=${dictionary_operational} member_index_list=${controller_index_list}
+
+Create Sample Tap Device
+ [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP}
+ [Documentation] Create Tap Device vport1 and vport2 to add to the bridge br-s1 using OVS command.
+ Utils.Run Command On Mininet ${ovs_system_ip} ip tuntap add mode tap vport1
+ Utils.Run Command On Mininet ${ovs_system_ip} ip tuntap add mode tap vport2
+ Utils.Run Command On Mininet ${ovs_system_ip} ifconfig vport1 up
+ Utils.Run Command On Mininet ${ovs_system_ip} ifconfig vport2 up
+
+Add Sample Tap Device To The Manual Bridge And Verify
+ [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_index_list}=${EMPTY}
+ [Documentation] Add Tap Device vport1 and vport2 to br-s1 using OVS command and verify it gets added in all instances in ${controller_index_list}.
+ Utils.Run Command On Mininet ${ovs_system_ip} sudo ovs-vsctl add-port br-s1 vport1 -- add-port br-s1 vport2
+ ${dictionary_operational}= Create Dictionary vport1=2 vport2=2
+ ${dictionary_config}= Create Dictionary vport1=0 vport2=0
+ Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${CONFIG_TOPO_API} dictionary=${dictionary_config} member_index_list=${controller_index_list}
+ Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${OPERATIONAL_TOPO_API} dictionary=${dictionary_operational} member_index_list=${controller_index_list}
+
+Delete Sample Bridge Manually And Verify
+ [Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_index_list}=${EMPTY}
+ [Documentation] Delete bridge br-s1 using OVS command and verify it gets applied in all instances in ${controller_index_list}.
+ Utils.Run Command On Mininet ${ovs_system_ip} sudo ovs-vsctl del-br br-s1
+ ${dictionary}= Create Dictionary br-s1=0
+ Wait Until Keyword Succeeds 5s 1s ClusterManagement.Check_Item_Occurrence_Member_List_Or_All uri=${OPERATIONAL_TOPO_API} dictionary=${dictionary} member_index_list=${controller_index_list}
+
+Create Sample Bridge And Verify
+ [Arguments] ${controller_index} ${controller_index_list}=${EMPTY}
+ [Documentation] Create bridge ${BRIDGE} in controller ${controller_index} and verify it gets created in all instances in ${controller_index_list}.