Changed the order of the testsuites and added operational check after each operation
[integration/test.git] / test / csit / suites / ovsdb / Southbound_Domain / 010__configure_1_ovsdb_node.robot
similarity index 72%
rename from test/csit/suites/ovsdb/Southbound_Domain/020__configure_1_ovsdb_node.robot
rename to test/csit/suites/ovsdb/Southbound_Domain/010__configure_1_ovsdb_node.robot
index 82b7527565b460aadf7475f5cf96bde4793996be..05cbe1379b5e18029beaed75453b5daa24632ec2 100644 (file)
@@ -9,17 +9,17 @@ Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.txt
 
 *** Variables ***
-${OVSDB_PORT}     6644
+${OVSDB_PORT}     6634
 ${BRIDGE}         br01
 ${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${MININET}:${OVSDB_PORT}
 ${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
-@{node_list}      ovsdb://${MININET}:${OVSDB_PORT}    ${MININET}    ${OVSDB_PORT}    true    br-int
+@{node_list}      ovsdb://${MININET}:${OVSDB_PORT}    ${MININET}    ${OVSDB_PORT}    br-int
 
 *** Test Cases ***
-Make the OVS instacne to listen for connection
+Make the OVS instance to listen for connection
     [Tags]    Southbound
     Run Command On Remote System    ${MININET}    sudo ovs-vsctl del-manager
-    Run Command On Remote System    ${MININET}    sudo ovs-vsctl set-manager ptcp:6644
+    Run Command On Remote System    ${MININET}    sudo ovs-vsctl set-manager ptcp:6634
 
 Connect to OVSDB Node
     [Documentation]    Initiate the connection to OVSDB node from controller
@@ -103,11 +103,13 @@ Get Operational Topology after Deletion of Bridge
     @{list}    Create List    ${BRIDGE}    vxlanport
     Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
 
-Delete the integration Bridge
-    [Documentation]    This request will delete the bridge node from the config data store.
+Get Config Topology with integration Bridge
+    [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
     [Tags]    Southbound
-    ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-int
+    ${resp}    RequestsLibrary.Get    session    ${CONFIG_TOPO_API}
+    Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    Should Contain    ${resp.content}    br-int
 
 Delete the OVSDB Node
     [Documentation]    This request will delete the OVSDB node
@@ -115,6 +117,43 @@ Delete the OVSDB Node
     ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}
     Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
 
+Get Operational Topology to make sure the connection has been deleted
+    [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
+    [Tags]    Southbound
+    @{list}    Create List    ovsdb://${MININET}:${OVSDB_PORT}
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements Not At URI    ${OPERATIONAL_TOPO_API}    ${list}
+
+Reconnect to OVSDB Node
+    [Documentation]    Initiate the connection to OVSDB node from controller
+    [Tags]    Southbound
+    ${sample}    OperatingSystem.Get File    ${OVSDB_CONFIG_DIR}/connect.json
+    ${sample1}    Replace String    ${sample}    127.0.0.1    ${MININET}
+    ${body}    Replace String    ${sample1}    61644    ${OVSDB_PORT}
+    Log    URL is ${SOUTHBOUND_CONFIG_API}
+    ${resp}    RequestsLibrary.Put    session    ${SOUTHBOUND_CONFIG_API}    data=${body}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
+Get Operational Topology with Integration Bridge
+    [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
+    [Tags]    Southbound
+    @{list}    Create List    br-int
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}    ${list}
+
+Get Config Topology after reconnect
+    [Documentation]    This will fetch the configuration topology from configuration data store after reconnect
+    [Tags]    Southbound
+    ${resp}    RequestsLibrary.Get    session    ${CONFIG_TOPO_API}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+    Should Contain    ${resp.content}    br-int
+
+Again Delete the OVSDB Node
+    [Documentation]    This request will delete the OVSDB node
+    [Tags]    Southbound
+    ${resp}    RequestsLibrary.Delete    session    ${SOUTHBOUND_CONFIG_API}
+    Should Be Equal As Strings    ${resp.status_code}    200    Response    status code error
+
 Get Operational Topology after Deletion of OVSDB Node
     [Documentation]    This request will fetch the operational topology after the OVSDB node is deleted
     [Tags]    Southbound