refactoring Bug suite
[integration/test.git] / csit / suites / ovsdb / Southbound_Domain / Bug_Validation.robot
similarity index 74%
rename from csit/suites/ovsdb/Southbound_Domain/Bug_4794.robot
rename to csit/suites/ovsdb/Southbound_Domain/Bug_Validation.robot
index af2eaf5fdd4b5062ae11a0df0ab5a1d7a85dbda7..153706521e0604163e6d36f44053c2fd34bdd046 100644 (file)
@@ -1,5 +1,7 @@
 *** Settings ***
-Documentation     Suite to test bug 4794 https://bugs.opendaylight.org/show_bug.cgi?id=4794
+Documentation     Collection of test cases to validate OVSDB projects bugs.
+...               -  https://bugs.opendaylight.org/show_bug.cgi?id=4794
+...               -  https://bugs.opendaylight.org/show_bug.cgi?id=5177
 Suite Setup       OVSDB Connection Manager Suite Setup
 Suite Teardown    OVSDB Connection Manager Suite Teardown
 Test Setup        Log Testcase Start To Controller Karaf
@@ -9,22 +11,22 @@ Library           String
 Library           RequestsLibrary
 Variables         ../../../variables/Variables.py
 Resource          ../../../libraries/Utils.robot
+Resource          ../../../libraries/WaitForFailure.robot
 Resource          ../../../libraries/OVSDB.robot
 
 *** Variables ***
 ${OVSDB_PORT}     6634
-${BRIDGE}         ovsdb-csit-test-4794
+${BRIDGE}         ovsdb-csit-test-5177
 ${SOUTHBOUND_CONFIG_API}    ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
 ${OVSDB_CONFIG_DIR}    ${CURDIR}/../../../variables/ovsdb
 
 *** Test Cases ***
-Bug 4794
+Bug 5177
     [Documentation]    This test case will recreate the bug using the same basic steps as
     ...    provided in the bug, and noted here:
-    ...    1) create bridge in config
+    ...    1) create bridge in config using the UUID determined in Suite Setup
     ...    2) connect ovs (vsctl set-manager)
-    ...    3) delete bridge in config
-    ...    4) disconnect ovs (vsctl del-manager)
+    ...    3) Fail if node is not discovered in Operational Store
     Create Bridge
     ${resp}    RequestsLibrary.Get Request    session    ${CONFIG_TOPO_API}
     Log    ${resp.content}
@@ -32,11 +34,20 @@ Bug 4794
     Should Contain    ${resp.content}    ovsdb://uuid/${ovsdb_uuid}/bridge/${BRIDGE}
     Run Command On Remote System    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
     @{list}    Create List    ${BRIDGE}
-    Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    Wait Until Keyword Succeeds    8s    2s    Check For Elements At URI    ${OPERATIONAL_TOPO_API}/topology/ovsdb:1    ${list}
+    [Teardown]    Report_Failure_Due_To_Bug    5177
+
+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
     ${resp}    RequestsLibrary.Delete Request    session    ${SOUTHBOUND_CONFIG_API}%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
-    Check Karaf Log File Does Not Have Messages    ${ODL_SYSTEM_IP}    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
+    # 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
     [Teardown]    Report_Failure_Due_To_Bug    4794
 
 *** Keywords ***