Ignore failure on trace:transactions w/ karaf cli
[integration/test.git] / csit / libraries / OpenStackOperations.robot
index 368e0596aeee9b91ae5c09922fdc3cefe44664bd..2a66bc1762adaea3ef4c96317c8bda7ddfe9d798 100644 (file)
@@ -20,6 +20,10 @@ Resource          ../variables/Variables.robot
 Resource          ../variables/netvirt/Variables.robot
 Variables         ../variables/netvirt/Modules.py
 
 Resource          ../variables/netvirt/Variables.robot
 Variables         ../variables/netvirt/Modules.py
 
+*** Variables ***
+@{VALIDATION_KEYWORDS}    Verify Services    Verify Expected Default Tunnels    Verify Expected Default Tables On Nodes
+${VALIDATION_FILE}    /tmp/validations.txt
+
 *** Keywords ***
 Get Tenant ID From Security Group
     [Documentation]    Returns tenant ID by reading it from existing default security-group.
 *** Keywords ***
 Get Tenant ID From Security Group
     [Documentation]    Returns tenant ID by reading it from existing default security-group.
@@ -639,7 +643,7 @@ Get Test Teardown Debugs
     BuiltIn.Run Keyword And Ignore Error    DataModels.Get Model Dump    ${HA_PROXY_IP}    ${netvirt_data_models}
     KarafKeywords.Fail If Exceptions Found During Test    ${test_name}    fail=${fail}
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
     BuiltIn.Run Keyword And Ignore Error    DataModels.Get Model Dump    ${HA_PROXY_IP}    ${netvirt_data_models}
     KarafKeywords.Fail If Exceptions Found During Test    ${test_name}    fail=${fail}
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
-    \    Issue_Command_On_Karaf_Console    trace:transactions    ${ODL_SYSTEM_${i+1}_IP}
+    \    BuiltIn.Run Keyword And Ignore Error    Issue_Command_On_Karaf_Console    trace:transactions    ${ODL_SYSTEM_${i+1}_IP}
 
 Get Suite Debugs
     Get Test Teardown Debugs    test_name=${SUITE_NAME}    fail=False
 
 Get Suite Debugs
     Get Test Teardown Debugs    test_name=${SUITE_NAME}    fail=False
@@ -1115,8 +1119,7 @@ OpenStack Suite Setup
     BuiltIn.Set Suite Variable    @{tcpdump_port_6653_conn_ids}
     BuiltIn.Run Keyword If    "${PRE_CLEAN_OPENSTACK_ALL}"=="True"    OpenStack Cleanup All
     OpenStackOperations.Add OVS Logging On All OpenStack Nodes
     BuiltIn.Set Suite Variable    @{tcpdump_port_6653_conn_ids}
     BuiltIn.Run Keyword If    "${PRE_CLEAN_OPENSTACK_ALL}"=="True"    OpenStack Cleanup All
     OpenStackOperations.Add OVS Logging On All OpenStack Nodes
-    Run_Keyword_If_At_Least_Oxygen    Wait Until Keyword Succeeds    60    2    ClusterManagement.Check Status Of Services Is OPERATIONAL    @{NETVIRT_DIAG_SERVICES}
-    Verify Expected Default Tables On Nodes
+    Validate Deployment
 
 OpenStack Suite Teardown
     [Documentation]    Wrapper teardown keyword that can be used in any suite running in an openstack environement
 
 OpenStack Suite Teardown
     [Documentation]    Wrapper teardown keyword that can be used in any suite running in an openstack environement
@@ -1132,6 +1135,23 @@ OpenStack Suite Teardown
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
     \    KarafKeywords.Issue Command On Karaf Console    threads --list | wc -l    ${ODL_SYSTEM_${i+1}_IP}
 
     : FOR    ${i}    IN RANGE    ${NUM_ODL_SYSTEM}
     \    KarafKeywords.Issue Command On Karaf Console    threads --list | wc -l    ${ODL_SYSTEM_${i+1}_IP}
 
+Validate Deployment
+    [Documentation]    Validate the deployment. Examples to validate are verifying default table
+    ...    flows are installed and that the tunnel mesh has been built correctly.
+    Write To Validate File    ----------------------------------------\n${SUITE_NAME}\n
+    : FOR    ${keyword}    IN    @{VALIDATION_KEYWORDS}
+    \    ${status} =    Builtin.Run Keyword And Return Status    ${keyword}
+    \    BuiltIn.Run Keyword If    "${status}" == "FAIL"    BuiltIn.Run Keywords    Write To Validate File    Failed: ${keyword}
+    \    ...    AND    BuiltIn.Fail
+    \    ...    ELSE    Write To Validate File    Passed: ${keyword}
+
+Write To Validate File
+    [Arguments]    ${msg}
+    [Documentation]    Write the given ${msg} to ${VALIDATION_FILE}. Create the file if not present.
+    ${status} =    BuiltIn.Run Keyword And Return Status    OperatingSystem.File Should Exist    ${VALIDATION_FILE}
+    BuiltIn.Run Keyword If    "${status}" == "False"    OperatingSystem.Create File    ${VALIDATION_FILE}
+    OperatingSystem.Append To File    ${VALIDATION_FILE}    ${msg}\n
+
 Copy DHCP Files From Control Node
     [Documentation]    Copy the current DHCP files to the robot vm. The keyword must be called
     ...    after the subnet(s) are created and before the subnet(s) are deleted.
 Copy DHCP Files From Control Node
     [Documentation]    Copy the current DHCP files to the robot vm. The keyword must be called
     ...    after the subnet(s) are created and before the subnet(s) are deleted.
@@ -1214,6 +1234,15 @@ Get Network Segmentation Id
     @{list} =    String.Split String    ${output}
     [Return]    @{list}[0]
 
     @{list} =    String.Split String    ${output}
     [Return]    @{list}[0]
 
+Verify Services
+    [Documentation]    Verify if the services are operational
+    Wait Until Keyword Succeeds    60    2    ClusterManagement.Check Status Of Services Is OPERATIONAL    @{NETVIRT_DIAG_SERVICES}
+
+Verify Expected Default Tunnels
+    [Documentation]    Verify if the default tunnels are created
+    ${output} =    ODLTools.Analyze Tunnels    test_name=${SUITE_NAME}.Suite Setup
+    BuiltIn.Should Contain    ${output}    All tunnels are up
+
 Verify Expected Default Tables On Nodes
     [Arguments]    ${node_ips}=@{OS_ALL_IPS}
     [Documentation]    Verify if Default Table Entries are programmed on all Nodes
 Verify Expected Default Tables On Nodes
     [Arguments]    ${node_ips}=@{OS_ALL_IPS}
     [Documentation]    Verify if Default Table Entries are programmed on all Nodes