Adding testcases for Qos and Queue Create/Read/Delete --passivemode
[integration/test.git] / csit / suites / ovsdb / Southbound_Domain / 010__configure_1_ovsdb_node.robot
index 26ca2d65c5e9bf20b9e22015b0537110d7a796f3..198c1761f529316861cc8660f1a1bff1385e39e8 100644 (file)
@@ -7,7 +7,7 @@ Force Tags        Southbound
 Library           OperatingSystem
 Library           String
 Library           RequestsLibrary
-Variables         ../../../variables/Variables.py
+Variables         ../../../variables/Variables.robot
 Resource          ../../../libraries/SetupUtils.robot
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/OVSDB.robot
@@ -15,6 +15,8 @@ Resource          ../../../libraries/OVSDB.robot
 *** Variables ***
 ${OVSDB_PORT}     6634
 ${BRIDGE}         ovsdb-csit-test-bridge
+${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}
@@ -143,6 +145,95 @@ Get Config Topology After Reconnect
     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}
 
+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}
+
+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}
+
+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}
+
+Create a QOS and a Linked queue entry to a OVSDB Node
+    [Documentation]    This request will create a QOS and a Linked 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
+    Log    data: ${body}
+    ${resp}    RequestsLibrary.Put Request    session    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:HOST1    data=${body}
+    Log    ${resp.content}
+    Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
+
+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}
+
+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}
+
+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}
+
+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}
+
+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}
+
+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}
+
+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}
+
+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}
+
+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
+
 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.