Cleanup ovsdb suites 27/68427/38
authorSam Hague <shague@redhat.com>
Mon, 19 Feb 2018 20:02:53 +0000 (15:02 -0500)
committerSam Hague <shague@redhat.com>
Sat, 24 Feb 2018 05:05:53 +0000 (05:05 +0000)
Change-Id: I9ad8dde94f386df6cd9ef22c3c5cffbe3f804d43
Signed-off-by: Sam Hague <shague@redhat.com>
csit/libraries/OVSDB.robot
csit/libraries/Utils.robot
csit/suites/ovsdb/Southbound_Cluster/010__Ovsdb_Southbound_Cluster.robot
csit/suites/ovsdb/Southbound_Domain/010__configure_1_ovsdb_node.robot
csit/suites/ovsdb/Southbound_Domain/020__connection_manager.robot
csit/suites/ovsdb/Southbound_Domain/030__configure_exit_ovsdb_node.robot
csit/suites/ovsdb/Southbound_Domain/040__Vxlan_Extension_Test.robot
csit/suites/ovsdb/Southbound_Domain/Bug_Validation.robot

index e09f1e2e54779dbfbe9008ea357e1796628cb125..10de0f2d313e5f69c3f733146ccf151e0e72bc76 100644 (file)
 *** Settings ***
-Library           SSHLibrary
-Library           String
 Library           Collections
-Library           RequestsLibrary
 Library           ipaddress
-Resource          Utils.robot
+Library           OperatingSystem
+Library           RequestsLibrary
+Library           SSHLibrary
+Library           String
 Resource          ClusterManagement.robot
+Resource          Utils.robot
 Resource          ${CURDIR}/TemplatedRequests.robot
-Variables         ../variables/Variables.py
+Resource          ../variables/Variables.robot
 
 *** Variables ***
-${OVSDB_CONFIG_DIR}    ../variables/ovsdb
+${OVSDB_CONFIG_DIR}    ${CURDIR}/../variables/ovsdb
+${OVSDB_NODE_PORT}    6634
 ${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F
+${SOUTHBOUND_NODE_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
 
 *** Keywords ***
+Log Request
+    [Arguments]    ${resp_content}
+    ${resp_json} =    BuiltIn.Run Keyword If    '''${resp_content}''' != '${EMPTY}'    RequestsLibrary.To Json    ${resp_content}    pretty_print=True
+    ...    ELSE    BuiltIn.Set Variable    ${EMPTY}
+    BuiltIn.Log    ${resp_json}
+    [Return]    ${resp_json}
+
+Create OVSDB Node
+    [Arguments]    ${node_ip}    ${port}=${OVSDB_NODE_PORT}
+    ${body} =    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_node.json
+    ${body} =    Replace String    ${body}    127.0.0.1    ${node_ip}
+    ${body} =    Replace String    ${body}    61644    ${port}
+    ${uri} =    Builtin.Set Variable    ${CONFIG_TOPO_API}/topology/ovsdb:1/
+    BuiltIn.Log    URI is ${uri}
+    BuiltIn.Log    data: ${body}
+    ${resp} =    RequestsLibrary.Post Request    session    ${uri}    data=${body}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+
 Connect To Ovsdb Node
-    [Arguments]    ${mininet_ip}
+    [Arguments]    ${node_ip}    ${port}=${OVSDB_NODE_PORT}
     [Documentation]    This will Initiate the connection to OVSDB node from controller
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
-    ${sample1}    Replace String    ${sample}    127.0.0.1    ${mininet_ip}
-    ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
-    Log    URL is ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${body} =    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
+    ${body} =    String.Replace String    ${body}    127.0.0.1    ${node_ip}
+    ${body} =    String.Replace String    ${body}    61644    ${port}
+    ${uri} =    BuiltIn.Set Variable    ${SOUTHBOUND_CONFIG_API}${node_ip}:${port}
+    BuiltIn.Log    URI is ${uri}
+    BuiltIn.Log    data: ${body}
+    ${resp} =    RequestsLibrary.Put Request    session    ${uri}    data=${body}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
 Disconnect From Ovsdb Node
-    [Arguments]    ${mininet_ip}
+    [Arguments]    ${node_ip}    ${port}=${OVSDB_NODE_PORT}
     [Documentation]    This request will disconnect the OVSDB node from the controller
-    ${resp}    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}${node_ip}:${port}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
 
 Add Bridge To Ovsdb Node
-    [Arguments]    ${mininet_ip}    ${bridge_num}    ${datapath_id}
+    [Arguments]    ${node_id}    ${node_ip}    ${bridge}    ${datapath_id}    ${port}=${OVSDB_NODE_PORT}
     [Documentation]    This will create a bridge and add it to the OVSDB node.
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_bridge.json
-    ${sample1}    Replace String    ${sample}    tcp:127.0.0.1:6633    tcp:${ODL_SYSTEM_IP}:6633
-    ${sample2}    Replace String    ${sample1}    127.0.0.1    ${mininet_ip}
-    ${sample3}    Replace String    ${sample2}    br01    ${bridge_num}
-    ${sample4}    Replace String    ${sample3}    61644    ${OVSDB_PORT}
-    ${body}    Replace String    ${sample4}    0000000000000001    ${datapath_id}
-    Log    URL is ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}%2Fbridge%2F${bridge_num}
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}%2Fbridge%2F${bridge_num}    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${body} =    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_bridge.json
+    ${body} =    String.Replace String    ${body}    ovsdb://127.0.0.1:61644    ovsdb://${node_id}
+    ${body} =    String.Replace String    ${body}    tcp:127.0.0.1:6633    tcp:${ODL_SYSTEM_IP}:6633
+    ${body} =    String.Replace String    ${body}    127.0.0.1    ${node_ip}
+    ${body} =    String.Replace String    ${body}    br01    ${bridge}
+    ${body} =    String.Replace String    ${body}    61644    ${port}
+    ${body} =    String.Replace String    ${body}    0000000000000001    ${datapath_id}
+    ${node_id_} =    BuiltIn.Evaluate    """${node_id}""".replace("/","%2F")
+    ${uri} =    BuiltIn.Set Variable    ${SOUTHBOUND_CONFIG_API}${node_id_}%2Fbridge%2F${bridge}
+    BuiltIn.Log    URI is ${uri}
+    BuiltIn.Log    data: ${body}
+    ${resp} =    RequestsLibrary.Put Request    session    ${uri}    data=${body}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
 Delete Bridge From Ovsdb Node
-    [Arguments]    ${mininet_ip}    ${bridge_num}
+    [Arguments]    ${node_id}    ${bridge}
     [Documentation]    This request will delete the bridge node from the OVSDB
-    ${resp}    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}%2Fbridge%2F${bridge_num}
-    Should Be Equal As Strings    ${resp.status_code}    200
-
-Add Vxlan To Bridge
-    [Arguments]    ${mininet_ip}    ${bridge_num}    ${vxlan_port}    ${remote_ip}    ${custom_port}=create_port.json
-    [Documentation]    This request will create vxlan port for vxlan tunnel and attach it to the specific bridge
-    Add Termination Point    ${mininet_ip}:${OVSDB_PORT}    ${bridge_num}    ${vxlan_port}    ${remote_ip}
+    ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}${node_id}%2Fbridge%2F${bridge}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
 
 Add Termination Point
-    [Arguments]    ${node_id}    ${bridge_name}    ${tp_name}    ${remote_ip}=${TOOLS_SYSTEM_IP}
+    [Arguments]    ${node_id}    ${bridge}    ${tp_name}    ${remote_ip}=${TOOLS_SYSTEM_IP}
     [Documentation]    Using the json data body file as a template, a REST config request is made to
-    ...    create a termination-point ${tp_name} on ${bridge_name} for the given ${node_id}. The ports
+    ...    create a termination-point ${tp_name} on ${bridge} for the given ${node_id}. The ports
     ...    remote-ip defaults to ${TOOLS_SYSTEM_IP}
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
-    ${body}    Replace String    ${body}    192.168.0.21    ${remote_ip}
-    ${body}    Replace String    ${body}    vxlanport    ${tp_name}
-    ${uri}=    Set Variable    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${node_id}%2Fbridge%2F${bridge_name}
-    ${resp}    RequestsLibrary.Put Request    session    ${uri}/termination-point/${tp_name}/    data=${body}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${body} =    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
+    ${body} =    String.Replace String    ${body}    192.168.0.21    ${remote_ip}
+    ${body} =    String.Replace String    ${body}    vxlanport    ${tp_name}
+    ${node_id_} =    BuiltIn.Evaluate    """${node_id}""".replace("/","%2F")
+    ${uri} =    BuiltIn.Set Variable    ${SOUTHBOUND_CONFIG_API}${node_id_}%2Fbridge%2F${bridge}
+    ${resp} =    RequestsLibrary.Put Request    session    ${uri}/termination-point/${tp_name}/    data=${body}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+
+Add Vxlan To Bridge
+    [Arguments]    ${node_ip}    ${bridge}    ${vxlan_port}    ${remote_ip}    ${port}=${OVSDB_NODE_PORT}
+    [Documentation]    This request will create vxlan port for vxlan tunnel and attach it to the specific bridge
+    OVSDB.Add Termination Point    ${node_ip}:${port}    ${bridge}    ${vxlan_port}    ${remote_ip}
 
 Verify OVS Reports Connected
     [Arguments]    ${tools_system}=${TOOLS_SYSTEM_IP}
     [Documentation]    Uses "vsctl show" to check for string "is_connected"
-    ${output}    Verify Ovs-vsctl Output    show    is_connected    ${tools_system}
+    ${output}    Verify Ovs-vsctl Output    show    is_connected    ${tools_system}
     [Return]    ${output}
 
 Verify Ovs-vsctl Output
@@ -81,10 +108,10 @@ Verify Ovs-vsctl Output
     [Documentation]    A wrapper keyword to make it easier to validate ovs-vsctl output, and gives an easy
     ...    way to check this output in a WUKS. The argument ${should_match} can control if the match should
     ...    exist (True} or not (False) or don't care (anything but True or False). ${should_match} is True by default
-    ${output}=    Utils.Run Command On Mininet    ${ovs_system}    sudo ovs-vsctl ${vsctl_args}
-    Log    ${output}
-    Run Keyword If    "${should_match}"=="True"    Should Contain    ${output}    ${expected_output}
-    Run Keyword If    "${should_match}"=="False"    Should Not Contain    ${output}    ${expected_output}
+    ${output} =    Utils.Run Command On Mininet    ${ovs_system}    sudo ovs-vsctl ${vsctl_args}
+    BuiltIn.Log    ${output}
+    BuiltIn.Run Keyword If    "${should_match}" == "True"    BuiltIn.Should Contain    ${output}    ${expected_output}
+    BuiltIn.Run Keyword If    "${should_match}" == "False"    BuiltIn.Should Not Contain    ${output}    ${expected_output}
     [Return]    ${output}
 
 Get OVSDB UUID
@@ -92,32 +119,32 @@ Get OVSDB UUID
     [Documentation]    Queries the topology in the operational datastore and searches for the node that has
     ...    the ${ovs_system_ip} argument as the "remote-ip". If found, the value returned will be the value of
     ...    node-id stripped of "ovsdb://uuid/". If not found, ${EMPTY} will be returned.
-    ${uuid}=    Set Variable    ${EMPTY}
-    ${resp}=    RequestsLibrary.Get Request    ${controller_http_session}    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
-    ${resp_json}=    To Json    ${resp.content}
-    ${topologies}=    Get From Dictionary    ${resp_json}    topology
-    ${topology}=    Get From List    ${topologies}    0
-    ${node_list}=    Get From Dictionary    ${topology}    node
-    Log    ${node_list}
+    ${uuid} =    Set Variable    ${EMPTY}
+    ${resp} =    RequestsLibrary.Get Request    ${controller_http_session}    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp_json} =    RequestsLibrary.To Json    ${resp.content}
+    ${topologies} =    Collections.Get From Dictionary    ${resp_json}    topology
+    ${topology} =    Collections.Get From List    ${topologies}    0
+    ${node_list} =    Collections.Get From Dictionary    ${topology}    node
+    BuiltIn.Log    ${node_list}
     # Since bridges are also listed as nodes, but will not have the extra "ovsdb:connection-info data,
     # we need to use "Run Keyword And Ignore Error" below.
     : FOR    ${node}    IN    @{node_list}
-    \    ${node_id}=    Get From Dictionary    ${node}    node-id
-    \    ${node_uuid}=    Replace String    ${node_id}    ovsdb://uuid/    ${EMPTY}
-    \    ${status}    ${connection_info}    Run Keyword And Ignore Error    Get From Dictionary    ${node}    ovsdb:connection-info
-    \    ${status}    ${remote_ip}    Run Keyword And Ignore Error    Get From Dictionary    ${connection_info}    remote-ip
-    \    ${uuid}=    Set Variable If    '${remote_ip}' == '${ovs_system_ip}'    ${node_uuid}    ${uuid}
+    \    ${node_id} =    Collections.Get From Dictionary    ${node}    node-id
+    \    ${node_uuid} =    String.Replace String    ${node_id}    ovsdb://uuid/    ${EMPTY}
+    \    ${status}    ${connection_info} =    BuiltIn.Run Keyword And Ignore Error    Collections.Get From Dictionary    ${node}    ovsdb:connection-info
+    \    ${status}    ${remote_ip} =    BuiltIn.Run Keyword And Ignore Error    Collections.Get From Dictionary    ${connection_info}    remote-ip
+    \    ${uuid} =    Set Variable If    '${remote_ip}' == '${ovs_system_ip}'    ${node_uuid}    ${uuid}
     [Return]    ${uuid}
 
 Collect OVSDB Debugs
     [Arguments]    ${switch}=br-int
     [Documentation]    Used to log useful test debugs for OVSDB related system tests.
-    ${output}=    Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
-    Log    ${output}
-    ${output}=    Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-ofctl -O OpenFlow13 dump-flows ${switch} | cut -d',' -f3-
-    Log    ${output}
+    ${output} =    Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
+    BuiltIn.Log    ${output}
+    ${output} =    Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-ofctl -O OpenFlow13 dump-flows ${switch} | cut -d',' -f3-
+    BuiltIn.Log    ${output}
 
 Clean OVSDB Test Environment
     [Arguments]    ${tools_system}=${TOOLS_SYSTEM_IP}
@@ -134,9 +161,9 @@ Restart OVSDB
     [Arguments]    ${ovs_ip}
     [Documentation]    Restart the OVS node without cleaning the current configuration.
     ${output} =    Utils.Run Command On Mininet    ${ovs_ip}    sudo /usr/share/openvswitch/scripts/ovs-ctl stop
-    Log    ${output}
+    BuiltIn.Log    ${output}
     ${output} =    Utils.Run Command On Mininet    ${ovs_ip}    sudo /usr/share/openvswitch/scripts/ovs-ctl start
-    Log    ${output}
+    BuiltIn.Log    ${output}
 
 Set Controller In OVS Bridge
     [Arguments]    ${tools_system}    ${bridge}    ${controller_opt}    ${ofversion}=13
@@ -147,60 +174,132 @@ Set Controller In OVS Bridge
 Check OVS OpenFlow Connections
     [Arguments]    ${tools_system}    ${of_connections}
     [Documentation]    Check OVS instance with IP ${tools_system} has ${of_connections} OpenFlow connections.
-    ${output}=    Utils.Run Command On Mininet    ${tools_system}    sudo ovs-vsctl show
-    Log    ${output}
+    ${output} =    Utils.Run Command On Mininet    ${tools_system}    sudo ovs-vsctl show
+    BuiltIn.Log    ${output}
     BuiltIn.Should Contain X Times    ${output}    is_connected    ${of_connections}
 
 Add Multiple Managers to OVS
     [Arguments]    ${tools_system}=${TOOLS_SYSTEM_IP}    ${controller_index_list}=${EMPTY}    ${ovs_mgr_port}=6640
     [Documentation]    Connect OVS to the list of controllers in the ${controller_index_list} or all if no list is provided.
     ${index_list} =    ClusterManagement.List Indices Or All    given_list=${controller_index_list}
-    Log    Clear any existing mininet
     Utils.Clean Mininet System    ${tools_system}
-    ${ovs_opt}=    Set Variable
+    ${ovs_opt} =    BuiltIn.Set Variable
     : FOR    ${index}    IN    @{index_list}
-    \    ${ovs_opt}=    Catenate    ${ovs_opt}    ${SPACE}tcp:${ODL_SYSTEM_${index}_IP}:${ovs_mgr_port}
-    \    Log    ${ovs_opt}
-    Log    Configure OVS Managers in the OVS
+    \    ${ovs_opt} =    BuiltIn.Catenate    ${ovs_opt}    ${SPACE}tcp:${ODL_SYSTEM_${index}_IP}:${ovs_mgr_port}
+    \    BuiltIn.Log    ${ovs_opt}
     Utils.Run Command On Mininet    ${tools_system}    sudo ovs-vsctl set-manager ${ovs_opt}
-    Log    Check OVS configuration
-    ${output}=    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected    ${tools_system}
-    Log    ${output}
-    ${controller_index}=    Collections.Get_From_List    ${index_list}    0
-    ${session}=    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${controller_index}
-    ${ovsdb_uuid}=    Wait Until Keyword Succeeds    30s    2s    Get OVSDB UUID    controller_http_session=${session}
+    ${output} =    BuiltIn.Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected    ${tools_system}
+    BuiltIn.Log    ${output}
+    ${controller_index} =    Collections.Get_From_List    ${index_list}    0
+    ${session} =    ClusterManagement.Resolve_Http_Session_For_Member    member_index=${controller_index}
+    ${ovsdb_uuid} =    BuiltIn.Wait Until Keyword Succeeds    30s    2s    OVSDB.Get OVSDB UUID    controller_http_session=${session}
     [Return]    ${ovsdb_uuid}
 
 Get DPID
     [Arguments]    ${ip}
     [Documentation]    Returns the dpnid from the system at the given ip address using ovs-ofctl assuming br-int is present.
-    ${output} =    Run Command On Remote System    ${ip}    sudo ovs-ofctl show -O Openflow13 br-int | head -1 | awk -F "dpid:" '{print $2}'
-    ${dpnid} =    Convert To Integer    ${output}    16
-    Log    ${dpnid}
+    ${output} =    Builtin.Run Command On Remote System    ${ip}    sudo ovs-ofctl show -O Openflow13 br-int | head -1 | awk -F "dpid:" '{print $2}'
+    ${dpnid} =    BuiltIn.Convert To Integer    ${output}    16
+    BuiltIn.Log    ${dpnid}
     [Return]    ${dpnid}
 
 Get Subnet
     [Arguments]    ${ip}
     [Documentation]    Return the subnet from the system at the given ip address and interface
-    ${output} =    Run Command On Remote System    ${ip}    /usr/sbin/ip addr show | grep ${ip} | cut -d' ' -f6
+    ${output} =    Utils.Run Command On Remote System    ${ip}    /usr/sbin/ip addr show | grep ${ip} | cut -d' ' -f6
     ${interface} =    ipaddress.ip_interface    ${output}
-    ${network}=    Set Variable    ${interface.network.__str__()}
+    ${network} =    BuiltIn.Set Variable    ${interface.network.__str__()}
     [Return]    ${network}
 
 Get Ethernet Adapter
     [Arguments]    ${ip}
     [Documentation]    Returns the ethernet adapter name from the system at the given ip address using ip addr show.
-    ${adapter} =    Run Command On Remote System    ${ip}    /usr/sbin/ip addr show | grep ${ip} | cut -d " " -f 11
-    Log    ${adapter}
+    ${adapter} =    Builtin.Run Command On Remote System    ${ip}    /usr/sbin/ip addr show | grep ${ip} | cut -d " " -f 11
+    BuiltIn.Log    ${adapter}
     [Return]    ${adapter}
 
 Get Default Gateway
     [Arguments]    ${ip}
     [Documentation]    Returns the default gateway at the given ip address using route command.
-    ${gateway} =    Run Command On Remote System    ${ip}    /usr/sbin/route -n | grep '^0.0.0.0' | cut -d " " -f 10
-    Log    ${gateway}
+    ${gateway} =    Builtin.Run Command On Remote System    ${ip}    /usr/sbin/route -n | grep '^0.0.0.0' | cut -d " " -f 10
+    BuiltIn.Log    ${gateway}
     [Return]    ${gateway}
 
+Log Config And Operational Topology
+    [Documentation]    For debugging purposes, this will log both config and operational topo data stores
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    ${resp} =    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+
+Config and Operational Topology Should Be Empty
+    [Documentation]    This will check that only the expected output is there for both operational and config
+    ...    topology data stores. Empty probably means that only ovsdb:1 is there.
+    ${config_resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    ${operational_resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
+    BuiltIn.Should Contain    ${config_resp.content}    {"topology-id":"ovsdb:1"}
+    BuiltIn.Should Contain    ${operational_resp.content}    {"topology-id":"ovsdb:1"}
+
+Modify Multi Port Body
+    [Arguments]    ${ovs_1_port_name}    ${ovs_2_port_name}    ${bridge}
+    [Documentation]    Updates two port names for the given ${bridge} in config store
+    ${body} =    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/bug_7414/create_multiple_ports.json
+    ${ovs_1_ovsdb_uuid} =    Get OVSDB UUID    ${TOOLS_SYSTEM_IP}
+    ${ovs_2_ovsdb_uuid} =    Get OVSDB UUID    ${TOOLS_SYSTEM_2_IP}
+    ${body} =    Replace String    ${body}    OVS_1_UUID    ${ovs_1_ovsdb_uuid}
+    ${body} =    Replace String    ${body}    OVS_2_UUID    ${ovs_2_ovsdb_uuid}
+    ${body} =    Replace String    ${body}    OVS_1_BRIDGE_NAME    ${bridge}
+    ${body} =    Replace String    ${body}    OVS_2_BRIDGE_NAME    ${bridge}
+    ${body} =    Replace String    ${body}    OVS_1_IP    ${TOOLS_SYSTEM_IP}
+    ${body} =    Replace String    ${body}    OVS_2_IP    ${TOOLS_SYSTEM_2_IP}
+    ${body} =    Replace String    ${body}    OVS_1_PORT_NAME    ${ovs_1_port_name}
+    ${body} =    Replace String    ${body}    OVS_2_PORT_NAME    ${ovs_2_port_name}
+    ${uri} =    Builtin.Set Variable    ${CONFIG_TOPO_API}
+    BuiltIn.Log    URI is ${uri}
+    BuiltIn.Log    data: ${body}
+    ${resp} =    RequestsLibrary.Put Request    session    ${uri}    data=${body}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    [Return]    ${body}
+
+Create Qos
+    [Arguments]    ${qos}
+    ${body} =    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_qos.json
+    ${uri} =    BuiltIn.Set Variable    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${qos}/
+    ${body} =    Replace String    ${body}    QOS-1    ${qos}
+    BuiltIn.Log    URI is ${uri}
+    BuiltIn.Log    data: ${body}
+    ${resp} =    RequestsLibrary.Put Request    session    ${uri}    data=${body}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+
+Create Queue
+    [Arguments]    ${queue}
+    ${body} =    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_qoslinkedqueue.json
+    ${body} =    Replace String    ${body}    QUEUE-1    ${queue}
+    ${uri} =    BuiltIn.Set Variable    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:queues/${queue}/
+    BuiltIn.Log    URI is ${uri}
+    BuiltIn.Log    data: ${body}
+    ${resp} =    RequestsLibrary.Put Request    session    ${uri}    data=${body}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+
+Update Qos
+    [Arguments]    ${qos}
+    ${body} =    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/update_existingqos.json
+    ${uri} =    BuiltIn.Set Variable    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/
+    BuiltIn.Log    URL is ${uri}
+    BuiltIn.Log    data: ${body}
+    ${resp} =    RequestsLibrary.Put Request    session    ${uri}    data=${body}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+
+Create Qos Linked Queue
+    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/bug_7160/create_qoslinkedqueue.json
+    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1    data=${body}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+
 Add OVS Logging
     [Arguments]    ${conn_id}
     [Documentation]    Add higher levels of OVS logging
@@ -208,11 +307,27 @@ Add OVS Logging
     @{modules} =    BuiltIn.Create List    bridge:file:dbg    connmgr:file:dbg    inband:file:dbg    ofp_actions:file:dbg    ofp_errors:file:dbg
     ...    ofp_msgs:file:dbg    ovsdb_error:file:dbg    rconn:file:dbg    tunnel:file:dbg    vconn:file:dbg
     : FOR    ${module}    IN    @{modules}
-    \    Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/set ${module}    ${DEFAULT_LINUX_PROMPT_STRICT}
-    Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/list    ${DEFAULT_LINUX_PROMPT_STRICT}
+    \    Utils.Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/set ${module}    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Utils.Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/list    ${DEFAULT_LINUX_PROMPT_STRICT}
 
 Reset OVS Logging
     [Arguments]    ${conn_id}
     [Documentation]    Reset the OVS logging
     SSHLibrary.Switch Connection    ${conn_id}
-    ${output} =    Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/set :file:info    ${DEFAULT_LINUX_PROMPT_STRICT}
+    ${output} =    Utils.Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/set :file:info    ${DEFAULT_LINUX_PROMPT_STRICT}
+
+Suite Setup
+    SetupUtils.Setup_Utils_For_Setup_And_Teardown
+    KarafKeywords.Open Controller Karaf Console On Background
+    RequestsLibrary.Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+    OVSDB.Log Config And Operational Topology
+
+Suite Teardown
+    [Arguments]    ${uris}=@{EMPTY}
+    [Documentation]    Cleans up test environment, close existing sessions.
+    OVSDB.Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
+    : FOR    ${uri}    IN    @{uris}
+    \    RequestsLibrary.Delete Request    session    ${uri}
+    ${resp} =    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Config And Operational Topology
+    RequestsLibrary.Delete All Sessions
index 3c13197def3298542eb91e006169e2845149755b..b30a37a025b9773327cb29e03cf560cb11ff5264 100644 (file)
@@ -98,22 +98,31 @@ Check For Specific Number Of Elements At URI
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain X Times    ${resp.content}    ${element}    ${expected_count}
 
+Log Content
+    [Arguments]    ${resp_content}
+    ${resp_json} =    BuiltIn.Run Keyword If    '''${resp_content}''' != '${EMPTY}'    RequestsLibrary.To Json    ${resp_content}    pretty_print=True
+    ...    ELSE    BuiltIn.Set Variable    ${EMPTY}
+    BuiltIn.Log    ${resp_json}
+    [Return]    ${resp_json}
+
 Check For Elements At URI
-    [Arguments]    ${uri}    ${elements}    ${session}=session
+    [Arguments]    ${uri}    ${elements}    ${session}=session    ${pretty_print_json}=False
     [Documentation]    A GET is made at the supplied ${URI} and every item in the list of
     ...    ${elements} is verified to exist in the response
     ${resp}    RequestsLibrary.Get Request    ${session}    ${uri}
-    Log    ${resp.content}
+    BuiltIn.Run Keyword If    "${pretty_print_json}" == "True"    Log Content    ${resp.content}
+    ...    ELSE    BuiltIn.Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     : FOR    ${i}    IN    @{elements}
     \    Should Contain    ${resp.content}    ${i}
 
 Check For Elements Not At URI
-    [Arguments]    ${uri}    ${elements}    ${session}=session
+    [Arguments]    ${uri}    ${elements}    ${session}=session    ${pretty_print_json}=False
     [Documentation]    A GET is made at the supplied ${URI} and every item in the list of
     ...    ${elements} is verified to NOT exist in the response
     ${resp}    RequestsLibrary.Get Request    ${session}    ${uri}
-    Log    ${resp.content}
+    BuiltIn.Run Keyword If    "${pretty_print_json}" == "True"    Log Content    ${resp.content}
+    ...    ELSE    BuiltIn.Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     : FOR    ${i}    IN    @{elements}
     \    Should Not Contain    ${resp.content}    ${i}
index 54a6195acb29a1dedfaff9b2dda48546924a7ccd..9ac8283945c7fca828de49a91acf476b6876e559 100644 (file)
@@ -14,7 +14,7 @@ Check Shards Status Before Fail
 
 Start OVS Multiple Connections
     [Documentation]    Connect OVS to all cluster instances.
-    ${ovsdb_uuid}    Ovsdb.Add Multiple Managers to OVS
+    ${ovsdb_uuid}    OVSDB.Add Multiple Managers to OVS
     Set Suite Variable    ${ovsdb_uuid}
 
 Check Entity Owner Status And Find Owner and Candidate Before Fail
index 43c900c57efac51c9daa23d1b48e7f1d52e4e046..00064d976dfbbaa789813a5f674dabed629ea93e 100644 (file)
 *** Settings ***
 Documentation     Test suite for Connection Manager
-Suite Setup       Configure 1 OVSDB Node Suite Setup
-Suite Teardown    Configure 1 OVSDB Node Suite Teardown
+Suite Setup       OVSDB.Suite Setup
+Suite Teardown    Suite Teardown
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Force Tags        Southbound
 Library           OperatingSystem
-Library           String
 Library           RequestsLibrary
-Resource          ../../../variables/Variables.robot
+Resource          ../../../libraries/OVSDB.robot
 Resource          ../../../libraries/SetupUtils.robot
 Resource          ../../../libraries/Utils.robot
-Resource          ../../../libraries/OVSDB.robot
+Resource          ../../../variables/Variables.robot
 
 *** Variables ***
-${OVSDB_PORT}     6634
-${BRIDGE}         ovsdb-csit-test-bridge
+${BRIDGE}         ovsconf_br
+${PORT}           ovsconf_vx1
 ${QOS}            QOS-1
 ${QUEUE}          QUEUE-1
-${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
-${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
-@{node_list}      ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}    ${TOOLS_SYSTEM_IP}    ${OVSDB_PORT}
+@{NODE_LIST}      ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${TOOLS_SYSTEM_IP}    ${OVSDB_NODE_PORT}
 
 *** Test Cases ***
 Make the OVS instance to listen for connection
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_PORT}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
 
 Connect to OVSDB Node
     [Documentation]    Initiate the connection to OVSDB node from controller
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
-    ${sample1}    Replace String    ${sample}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
-    Log    URL is ${SOUTHBOUND_CONFIG_API}
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected
+    OVSDB.Connect To Ovsdb Node    ${TOOLS_SYSTEM_IP}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected
 
 Get Operational Topology
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${node_list}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${NODE_LIST}    pretty_print_json=True
 
 Create a Bridge
     [Documentation]    This will create bridge on the specified OVSDB node.
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_bridge.json
-    ${sample1}    Replace String    ${sample}    tcp:127.0.0.1:6633    tcp:${ODL_SYSTEM_IP}:6633
-    ${sample2}    Replace String    ${sample1}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${sample3}    Replace String    ${sample2}    br01    ${BRIDGE}
-    ${body}    Replace String    ${sample3}    61644    ${OVSDB_PORT}
-    Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Add Bridge To Ovsdb Node    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${TOOLS_SYSTEM_IP}    ${BRIDGE}    0000000000000040
 
 Get Config Topology with Bridge
     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
-    Should Contain    ${resp.content}    ${BRIDGE}
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
+    BuiltIn.Should Contain    ${resp.content}    ${BRIDGE}
 
 Get Operational Topology with Bridge
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
-    @{list}    Create List    ${BRIDGE}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ${BRIDGE}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
-Create Port and attach to a Bridge
+Create Port and Attach to a Bridge
     [Documentation]    This request will creates port/interface and attach it to the specific bridge
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
-    Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT}    10.0.0.10
 
 Get Operational Topology with Port
     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
-    @{list}    Create List    ${BRIDGE}    vxlanport
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Delete the Port
     [Documentation]    This request will delete the port node from the bridge node and data store.
-    ${resp}    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/${PORT}/
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
 
 Get Operational Topology after Deletion of Port
     [Documentation]    This request will fetch the operational topology after the Port is deleted
-    @{list}    Create List    vxlanport
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ${PORT}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Delete the Bridge
     [Documentation]    This request will delete the bridge node from the config data store.
-    ${resp}    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}%2Fbridge%2F${BRIDGE}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
 
 Get Operational Topology after Deletion of Bridge
     [Documentation]    This request will fetch the operational topology after the Bridge is deleted
-    @{list}    Create List    ${BRIDGE}    vxlanport
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Verify Config Still Has OVS Info
-    [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${node_list}
+    [Documentation]    This will fetch the configuration topology from configuration data store to verify the node is still in the data store
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${NODE_LIST}    pretty_print_json=True
 
 Delete the OVSDB Node
     [Documentation]    This request will delete the OVSDB node
-    ${resp}    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
 
 Get Operational Topology to make sure the connection has been deleted
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
-    @{list}    Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Get Configuration Topology to make sure the connection has been deleted
     [Documentation]    This request will fetch the configuration topology from the connected OVSDB nodes
-    @{list}    Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${CONFIG_TOPO_API}/topology/ovsdb:1    ${node_list}
+    @{list} =    BuiltIn.Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${CONFIG_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Reconnect to OVSDB Node
     [Documentation]    Initiate the connection to OVSDB node from controller
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
-    ${sample1}    Replace String    ${sample}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
-    Log    URL is ${SOUTHBOUND_CONFIG_API}
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Connect To Ovsdb Node    ${TOOLS_SYSTEM_IP}
 
 Get Operational Topology After Node Reconnect
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${node_list}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${NODE_LIST}    pretty_print_json=True
 
 Get Config Topology After Reconnect
     [Documentation]    This will fetch the configuration topology from configuration data store after reconnect
     ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${node_list}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${NODE_LIST}    pretty_print_json=True
 
 Create OVSDB NODE HOST1
-    [Documentation]    This request will create OVSDB NODE HOST1 and attach it to the specific bridge
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_node.json
-    ${sample1}    Replace String    ${sample}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
-    Log    URL is ${CONFIG_TOPO_API}/topology/ovsdb:1/
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Post Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    [Documentation]    This request will create OVSDB NODE HOST1
+    OVSDB.Create Ovsdb Node    ${TOOLS_SYSTEM_IP}
 
 Create QOS entry
     [Documentation]    This request will create QOS entry
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_qos.json
-    Log    URL is ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Create Qos    ${QOS}
 
 Create Queue entry to the queues list of a ovsdb node
     [Documentation]    This request will creates Queue entry in the queues list of a ovsdb node
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_queue.json
-    Log    URL is ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:queues/${QUEUE}/
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:queues/${QUEUE}/    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Create Queue    ${QUEUE}
 
 Update existing Queue entry to a OVSDB Node
     [Documentation]    This request will update the existing queue entry to a OVSDB Node
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_qoslinkedqueue.json
-    Log    URL is ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:queues/${QUEUE}/
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:queues/${QUEUE}/    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Create Queue    ${queue}
 
 Update QOS with a Linked queue entry to a OVSDB Node
     [Documentation]    This request will update the QOS entry with a Linked queue entry to a OVSDB Node
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/update_existingqos.json
-    Log    URL is ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Update Qos    ${QOS}
 
 Get QOS Config Topology with port
     [Documentation]    This will fetch the configuration topology from configuration data store to verify the QOS is added to the data store
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    Should Contain    ${resp.content}    ${QOS}
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    BuiltIn.Should Contain    ${resp.content}    ${QOS}
 
 Get QOS Operational Topology with port
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to verify the QOS is added to the data store
-    @{list}    Create List    ${QOS}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ${QOS}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Get Queue Config Topology with port
     [Documentation]    This request will fetch the configuration topology from configuration data store to verify the Queue is added to the data store
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    Should Contain    ${resp.content}    ${QUEUE}
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    BuiltIn.Should Contain    ${resp.content}    ${QUEUE}
 
 Get Queue Operational Topology with port
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to verify the Queue is added to the data store
-    @{list}    Create List    ${QUEUE}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ${QUEUE}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Delete a Queue entry from a Qos entry
     [Documentation]    This request will Delete a Queue entry from a Qos entry
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/queue-list/0/
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/queue-list/0/
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
 Delete a QoS entry from a node
     [Documentation]    This request will Delete a QoS entry from a node.
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
 Delete a Queue entry from an ovsdb node
     [Documentation]    This request will Delete a Queue entry from an ovsdb node
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:queues/${QUEUE}/
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:queues/${QUEUE}/
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
 Delete the OVSDB Node HOST1
     [Documentation]    This request will delete the OVSDB node
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
 Get Config Topology to verify that deleted configurations are cleaned from config datastore
     [Documentation]    This request will fetch the configuration topology from configuration data store to verify OVSDB NODE is deleted frrom the configuration data store
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    Should not Contain    ${resp.content}    ovsdb:HOST1
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    BuiltIn.Should Not Contain    ${resp.content}    ovsdb:HOST1
 
 Check For Bug 4756
     [Documentation]    bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
     ...    case executed.
-    Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
-    [Teardown]    Report_Failure_Due_To_Bug    4756
+    Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    4756
 
 Check For Bug 4794
     [Documentation]    bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
     ...    case executed.
-    Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
-    [Teardown]    Report_Failure_Due_To_Bug    4794
+    Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    4794
 
 *** Keywords ***
-Configure 1 OVSDB Node Suite Setup
-    SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    Open Controller Karaf Console On Background
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
-
-Configure 1 OVSDB Node Suite Teardown
+Suite Teardown
     [Documentation]    Cleans up test environment, close existing sessions.
-    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
-    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Delete All Sessions
+    @{uris} =    Builtin.Create List    ${SOUTHBOUND_NODE_CONFIG_API}
+    OVSDB.Suite Teardown    ${uris}
index e9b38a1c8d82896a7840a508d871d4ff742c0bd3..b3b41f903c8cd32d357ba1a87270eecaad0c4710 100644 (file)
 *** Settings ***
 Documentation     Test suite for Connection Manager
-Suite Setup       OVSDB Connection Manager Suite Setup
-Suite Teardown    OVSDB Connection Manager Suite Teardown
+Suite Setup       OVSDB.Suite Setup
+Suite Teardown    Suite Teardown
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Force Tags        Southbound
-Library           OperatingSystem
-Library           String
 Library           RequestsLibrary
-Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/SetupUtils.robot
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/OVSDB.robot
+Resource          ../../../variables/Variables.robot
 
 *** Variables ***
-${OVSDB_PORT}     6634
-${BRIDGE1}        ovsdb-csit-test-bridge1
-${BRIDGE2}        ovsdb-csit-test-bridge2
-${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
-${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
-@{node_list}      ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}    ${TOOLS_SYSTEM_IP}    ${OVSDB_PORT}
+${BRIDGE1}        ovscon_br1
+${BRIDGE2}        ovscon_br2
+@{NODE_LIST}      ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${TOOLS_SYSTEM_IP}    ${OVSDB_NODE_PORT}
+${OVSDB_UUID}     ${EMPTY}
 
 *** Test Cases ***
 Connecting an OVS instance to the controller
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected
 
 Get Operational Topology to verify the ovs instance is connected to the controller
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
-    @{list}    Create List    ovsdb://uuid    "remote-ip":"${TOOLS_SYSTEM_IP}"    "local-port":6640
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
-    ${ovsdb_uuid}=    Get OVSDB UUID    ${TOOLS_SYSTEM_IP}
-    Set Suite Variable    ${ovsdb_uuid}
+    @{list} =    BuiltIn.Create List    ovsdb://uuid    "remote-ip":"${TOOLS_SYSTEM_IP}"    "local-port":${OVSDBPORT}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
+    ${OVSDB_UUID} =    OVSDB.Get OVSDB UUID    ${TOOLS_SYSTEM_IP}
+    BuiltIn.Set Suite Variable    ${OVSDB_UUID}
 
 Verify OVS Not In Config Topology
     [Documentation]    This request will fetch the configuration topology from configuration data store
-    Check For Elements Not At URI    ${CONFIG_TOPO_API}    ${node_list}
+    Utils.Check For Elements Not At URI    ${CONFIG_TOPO_API}    ${NODE_LIST}    pretty_print_json=True
 
 Create bridge manually
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${BRIDGE1}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${BRIDGE1}
 
 Get Operational Topology to verify the bridge has been added
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
-    @{list}    Create List    ${BRIDGE1}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ${BRIDGE1}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Get Config Topology to verify the manually added bridge is not added to the config datastore
     [Documentation]    This request will fetch the configuration topology from configuration data store
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
-    Should not Contain    ${resp.content}    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}/bridge/${BRIDGE1}
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
+    BuiltIn.Should Not Contain    ${resp.content}    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}/bridge/${BRIDGE1}
 
 Create a Bridge through controller
     [Documentation]    This will create bridge on the specified OVSDB node.
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_bridge.json
-    ${body}    Replace String    ${body}    ovsdb://127.0.0.1:61644    ovsdb://uuid/${ovsdb_uuid}
-    ${body}    Replace String    ${body}    tcp:127.0.0.1:6633    tcp:${ODL_SYSTEM_IP}:6633
-    ${body}    Replace String    ${body}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${body}    Replace String    ${body}    br01    ${BRIDGE2}
-    ${body}    Replace String    ${body}    61644    ${OVSDB_PORT}
-    ${uri}=    Set Variable    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE2}
-    Log    URL is ${uri}
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${uri}    data=${body}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Add Bridge To Ovsdb Node    uuid/${OVSDB_UUID}    ${TOOLS_SYSTEM_IP}    ${BRIDGE2}    0000000000000002
 
 Get Operational Topology to verify the bridge has been added through rest call
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
-    @{list}    Create List    ${BRIDGE2}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ${BRIDGE2}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Get Config Topology to verify the entry added to the config datastore
     [Documentation]    This request will fetch the configuration topology from configuration data store
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
-    Should Contain    ${resp.content}    ovsdb://uuid/${ovsdb_uuid}/bridge/${BRIDGE2}
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
+    BuiltIn.Should Contain    ${resp.content}    ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2}
 
 Create bridge of already added bridge
     [Documentation]    This will add bridge to the config datastore
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_bridge.json
-    ${body}    Replace String    ${body}    ovsdb://127.0.0.1:61644    ovsdb://uuid/${ovsdb_uuid}
-    ${body}    Replace String    ${body}    tcp:127.0.0.1:6633    tcp:${ODL_SYSTEM_IP}:6633
-    ${body}    Replace String    ${body}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${body}    Replace String    ${body}    br01    ${BRIDGE1}
-    ${body}    Replace String    ${body}    61644    ${OVSDB_PORT}
-    ${uri}=    Set Variable    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE1}
-    Log    URL is ${uri}
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${uri}    data=${body}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Add Bridge To Ovsdb Node    uuid/${OVSDB_UUID}    ${TOOLS_SYSTEM_IP}    ${BRIDGE1}    0000000000000001
 
 Get Config Topology to verify the entry of existing bridge added to the config datastore
     [Documentation]    This request will fetch the configuration topology from configuration data store
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
-    Should Contain    ${resp.content}    ovsdb://uuid/${ovsdb_uuid}/bridge/${BRIDGE1}
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
+    BuiltIn.Should Contain    ${resp.content}    ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE1}
 
 Delete bridge manually
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-br ${BRIDGE2}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-br ${BRIDGE2}
 
 Get Operational Topology to verify the bridge has been deleted manually
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
-    @{list}    Create List    ${BRIDGE2}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ${BRIDGE2}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Config Topology Still Contains Bridge
     [Documentation]    This request will fetch the configuration topology from configuration data store
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
-    Should Contain    ${resp.content}    ovsdb://uuid/${ovsdb_uuid}/bridge/${BRIDGE2}
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
+    BuiltIn.Should Contain    ${resp.content}    ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2}
 
 Delete the Bridge through rest call
     [Documentation]    This request will delete the bridge node from the config data store.
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE2}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${resp} =    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
 
 Get Operational Topology after Deletion of Bridge
     [Documentation]    This request will fetch the operational topology after the Bridge is deleted
-    @{list}    Create List    ${BRIDGE2}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    @{list} =    BuiltIn.Create List    ${BRIDGE2}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
 
 Trunk And Vlan Tag Is Removed From Operational
     [Documentation]    Verify that when the vlan tag is added and removed from an ovs port, it should be accurately reflected
     ...    in the operational store. Also verify that when all trunks are cleared from ovs, it's accurate in operational.
-    [Tags]    bug 8529    bug
-    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br vlan-tag-br
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-port vlan-tag-br vlan-tag-port
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set port vlan-tag-port tag=81
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set port vlan-tag-port trunks=[181,182]
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected
-    Collect OVSDB Debugs
-    @{list}    Create List    vlan-tag-br    vlan-tag-port    "ovsdb:vlan-tag":81    "trunk":181    "trunk":182
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl clear port vlan-tag-port tag
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl remove port vlan-tag-port trunks 181
-    @{list}    Create List    "ovsdb:vlan-tag":81    "trunk":181
-    Collect OVSDB Debugs
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl clear port vlan-tag-port trunks
-    @{list}    Create List    "ovsdb:vlan-tag":81    "trunk":181    "trunk":182
-    Collect OVSDB Debugs
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
-    [Teardown]    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
+    [Tags]    8529
+    OVSDB.Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br vlan-tag-br
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-port vlan-tag-br vlan-tag-port
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set port vlan-tag-port tag=81
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set port vlan-tag-port trunks=[181,182]
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected
+    OVSDB.Collect OVSDB Debugs
+    @{list}    BuiltIn.Create List    vlan-tag-br    vlan-tag-port    "ovsdb:vlan-tag":81    "trunk":181    "trunk":182
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl clear port vlan-tag-port tag
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl remove port vlan-tag-port trunks 181
+    @{list}    BuiltIn.Create List    "ovsdb:vlan-tag":81    "trunk":181
+    OVSDB.Collect OVSDB Debugs
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl clear port vlan-tag-port trunks
+    @{list}    BuiltIn.Create List    "ovsdb:vlan-tag":81    "trunk":181    "trunk":182
+    OVSDB.Collect OVSDB Debugs
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
+    [Teardown]    Builtin.Run Keywords    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
+    ...    AND    Utils.Report_Failure_Due_To_Bug    8529
 
 Check For Bug 4756
     [Documentation]    bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
     ...    case executed.
-    Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
-    [Teardown]    Report_Failure_Due_To_Bug    4756
+    Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    4756
 
 Check For Bug 4794
     [Documentation]    bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
     ...    case executed.
-    Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
-    [Teardown]    Report_Failure_Due_To_Bug    4794
+    Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    4794
 
 *** Keywords ***
-OVSDB Connection Manager Suite Setup
-    SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
-
-OVSDB Connection Manager Suite Teardown
+Suite Teardown
     [Documentation]    Cleans up test environment, close existing sessions.
-    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
-    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE1}
-    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE2}
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Delete All Sessions
+    @{uris} =    Builtin.Create List    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE1}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2}
+    OVSDB.Suite Teardown    ${uris}
index b36f708b9b65432b9af3bd3fc8aaaf9ae6ec06df..5c9e91e4a6bceba0f6449dbeb093205f201eb8c1 100644 (file)
 *** Settings ***
 Documentation     Test suite for Connection Manager
-Suite Setup       Configure Exit OVSDB Node Suite Setup
-Suite Teardown    Configure Exit OVSDB Node Suite Teardown
+Suite Setup       OVSDB.Suite Setup
+Suite Teardown    Suite Teardown
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Force Tags        Southbound
-Library           OperatingSystem
-Library           String
 Library           RequestsLibrary
+Resource          ../../../libraries/OVSDB.robot
 Resource          ../../../libraries/SetupUtils.robot
 Resource          ../../../libraries/Utils.robot
-Resource          ../../../libraries/OVSDB.robot
-Variables         ../../../variables/Variables.py
+Resource          ../../../variables/Variables.robot
 
 *** Variables ***
-${OVSDB_PORT}     6634
-${BRIDGE}         ovsdb-csit-test-bridge
-${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
-${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
-@{node_list}      ${BRIDGE}    vx1
+${BRIDGE}         ovsconf_exit_br
+${PORT1}          vx1
+${PORT2}          vx2
+@{NODE_LIST}      ${BRIDGE}    ${PORT1}
 
 *** Test Cases ***
 Create a Topology in OVSDB node
     [Documentation]    Create topology in OVSDB and ready it for further tests
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${BRIDGE}
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-port ${BRIDGE} vx1 -- set Interface vx1 type=vxlan options:remote_ip=192.168.1.11
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:6634
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${BRIDGE}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-port ${BRIDGE} ${PORT1} -- set Interface ${PORT1} type=vxlan options:remote_ip=192.168.1.11
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:6634
 
 Connect to OVSDB Node
     [Documentation]    Initiate the connection to OVSDB node from controller
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
-    ${sample1}    Replace String    ${sample}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
-    Log    URL is ${SOUTHBOUND_CONFIG_API}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Connect To Ovsdb Node    ${TOOLS_SYSTEM_IP}
 
 Get Operational Topology
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list}
-    [Teardown]    Report_Failure_Due_To_Bug    5221
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${NODE_LIST}    pretty_print_json=True
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
 
 Verify Bridge Port Not In Config DS
     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
-    @{list}    Create List    vx1
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${CONFIG_TOPO_API}    ${list}
+    @{list} =    BuiltIn.Create List    ${PORT1}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${CONFIG_TOPO_API}    ${list}    pretty_print_json=True
 
 Create bridge of already added bridge
     [Documentation]    This will add bridge to the config datastore
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_bridge.json
-    ${sample1}    Replace String    ${sample}    tcp:127.0.0.1:6633    tcp:${ODL_SYSTEM_IP}:6633
-    ${sample2}    Replace String    ${sample1}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${sample3}    Replace String    ${sample2}    br01    ${BRIDGE}
-    ${body}    Replace String    ${sample3}    61644    ${OVSDB_PORT}
-    Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Add Bridge To Ovsdb Node    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${TOOLS_SYSTEM_IP}    ${BRIDGE}    0000000000000030
 
 Get Config Topology with Bridge
     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
-    @{list}    Create List    ${BRIDGE}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${CONFIG_TOPO_API}    ${list}
+    @{list} =    BuiltIn.Create List    ${BRIDGE}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${CONFIG_TOPO_API}    ${list}    pretty_print_json=True
 
 Create Port of already added port in OVSDB
     [Documentation]    This will add port/interface to the config datastore
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
-    ${sample1}    Replace String    ${sample}    vxlanport    vx1
-    ${body}    Replace String    ${sample1}    192.168.0.21    192.168.1.10
-    Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT1}    10.0.0.10
 
 Get Config Topology with Bridge and Port
     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${CONFIG_TOPO_API}    ${node_list}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${CONFIG_TOPO_API}    ${NODE_LIST}    pretty_print_json=True
 
 Modify the destination IP of Port
     [Documentation]    This will modify the dst ip of existing port
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
-    ${sample1}    Replace String    ${sample}    vxlanport    vx1
-    ${body}    Replace String    ${sample1}    192.168.0.21    10.0.0.19
-    Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/    data=${body}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT1}    10.0.0.19
 
 Get Operational Topology with modified Port
     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
-    @{list}    Create List    ${BRIDGE}    vx1    10.0.0.19
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
-    [Teardown]    Report_Failure_Due_To_Bug    5221
+    @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT1}    10.0.0.19
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
 
 Create Port and attach to a Bridge
     [Documentation]    This request will creates port/interface and attach it to the specific bridge
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_port.json
-    Log    URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+    OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT2}    10.0.0.121
 
 Get Operational Topology with Port
     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
-    @{list}    Create List    ${BRIDGE}    vxlanport
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
-    [Teardown]    Report_Failure_Due_To_Bug    5221
+    @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT2}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
 
 Delete the Port1
     [Documentation]    This request will delete the port node from the bridge node and data store.
-    ${resp}    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/${PORT1}/
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
 
 Get Operational Topology after deletion of Port1
     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
-    @{list}    Create List    vx1
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    @{list} =    BuiltIn.Create List    ${PORT1}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
 
 Delete the Port2
     [Documentation]    This request will delete the port node from the bridge node and data store.
-    ${resp}    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/${PORT2}/
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
 
 Get Operational Topology after Deletion of Port2
     [Documentation]    This request will fetch the operational topology after the Port is deleted
-    @{list}    Create List    vxlanport
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    @{list} =    BuiltIn.Create List    ${PORT2}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
 
 Delete the Bridge
     [Documentation]    This request will delete the bridge node from the config data store.
-    ${resp}    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}%2Fbridge%2F${BRIDGE}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
 
 Get Operational Topology after Deletion of Bridge
     [Documentation]    This request will fetch the operational topology after the Bridge is deleted
-    @{list}    Create List    ${BRIDGE}    vxlanport    vx1
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT1}    ${PORT2}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
 
 Delete the OVSDB Node
     [Documentation]    This request will delete the OVSDB node
-    ${resp}    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    ${resp} =    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_NODE_CONFIG_API}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
 
 Get Operational Topology after Deletion of OVSDB Node
     [Documentation]    This request will fetch the operational topology after the OVSDB node is deleted
-    @{list}    Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}    ${BRIDGE}    vxlanport    vx1
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    @{list} =    BuiltIn.Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT1}    ${PORT2}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
 
 Check For Bug 4756
     [Documentation]    bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
     ...    case executed
-    Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
-    [Teardown]    Report_Failure_Due_To_Bug    4756
+    Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    4756
 
 Check For Bug 4794
     [Documentation]    bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
     ...    case executed.
-    Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
-    [Teardown]    Report_Failure_Due_To_Bug    4794
+    Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    4794
 
 *** Keywords ***
-Configure Exit OVSDB Node Suite Setup
-    SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
-
-Configure Exit OVSDB Node Suite Teardown
+Suite Teardown
     [Documentation]    Cleans up test environment, close existing sessions.
-    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
-    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Delete All Sessions
+    @{uris} =    Builtin.Create List    ${SOUTHBOUND_NODE_CONFIG_API}
+    OVSDB.Suite Teardown    ${uris}
index 82b3d3040a116723dbc50691ac6df9b4f6961429..61a1f6cb11dabcc9fd8c7c212828c05fe12d38e6 100644 (file)
 *** Settings ***
 Documentation     Test suite for Connection Manager
-Suite Setup       Vxlan Extension Test Suite Setup
-Suite Teardown    Vxlan Extension Test Suite Teardown
+Suite Setup       OVSDB.Suite Setup
+Suite Teardown    Suite Teardown
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Force Tags        Southbound
-Library           OperatingSystem
-Library           String
-Library           Collections
-Library           SSHLibrary
 Library           RequestsLibrary
-Library           ../../../libraries/Common.py
-Variables         ../../../variables/Variables.py
-Resource          ../../../libraries/SetupUtils.robot
-Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/MininetKeywords.robot
 Resource          ../../../libraries/OVSDB.robot
+Resource          ../../../libraries/SetupUtils.robot
+Resource          ../../../libraries/Utils.robot
+Resource          ../../../variables/Variables.robot
 
 *** Variables ***
-${OVSDB_PORT}     6634
-${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
-@{node_list1}     ovsdb://${TOOLS_SYSTEM_2_IP}:${OVSDB_PORT}    ${TOOLS_SYSTEM_2_IP}    ${OVSDB_PORT}    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}    ${TOOLS_SYSTEM_IP}    ${OVSDB_PORT}
-${start1}         --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,1
-${start2}         --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,2
+@{NODE_LIST}      ${OVSDB_NODE_PORT}    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${TOOLS_SYSTEM_IP}    ${OVSDB_NODE_PORT}    ovsdb://${TOOLS_SYSTEM_2_IP}:${OVSDB_NODE_PORT}    ${TOOLS_SYSTEM_2_IP}
+${MN_OPTS_S1}     --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,1
+${MN_OPTS_S2}     --switch=ovsk,protocols=OpenFlow13 --custom ovsdb.py --topo host,2
 
 *** Test Cases ***
 Make the OVS instance to listen for connection
-    Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl del-manager
-    Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_PORT}
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_PORT}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl del-manager
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
 
 Connect controller to OVSDB Node1
     [Documentation]    Initiate the connection to OVSDB node from controller
-    Connect To Ovsdb Node    ${TOOLS_SYSTEM_2_IP}
+    OVSDB.Connect To Ovsdb Node    ${TOOLS_SYSTEM_IP}
 
 Connect controller to OVSDB Node2
     [Documentation]    Initiate the connection to OVSDB node from controller
-    Connect To Ovsdb Node    ${TOOLS_SYSTEM_IP}
+    OVSDB.Connect To Ovsdb Node    ${TOOLS_SYSTEM_2_IP}
 
 Get Operational Topology from OVSDB Node1 and OVSDB Node2
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${node_list1}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${NODE_LIST}    pretty_print_json=True
 
 Start the Mininet and create custom topology
     [Documentation]    This will start mininet with custom topology on both the Virtual Machines
-    ${conn_id1}    MininetKeywords.Start Mininet Single Controller    ${TOOLS_SYSTEM_2_IP}    ${ODL_SYSTEM_IP}    ${start1}    ${OVSDB_CONFIG_DIR}/ovsdb.py
-    Set Global Variable    ${conn_id1}
-    ${conn_id2}    MininetKeywords.Start Mininet Single Controller    ${TOOLS_SYSTEM_IP}    ${ODL_SYSTEM_IP}    ${start2}    ${OVSDB_CONFIG_DIR}/ovsdb.py
-    Set Global Variable    ${conn_id2}
+    ${conn_id1} =    MininetKeywords.Start Mininet Single Controller    ${TOOLS_SYSTEM_IP}    ${ODL_SYSTEM_IP}    ${MN_OPTS_S1}    ${OVSDB_CONFIG_DIR}/ovsdb.py
+    ${conn_id2} =    MininetKeywords.Start Mininet Single Controller    ${TOOLS_SYSTEM_2_IP}    ${ODL_SYSTEM_IP}    ${MN_OPTS_S2}    ${OVSDB_CONFIG_DIR}/ovsdb.py
 
 Get Operational Topology with custom topology
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to make sure the mininet created custom topology
-    @{list}    Create List    s1    s2
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    @{list} =    BuiltIn.Create List    s1    s2
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
 
 Add the bridge s1 in the config datastore of OVSDB Node1
     [Documentation]    This request will add already operational bridge to the config data store of the OVSDB node.
-    Add Bridge To Ovsdb Node    ${TOOLS_SYSTEM_2_IP}    s1    0000000000000001
+    OVSDB.Add Bridge To Ovsdb Node    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${TOOLS_SYSTEM_IP}    s1    0000000000000051
 
 Add the bridge s2 in the config datastore of OVSDB Node2
     [Documentation]    This request will add already operational bridge to the config data store of the OVSDB node.
-    Add Bridge To Ovsdb Node    ${TOOLS_SYSTEM_IP}    s2    0000000000000002
+    OVSDB.Add Bridge To Ovsdb Node    ${TOOLS_SYSTEM2_IP}:${OVSDB_NODE_PORT}    ${TOOLS_SYSTEM_2_IP}    s2    0000000000000052
 
 Get Config Topology with s1 and s2 Bridges
     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the config data store
-    @{list}    Create List    s1    s2
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${CONFIG_TOPO_API}    ${list}
+    @{list} =    BuiltIn.Create List    s1    s2
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${CONFIG_TOPO_API}    ${list}    pretty_print_json=True
 
 Create Vxlan Port and attach to s1 Bridge
     [Documentation]    This request will create vxlan port/interface for vxlan tunnel and attach it to the specific bridge s1 of OVSDB node 1
-    Add Vxlan To Bridge    ${TOOLS_SYSTEM_IP}    s2    vxlanport    ${TOOLS_SYSTEM_2_IP}
+    OVSDB.Add Vxlan To Bridge    ${TOOLS_SYSTEM_IP}    s1    s1-s2    ${TOOLS_SYSTEM_2_IP}
 
 Create Vxlan Port and attach to s2 Bridge
     [Documentation]    This request will create vxlan port/interface for vxlan tunnel and attach it to the specific bridge s2 of OVSDB node 2
-    Add Vxlan To Bridge    ${TOOLS_SYSTEM_2_IP}    s1    vxlanport    ${TOOLS_SYSTEM_IP}
+    OVSDB.Add Vxlan To Bridge    ${TOOLS_SYSTEM_2_IP}    s2    s2-s1    ${TOOLS_SYSTEM_IP}
 
 Get Operational Topology with vxlan tunnel
     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to verify that the vxlan tunnel is created
-    @{list}    Create List    vxlanport    ${TOOLS_SYSTEM_2_IP}    ${TOOLS_SYSTEM_IP}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    @{list} =    BuiltIn.Create List    s1-s2    s2-s1    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
 
 Delete Bridges from config datastore
     [Documentation]    This request will delete the bridges from config data store.
     [Tags]    Southbound
-    Delete Bridge From Ovsdb Node    ${TOOLS_SYSTEM_IP}    s2
-    Delete Bridge From Ovsdb Node    ${TOOLS_SYSTEM_2_IP}    s1
+    OVSDB.Delete Bridge From Ovsdb Node    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    s1
+    OVSDB.Delete Bridge From Ovsdb Node    ${TOOLS_SYSTEM_2_IP}:${OVSDB_NODE_PORT}    s2
 
 Disconnect controller connection from the connected OVSDBs nodes
     [Documentation]    This request will disconnect the controller from the connected OVSDB node for clean startup for next suite.
     [Tags]    Southbound
-    Disconnect From Ovsdb Node    ${TOOLS_SYSTEM_IP}
-    Disconnect From Ovsdb Node    ${TOOLS_SYSTEM_2_IP}
+    OVSDB.Disconnect From Ovsdb Node    ${TOOLS_SYSTEM_IP}
+    OVSDB.Disconnect From Ovsdb Node    ${TOOLS_SYSTEM_2_IP}
 
 Verify that the operational topology is clean
     [Documentation]    This request will verify the operational toplogy after the mininet is cleaned.
     [Tags]    Southbound
-    @{list}    Create List    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    s1    s2
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+    @{list} =    BuiltIn.Create List    ${TOOLS_SYSTEM_IP}    ${TOOLS_SYSTEM_2_IP}    s1    s2
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}    pretty_print_json=True
 
 Check For Bug 4756
     [Documentation]    bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
     ...    case executed.
-    Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
-    [Teardown]    Report_Failure_Due_To_Bug    4756
+    Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    4756
 
 Check For Bug 4794
     [Documentation]    bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
     ...    case executed.
-    Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
-    [Teardown]    Report_Failure_Due_To_Bug    4794
+    Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
+    [Teardown]    Utils.Report_Failure_Due_To_Bug    4794
 
 *** Keywords ***
-Vxlan Extension Test Suite Setup
-    [Documentation]    Initialize SetupUtils, create session.
-    SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
-
-Vxlan Extension Test Suite Teardown
+Suite Teardown
     [Documentation]    Cleans up test environment, close existing sessions.
-    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
-    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_2_IP}
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Delete All Sessions
+    OVSDB.Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
+    OVSDB.Clean OVSDB Test Environment    ${TOOLS_SYSTEM_2_IP}
+    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Config And Operational Topology
+    RequestsLibrary.Delete All Sessions
index 4b73bc707e2f7b2be5abfc869107468b48a916f7..d234577203361bf93c5abe2b0cbe2495448b91b5 100644 (file)
@@ -6,24 +6,25 @@ Documentation     Collection of test cases to validate OVSDB projects bugs.
 ...               suite. Also it was suggested that using bug ids for test case names was not ideal
 ...               this to-do is written in case it's decided to refactor all of these test cases out
 ...               of this suite and/or to rename the test cases at a later time.
-Suite Setup       OVSDB Connection Manager Suite Setup
-Suite Teardown    OVSDB Connection Manager Suite Teardown
-Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+Suite Setup       Suite Setup
+Suite Teardown    Suite Teardown
+Test Setup        Test Setup
+Test Teardown     Test Teardown
 Force Tags        Southbound
 Library           OperatingSystem
-Library           String
 Library           RequestsLibrary
-Variables         ../../../variables/Variables.py
-Resource          ../../../libraries/Utils.robot
+Library           String
+Resource          ../../../libraries/KarafKeywords.robot
+Resource          ../../../libraries/OVSDB.robot
 Resource          ../../../libraries/SetupUtils.robot
+Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/WaitForFailure.robot
-Resource          ../../../libraries/OVSDB.robot
+Resource          ../../../variables/Variables.robot
 
 *** Variables ***
-${OVSDB_PORT}     6634
-${BRIDGE}         ovsdb-csit-bug-validation
-${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
-${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
+${BRIDGE}         ovsbug_br
+${OVSDB_UUID}     ${EMPTY}
+${OVSDB_UUID2}    ${EMPTY}
 
 *** Test Cases ***
 Bug 7414 Same Endpoint Name
@@ -32,32 +33,28 @@ Bug 7414 Same Endpoint Name
     ...    If the bug happens, the request would be accepted, but internally the two creations are seen as the
     ...    same and there is a conflict such that neither ovs will receive the port create.
     [Tags]    7414
-    [Setup]    Run Keywords    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
-    ...    AND    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_2_IP}
+    ${bridge} =    BuiltIn.Set Variable    ovsbug_br_7414
     # connect two ovs
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected    ${TOOLS_SYSTEM_IP}
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected    ${TOOLS_SYSTEM_2_IP}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected    ${TOOLS_SYSTEM_IP}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected    ${TOOLS_SYSTEM_2_IP}
     # add brtest to both
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${BRIDGE}
-    Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl add-br ${BRIDGE}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${bridge}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl add-br ${bridge}
     # send one rest request to create a TP endpoint on each ovs (same name)
-    ${body}=    Modify Multi Port Body    vtep1    vtep1
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}    data=${body}
-    Log    ${resp.content}
+    ${body} =    OVSDB.Modify Multi Port Body    vtep1    vtep1    ${bridge}
     # check that each ovs has the correct endpoint
-    ${ovs_1_output}=    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
-    Log    ${ovs_1_output}
-    ${ovs_2_output}=    Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl show
-    Log    ${ovs_2_output}
-    Should Contain    ${ovs_1_output}    local_ip="${TOOLS_SYSTEM_IP}", remote_ip="${TOOLS_SYSTEM_2_IP}"
-    Should Not Contain    ${ovs_1_output}    local_ip="${TOOLS_SYSTEM_2_IP}", remote_ip="${TOOLS_SYSTEM_IP}"
-    Should Contain    ${ovs_2_output}    local_ip="${TOOLS_SYSTEM_2_IP}", remote_ip="${TOOLS_SYSTEM_IP}"
-    Should Not Contain    ${ovs_2_output}    local_ip="${TOOLS_SYSTEM_IP}", remote_ip="${TOOLS_SYSTEM_2_IP}"
-    [Teardown]    Run Keywords    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}    data=${body}
-    ...    AND    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
-    ...    AND    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_2_IP}
+    ${ovs_1_output} =    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
+    BuiltIn.Log    ${ovs_1_output}
+    ${ovs_2_output} =    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl show
+    BuiltIn.Log    ${ovs_2_output}
+    BuiltIn.Should Contain    ${ovs_1_output}    local_ip="${TOOLS_SYSTEM_IP}", remote_ip="${TOOLS_SYSTEM_2_IP}"
+    BuiltIn.Should Not Contain    ${ovs_1_output}    local_ip="${TOOLS_SYSTEM_2_IP}", remote_ip="${TOOLS_SYSTEM_IP}"
+    BuiltIn.Should Contain    ${ovs_2_output}    local_ip="${TOOLS_SYSTEM_2_IP}", remote_ip="${TOOLS_SYSTEM_IP}"
+    BuiltIn.Should Not Contain    ${ovs_2_output}    local_ip="${TOOLS_SYSTEM_IP}", remote_ip="${TOOLS_SYSTEM_2_IP}"
+    [Teardown]    BuiltIn.Run Keywords    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}    data=${body}
+    ...    AND    Test Teardown
 
 Bug 7414 Different Endpoint Name
     [Documentation]    This test case is supplemental to the other test case for bug 7414. Even when the other
@@ -68,53 +65,51 @@ Bug 7414 Different Endpoint Name
     ...    case where the other test case were to fail this would also help understand if this symptom is still
     ...    happening
     [Tags]    7414
-    [Setup]    Clean OVSDB Test Environment
+    ${bridge} =    BuiltIn.Set Variable    ovsbug_br_7414
     # connect two ovs
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected    ${TOOLS_SYSTEM_IP}
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected    ${TOOLS_SYSTEM_2_IP}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected    ${TOOLS_SYSTEM_IP}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected    ${TOOLS_SYSTEM_2_IP}
     # add brtest to both
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${BRIDGE}
-    Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl add-br ${BRIDGE}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${bridge}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl add-br ${bridge}
     # send one rest request to create a TP endpoint on each ovs (different name)
-    ${body}=    Modify Multi Port Body    vtep1    vtep2
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}    data=${body}
-    Log    ${resp.content}
+    ${body} =    OVSDB.Modify Multi Port Body    vtep1    vtep2    ${bridge}
     # check that each ovs has the correct endpoint
-    ${ovs_1_output}=    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
-    Log    ${ovs_1_output}
-    ${ovs_2_output}=    Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl show
-    Log    ${ovs_2_output}
-    Should Contain    ${ovs_1_output}    local_ip="${TOOLS_SYSTEM_IP}", remote_ip="${TOOLS_SYSTEM_2_IP}"
-    Should Not Contain    ${ovs_1_output}    local_ip="${TOOLS_SYSTEM_2_IP}", remote_ip="${TOOLS_SYSTEM_IP}"
-    Should Contain    ${ovs_2_output}    local_ip="${TOOLS_SYSTEM_2_IP}", remote_ip="${TOOLS_SYSTEM_IP}"
-    Should Not Contain    ${ovs_2_output}    local_ip="${TOOLS_SYSTEM_IP}", remote_ip="${TOOLS_SYSTEM_2_IP}"
-    [Teardown]    Run Keywords    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}    data=${body}
-    ...    AND    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
-    ...    AND    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_2_IP}
+    ${ovs_1_output} =    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
+    BuiltIn.Log    ${ovs_1_output}
+    ${ovs_2_output} =    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_2_IP}    sudo ovs-vsctl show
+    BuiltIn.Log    ${ovs_2_output}
+    BuiltIn.Should Contain    ${ovs_1_output}    local_ip="${TOOLS_SYSTEM_IP}", remote_ip="${TOOLS_SYSTEM_2_IP}"
+    BuiltIn.Should Not Contain    ${ovs_1_output}    local_ip="${TOOLS_SYSTEM_2_IP}", remote_ip="${TOOLS_SYSTEM_IP}"
+    BuiltIn.Should Contain    ${ovs_2_output}    local_ip="${TOOLS_SYSTEM_2_IP}", remote_ip="${TOOLS_SYSTEM_IP}"
+    BuiltIn.Should Not Contain    ${ovs_2_output}    local_ip="${TOOLS_SYSTEM_IP}", remote_ip="${TOOLS_SYSTEM_2_IP}"
+    [Teardown]    BuiltIn.Run Keywords    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}    data=${body}
+    ...    AND    Test Teardown
 
 Bug 5221
     [Documentation]    In the case that an ovs node is rebooted, or the ovs service is
     ...    otherwise restarted, a controller initiated connection should reconnect when
     ...    the ovs is ready and available.
-    [Setup]    Clean OVSDB Test Environment
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_PORT}
-    Connect Controller To OVSDB Node
-    @{list}    Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
-    Create Bridge    ${TOOLS_SYSTEM_IP}:6634    ${BRIDGE}
-    @{list}    Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}/bridge/${BRIDGE}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo /usr/share/openvswitch/scripts/ovs-ctl stop
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo /usr/share/openvswitch/scripts/ovs-ctl start
+    [Tags]    5221
+    ${bridge} =    BuiltIn.Set Variable    ovsbug_br_5221
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
+    OVSDB.Connect To OVSDB Node    ${TOOLS_SYSTEM_IP}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected
+    @{list} =    BuiltIn.Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
+    OVSDB.Add Bridge To Ovsdb Node    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${TOOLS_SYSTEM_IP}    ${bridge}    0000000000005221
+    @{list} =    BuiltIn.Create List    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}/bridge/${bridge}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo /usr/share/openvswitch/scripts/ovs-ctl stop
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo /usr/share/openvswitch/scripts/ovs-ctl start
     # Depending on when the retry timers are firing, it may take some 10s of seconds to reconnect, so setting to 30 to cover that.
-    Wait Until Keyword Succeeds    30s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
-    [Teardown]    Run Keywords    Clean OVSDB Test Environment
-    ...    AND    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:6634%2Fbridge%2F${BRIDGE}
+    BuiltIn.Wait Until Keyword Succeeds    30s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
+    [Teardown]    BuiltIn.Run Keywords    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:6634%2Fbridge%2F${bridge}
     ...    AND    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:6634
-    ...    AND    Report_Failure_Due_To_Bug    5221
+    ...    AND    Test Teardown
 
 Bug 5177
     [Documentation]    This test case will recreate the bug using the same basic steps as
@@ -122,38 +117,42 @@ Bug 5177
     ...    1) create bridge in config using the UUID determined in Suite Setup
     ...    2) connect ovs (vsctl set-manager)
     ...    3) Fail if node is not discovered in Operational Store
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected
-    ${ovsdb_uuid}=    Get OVSDB UUID    ${TOOLS_SYSTEM_IP}
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
-    # Suite teardown wants this ${ovsdb_uuid} variable for it's best effort cleanup, so making it visible at suite level.
-    Set Suite Variable    ${ovsdb_uuid}
-    ${node}    Set Variable    uuid/${ovsdb_uuid}
-    Create Bridge    ${node}    ${BRIDGE}
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
-    Should Contain    ${resp.content}    ${node}/bridge/${BRIDGE}
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    @{list}    Create List    ${BRIDGE}
-    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
-    [Teardown]    Run Keywords    Clean OVSDB Test Environment
-    ...    AND    Report_Failure_Due_To_Bug    5177
+    [Tags]    5177
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected
+    ${OVSDB_UUID} =    Get OVSDB UUID    ${TOOLS_SYSTEM_IP}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
+    # Suite teardown wants this ${OVSDB_UUID} variable for it's best effort cleanup, so making it visible at suite level.
+    BuiltIn.Set Suite Variable    ${OVSDB_UUID}
+    ${node} =    BuiltIn.Set Variable    uuid/${OVSDB_UUID}
+    OVSDB.Add Bridge To Ovsdb Node    ${node}    ${TOOLS_SYSTEM_IP}    ${BRIDGE}    0000000000005177
+    ${resp} =    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
+    OVSDB.Log Request    ${resp.content}
+    BuiltIn.Should Be Equal As Strings    ${resp.status_code}    200
+    BuiltIn.Should Contain    ${resp.content}    ${node}/bridge/${BRIDGE}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    @{list} =    BuiltIn.Create List    ${BRIDGE}
+    BuiltIn.Wait Until Keyword Succeeds    8s    2s    Utils.Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}    pretty_print_json=True
+    # Do not cleanup as the next test requires the steps done in this test
+    [Teardown]    BuiltIn.Run Keywords    Utils.Report_Failure_Due_To_Bug    5177
+    ...    AND    OVSDB.Log Config And Operational Topology
 
 Bug 4794
     [Documentation]    This test is dependent on the work done in the Bug 5177 test case so should
     ...    always be executed immediately after.
     ...    1) delete bridge in config
     ...    2) Poll and Fail if exception is seen in karaf.log
-    ${node}    Set Variable    ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}%2Fbridge%2F${BRIDGE}
-    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
+    [Tags]    4794
+    [Setup]    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+    ${node_id} =    BuiltIn.Set Variable    uuid%2F${OVSDB_UUID}
+    Delete Bridge From Ovsdb Node    ${node_id}    ${BRIDGE}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
     # If the exception is seen in karaf.log within 10s, the following line will FAIL, which is the point.
-    Verify_Keyword_Does_Not_Fail_Within_Timeout    10s    1s    Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
+    Verify_Keyword_Does_Not_Fail_Within_Timeout    10s    1s    Utils.Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
     # TODO: Bug 5178
-    [Teardown]    Run Keywords    Clean OVSDB Test Environment
-    ...    AND    Report_Failure_Due_To_Bug    4794
+    [Teardown]    BuiltIn.Run Keywords    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}${node_id}%2Fbridge%2F${BRIDGE}
+    ...    AND    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}${node_id}
+    ...    AND    Test Teardown
 
 Bug 8280
     [Documentation]    Any config created for a bridge (e.g. added ports) should be reconciled when a bridge is
@@ -162,150 +161,94 @@ Bug 8280
     ...    will be manually removed. The bridge will be reconnected and the 2nd port should be re-added to the
     ...    bridge. If not, then bug 8280 will be found and the test case will fail
     [Tags]    8280
-    [Setup]    Run Keywords    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    ...    AND    Clean OVSDB Test Environment
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected    ${TOOLS_SYSTEM_IP}
-    ${ovs_uuid}=    Get OVSDB UUID    ${TOOLS_SYSTEM_IP}
-    Create Bridge    uuid/${ovs_uuid}    ${BRIDGE}
-    Add Termination Point    uuid%2F${ovs_uuid}    ${BRIDGE}    port1
-    Add Termination Point    uuid%2F${ovs_uuid}    ${BRIDGE}    port2
-    ${config_store_elements}    Create List    ${BRIDGE}    port1    port2
-    Check For Elements At URI    ${CONFIG_TOPO_API}    ${config_store_elements}
-    ${ovs_output}=    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
-    Log    ${ovs_output}
-    ${ovs_output}=    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
-    ${ovs_output}=    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-port ${BRIDGE} port2
-    Verify Ovs-vsctl Output    show    Port "port2"    ${TOOLS_SYSTEM_IP}    False
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected    ${TOOLS_SYSTEM_IP}
-    Check For Elements At URI    ${CONFIG_TOPO_API}    ${config_store_elements}
-    Wait Until Keyword Succeeds    5s    1s    Verify Ovs-vsctl Output    show    Port "port2"
-    [Teardown]    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovs_uuid}%2Fbridge%2F${BRIDGE}
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected    ${TOOLS_SYSTEM_IP}
+    ${OVSDB_UUID2} =    Get OVSDB UUID    ${TOOLS_SYSTEM_IP}
+    BuiltIn.Set Suite Variable    ${OVSDB_UUID2}
+    OVSDB.Add Bridge To Ovsdb Node    uuid/${OVSDB_UUID2}    ${TOOLS_SYSTEM_IP}    ${BRIDGE}    0000000000008280
+    OVSDB.Add Termination Point    uuid/${OVSDB_UUID2}    ${BRIDGE}    port1
+    OVSDB.Add Termination Point    uuid/${OVSDB_UUID2}    ${BRIDGE}    port2
+    ${config_store_elements} =    BuiltIn.Create List    ${BRIDGE}    port1    port2
+    Utils.Check For Elements At URI    ${CONFIG_TOPO_API}    ${config_store_elements}    pretty_print_json=True
+    ${ovs_output} =    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl show
+    BuiltIn.Log    ${ovs_output}
+    ${ovs_output} =    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
+    ${ovs_output} =    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-port ${BRIDGE} port2
+    OVSDB.Verify Ovs-vsctl Output    show    Port "port2"    ${TOOLS_SYSTEM_IP}    False
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected    ${TOOLS_SYSTEM_IP}
+    Utils.Check For Elements At URI    ${CONFIG_TOPO_API}    ${config_store_elements}    pretty_print_json=True
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    Verify Ovs-vsctl Output    show    Port "port2"
+    [Teardown]    BuiltIn.Run Keywords    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}uuid%2F${OVSDB_UUID2}%2Fbridge%2F${BRIDGE}
+    ...    AND    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}uuid%2F${OVSDB_UUID2}
+    ...    AND    Test Teardown
 
 Bug 7160
     [Documentation]    If this bug is reproduced, it's possible that the operational store will be
     ...    stuck with leftover nodes and further system tests could fail. It's advised to run this
     ...    test last if possible. See the bug description for high level steps to reproduce
     ...    https://bugs.opendaylight.org/show_bug.cgi?id=7160#c0
-    [Setup]    Run Keywords    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-    ...    AND    Clean OVSDB Test Environment
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_PORT}
-    Connect Controller To OVSDB Node
-    ${QOS}=    Set Variable    QOS-1
-    ${QUEUE}=    Set Variable    QUEUE-1
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_node.json
-    ${sample1}    Replace String    ${sample}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
-    ${resp}    RequestsLibrary.Post Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1    data=${body}
-    Log Config And Operational Topology
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_qos.json
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/    data=${body}
-    Log Config And Operational Topology
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_queue.json
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:queues/${QUEUE}/    data=${body}
-    Log Config And Operational Topology
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/bug_7160/create_qoslinkedqueue.json
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1    data=${body}
-    Log Config And Operational Topology
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/queue-list/0/
-    Log Config And Operational Topology
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${QOS}/
-    Log Config And Operational Topology
-    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:queues/${QUEUE}/
-    Log Config And Operational Topology
+    [Tags]    7160
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
+    OVSDB.Connect To OVSDB Node    ${TOOLS_SYSTEM_IP}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected
+    ${qos} =    BuiltIn.Set Variable    QOS-1
+    ${queue} =    BuiltIn.Set Variable    QUEUE-1
+    OVSDB.Create Ovsdb Node    ${TOOLS_SYSTEM_IP}
+    OVSDB.Log Config And Operational Topology
+    OVSDB.Create Qos    ${qos}
+    OVSDB.Log Config And Operational Topology
+    OVSDB.Create Qos Linked Queue
+    OVSDB.Log Config And Operational Topology
+    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${qos}/queue-list/0/
+    OVSDB.Log Config And Operational Topology
+    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:qos-entries/${qos}/
+    OVSDB.Log Config And Operational Topology
+    ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1/ovsdb:queues/${queue}/
+    OVSDB.Log Config And Operational Topology
     ${resp}    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1
-    Log Config And Operational Topology
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
-    ${node}    Set Variable    ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
+    OVSDB.Log Config And Operational Topology
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
+    ${node}    BuiltIn.Set Variable    ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
     RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}
-    Log Config And Operational Topology
-    Wait Until Keyword Succeeds    5s    1s    Config and Operational Topology Should Be Empty
-    [Teardown]    Run Keywords    Clean OVSDB Test Environment
-    ...    AND    Report_Failure_Due_To_Bug    7160
+    OVSDB.Log Config And Operational Topology
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Config and Operational Topology Should Be Empty
 
 *** Keywords ***
-OVSDB Connection Manager Suite Setup
+Suite Setup
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
-    Open Controller Karaf Console On Background
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
-    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected
-    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
+    KarafKeywords.Open Controller Karaf Console On Background
+    RequestsLibrary.Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+    Clean All Ovs Nodes
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
+    BuiltIn.Wait Until Keyword Succeeds    5s    1s    OVSDB.Verify OVS Reports Connected
+    Utils.Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
+    OVSDB.Log Config And Operational Topology
 
-OVSDB Connection Manager Suite Teardown
+Suite Teardown
     [Documentation]    Cleans up test environment, close existing sessions.
-    Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
+    Clean All Ovs Nodes
     # Best effort to clean config store, by deleting all the types of nodes that are used in this suite
-    ${node}    Set Variable    ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}
+    ${node} =    BuiltIn.Set Variable    ovsdb:%2F%2Fuuid%2F${OVSDB_UUID}
+    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}%2Fbridge%2F${BRIDGE}
     RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}
+    ${node} =    BuiltIn.Set Variable    ovsdb:%2F%2Fuuid%2F${OVSDB_UUID2}
     RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}%2Fbridge%2F${BRIDGE}
-    ${node}    Set Variable    ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
     RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}
+    ${node} =    BuiltIn.Set Variable    ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
     RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}%2Fbridge%2F${BRIDGE}
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
+    RequestsLibrary.Delete Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/${node}
+    OVSDB.Log Config And Operational Topology
     Delete All Sessions
-    # TODO: both Create Bridge and Connect Controller To OVSDB Node keywords below should be moved to a library
-    #    and all the suites using this kind of work can move to using the library instead of
-    #    doing all this work each time.
-
-Create Bridge
-    [Arguments]    ${node_string}    ${bridge}
-    [Documentation]    This will create bridge on the specified OVSDB node.
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/create_bridge.json
-    ${body}    Replace String    ${body}    ovsdb://127.0.0.1:61644    ovsdb://${node_string}
-    ${body}    Replace String    ${body}    tcp:127.0.0.1:6633    tcp:${ODL_SYSTEM_IP}:6633
-    ${body}    Replace String    ${body}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${body}    Replace String    ${body}    br01    ${bridge}
-    ${body}    Replace String    ${body}    61644    ${OVSDB_PORT}
-    ${node_string}    Replace String    ${node_string}    /    %2F
-    ${uri}=    Set Variable    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${node_string}%2Fbridge%2F${bridge}
-    Log    URL is ${uri}
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${uri}    data=${body}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-
-Connect Controller To OVSDB Node
-    [Documentation]    Initiate the connection to OVSDB node from controller
-    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
-    ${sample1}    Replace String    ${sample}    127.0.0.1    ${TOOLS_SYSTEM_IP}
-    ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
-    Log    data: ${body}
-    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}    data=${body}
-    Log    ${resp.content}
-    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    Wait Until Keyword Succeeds    5s    1s    Verify OVS Reports Connected
 
-Log Config And Operational Topology
-    [Documentation]    For debugging purposes, this will log both config and operational topo data stores
-    ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    Log    ${resp.content}
-    ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
-    Log    ${resp.content}
+Test Setup
+    SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 
-Config and Operational Topology Should Be Empty
-    [Documentation]    This will check that only the expected output is there for both operational and config
-    ...    topology data stores. Empty probably means that only ovsdb:1 is there.
-    ${config_resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
-    ${operational_resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_TOPO_API}
-    Should Contain    ${config_resp.content}    {"topology-id":"ovsdb:1"}
-    Should Contain    ${operational_resp.content}    {"topology-id":"ovsdb:1"}
+Test Teardown
+    Clean All Ovs Nodes
+    OVSDB.Log Config And Operational Topology
+    Utils.Report_Failure_Due_To_Bug    ${TEST_TAGS}
 
-Modify Multi Port Body
-    [Arguments]    ${ovs_1_port_name}    ${ovs_2_port_name}
-    [Documentation]    these steps are needed multiple times in bug reproductions above.
-    ${body}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/bug_7414/create_multiple_ports.json
-    ${ovs_1_ovsdb_uuid}=    Get OVSDB UUID    ${TOOLS_SYSTEM_IP}
-    ${ovs_2_ovsdb_uuid}=    Get OVSDB UUID    ${TOOLS_SYSTEM_2_IP}
-    ${body}    Replace String    ${body}    OVS_1_UUID    ${ovs_1_ovsdb_uuid}
-    ${body}    Replace String    ${body}    OVS_2_UUID    ${ovs_2_ovsdb_uuid}
-    ${body}    Replace String    ${body}    OVS_1_BRIDGE_NAME    ${BRIDGE}
-    ${body}    Replace String    ${body}    OVS_2_BRIDGE_NAME    ${BRIDGE}
-    ${body}    Replace String    ${body}    OVS_1_IP    ${TOOLS_SYSTEM_IP}
-    ${body}    Replace String    ${body}    OVS_2_IP    ${TOOLS_SYSTEM_2_IP}
-    ${body}    Replace String    ${body}    OVS_1_PORT_NAME    ${ovs_1_port_name}
-    ${body}    Replace String    ${body}    OVS_2_PORT_NAME    ${ovs_2_port_name}
-    Log    ${body}
-    [Return]    ${body}
+Clean All Ovs Nodes
+    OVSDB.Clean OVSDB Test Environment    ${TOOLS_SYSTEM_IP}
+    OVSDB.Clean OVSDB Test Environment    ${TOOLS_SYSTEM_2_IP}