Search for errors/warnings in karaf log for test teardown 48/49048/17
authorAlon Kochba <alonko@hpe.com>
Tue, 6 Dec 2016 18:01:24 +0000 (20:01 +0200)
committerJamo Luhrsen <jluhrsen@redhat.com>
Wed, 21 Dec 2016 00:29:52 +0000 (00:29 +0000)
Change-Id: I478690ce40abbdb000062fc059623ff9368ccb36
Signed-off-by: Alon Kochba <alonko@hpe.com>
csit/libraries/OpenStackOperations.robot
csit/suites/netvirt/Netvirt_Vpnservice/basic_vpnservice.robot
csit/suites/openstack/clustering/01_l2_tests.robot
csit/suites/openstack/clustering/02_l3_tests.robot
csit/suites/openstack/connectivity/01_l2_tests.robot
csit/suites/openstack/connectivity/02_l3_tests.robot
csit/suites/openstack/connectivity/03_external_network_tests.robot
csit/suites/openstack/tempest/tempest.robot

index c5f329577a5e653814e7fae0b4def7c20dc2bad2..3f02cfa61171653970fb7b2002a515eab8420367 100644 (file)
@@ -1,6 +1,7 @@
 *** Settings ***
 Documentation     Openstack library. This library is useful for tests to create network, subnet, router and vm instances
 Library           SSHLibrary
+Resource          Netvirt.robot
 Resource          Utils.robot
 Variables         ../variables/Variables.py
 
@@ -483,6 +484,20 @@ Get DumpFlows And Ovsconfig
     Write Commands Until Expected Prompt    sudo ovs-ofctl dump-groups br-int -OOpenFlow13    ]>
     Write Commands Until Expected Prompt    sudo ovs-ofctl dump-group-stats br-int -OOpenFlow13    ]>
 
+Get Karaf Log Type From Test Start
+    [Arguments]    ${ip}    ${test_name}    ${type}    ${user}=${ODL_SYSTEM_USER}    ${password}=${ODL_SYSTEM_PASSWORD}    ${prompt}=${ODL_SYSTEM_PROMPT}
+    ...    ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
+    ${cmd}    Set Variable    sed '1,/ROBOT MESSAGE: Starting test ${test_name}/d' ${log_file} | grep '${type}'
+    ${output}    Run Command On Controller    ${ip}    ${cmd}    ${user}    ${password}    ${prompt}
+    Log    ${output}
+
+Get Karaf Log Types From Test Start
+    [Arguments]    ${ip}    ${test_name}    ${types}    ${user}=${ODL_SYSTEM_USER}    ${password}=${ODL_SYSTEM_PASSWORD}    ${prompt}=${ODL_SYSTEM_PROMPT}
+    ...    ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log
+    : FOR    ${type}    IN    @{types}
+    \    Get Karaf Log Type From Test Start    ${ip}    ${test_name}    ${type}    ${user}    ${password}
+    \    ...    ${prompt}    ${log_file}
+
 Get ControlNode Connection
     ${control_conn_id}=    SSHLibrary.Open Connection    ${OS_CONTROL_NODE_IP}    prompt=${DEFAULT_LINUX_PROMPT_STRICT}
     Utils.Flexible SSH Login    ${OS_USER}    ${DEVSTACK_SYSTEM_PASSWORD}
@@ -496,6 +511,13 @@ Get OvsDebugInfo
     Run Keyword If    1 < ${NUM_OS_SYSTEM}    Get DumpFlows And Ovsconfig    ${OS_COMPUTE_1_IP}
     Run Keyword If    2 < ${NUM_OS_SYSTEM}    Get DumpFlows And Ovsconfig    ${OS_COMPUTE_2_IP}
 
+Get Test Teardown Debugs
+    [Arguments]    ${test_name}=${TEST_NAME}
+    Get OvsDebugInfo
+    Get Model Dump    ${ODL_SYSTEM_IP}
+    ${log_types} =    Create List    ERROR    WARN    Exception
+    Get Karaf Log Types From Test Start    ${ODL_SYSTEM_IP}    ${test_name}    ${log_types}
+
 Show Debugs
     [Arguments]    @{vm_indices}
     [Documentation]    Run these commands for debugging, it can list state of VM instances and ip information in control node
index 58822cf70e6970f1babd6c0aab7078b97cd54f67..2ff5a610022b0a9c9a8d8c12b942090961a74724 100644 (file)
@@ -6,7 +6,7 @@ Suite Setup       BuiltIn.Run Keywords    SetupUtils.Setup_Utils_For_Setup_And_T
 ...               AND    DevstackUtils.Devstack Suite Setup
 Suite Teardown    Close All Connections
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     Get OvsDebugInfo
+Test Teardown     Get Test Teardown Debugs
 Library           OperatingSystem
 Library           RequestsLibrary
 Resource          ../../../libraries/Utils.robot
index 5c9b6900ea6e8a10b7567694a419392daae4fb32..a5b8218f350b0be518fe9cf49a023768ce3a6eca 100644 (file)
@@ -3,7 +3,7 @@ Documentation     Test suite to verify packet flows between vm instances.
 Suite Setup       Devstack Suite Setup    source_pwd=yes
 Suite Teardown    Close All Connections
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     Run Keywords    Get OvsDebugInfo
+Test Teardown     Get Test Teardown Debugs
 Library           SSHLibrary
 Library           OperatingSystem
 Library           RequestsLibrary
@@ -124,7 +124,7 @@ Check Vm Instances Have Ip Address
     Append To List    ${NET2_VM_IPS}    ${NET2_DHCP_IP}
     Set Suite Variable    ${NET2_VM_IPS}
     [Teardown]    Run Keywords    Show Debugs    @{NET_1_VM_INSTANCES}    @{NET_2_VM_INSTANCES}
-    ...    AND    Get OvsDebugInfo
+    ...    AND    Get Test Teardown Debugs
 
 Bring Up ODL2
     [Documentation]    Bring up ODL2 again
index a0ad346910f344114c68af0e6dbe4f69b52dc9ec..ea62bfbcfcd4df3585d32ecb76100bc7a3b8a733 100644 (file)
@@ -3,7 +3,7 @@ Documentation     Test suite to check connectivity in L3 using routers.
 Suite Setup       Devstack Suite Setup    source_pwd=yes
 Suite Teardown    Close All Connections
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     Run Keywords    Get OvsDebugInfo
+Test Teardown     Get Test Teardown Debugs
 Library           SSHLibrary
 Library           OperatingSystem
 Library           RequestsLibrary
@@ -87,7 +87,7 @@ Check Vm Instances Have Ip Address
     Set Suite Variable    ${NET2_L3_VM_IPS}
     Set Suite Variable    ${NET2_DHCP_IP}
     [Teardown]    Run Keywords    Show Debugs    @{NET_1_VM_INSTANCES}    @{NET_2_VM_INSTANCES}
-    ...    AND    Get OvsDebugInfo
+    ...    AND    Get Test Teardown Debugs
 
 Bring Up ODL2
     [Documentation]    Bring up ODL2 again
index 484d5d88ce8230e2a486bc38991e2dd8754133d1..fe4e8f806b84f5ac9951cac4b51307e69608931e 100644 (file)
@@ -4,13 +4,11 @@ Suite Setup       BuiltIn.Run Keywords    SetupUtils.Setup_Utils_For_Setup_And_T
 ...               AND    DevstackUtils.Devstack Suite Setup
 Suite Teardown    Close All Connections
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     Run Keywords    Get OvsDebugInfo
-...               AND    Get Model Dump    ${ODL_SYSTEM_IP}
+Test Teardown     Get Test Teardown Debugs
 Library           SSHLibrary
 Library           OperatingSystem
 Library           RequestsLibrary
 Resource          ../../../libraries/DevstackUtils.robot
-Resource          ../../../libraries/Netvirt.robot
 Resource          ../../../libraries/OpenStackOperations.robot
 Resource          ../../../libraries/SetupUtils.robot
 Resource          ../../../libraries/Utils.robot
@@ -76,8 +74,7 @@ Check Vm Instances Have Ip Address
     Append To List    ${NET2_VM_IPS}    ${NET2_DHCP_IP}
     Set Suite Variable    ${NET2_VM_IPS}
     [Teardown]    Run Keywords    Show Debugs    @{NET_1_VM_INSTANCES}    @{NET_2_VM_INSTANCES}
-    ...    AND    Get OvsDebugInfo
-    ...    AND    Get Model Dump    ${ODL_SYSTEM_IP}
+    ...    AND    Get Test Teardown Debugs
 
 Ping Vm Instance1 In l2_network_1
     [Documentation]    Check reachability of vm instances by pinging to them.
@@ -145,8 +142,7 @@ Delete Vm Instances In l2_network_2
     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
     \    Delete Vm Instance    ${VmElement}
     [Teardown]    Run Keywords    Show Debugs    @{NET_1_VM_INSTANCES}    @{NET_2_VM_INSTANCES}
-    ...    AND    Get OvsDebugInfo
-    ...    AND    Get Model Dump    ${ODL_SYSTEM_IP}
+    ...    AND    Get Test Teardown Debugs
 
 Delete Sub Networks In l2_network_1
     [Documentation]    Delete Sub Nets for the Networks with neutron request.
index a6810177ca530fc240bf25032f717ead506ccbdb..9796eea728b054aa84f07d2dc7ac162da4b2b1a6 100644 (file)
@@ -4,13 +4,11 @@ Suite Setup       BuiltIn.Run Keywords    SetupUtils.Setup_Utils_For_Setup_And_T
 ...               AND    DevstackUtils.Devstack Suite Setup
 Suite Teardown    Close All Connections
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     Run Keywords    Get OvsDebugInfo
-...               AND    Get Model Dump    ${ODL_SYSTEM_IP}
+Test Teardown     Get Test Teardown Debugs
 Library           SSHLibrary
 Library           OperatingSystem
 Library           RequestsLibrary
 Resource          ../../../libraries/DevstackUtils.robot
-Resource          ../../../libraries/Netvirt.robot
 Resource          ../../../libraries/OpenStackOperations.robot
 Resource          ../../../libraries/SetupUtils.robot
 Resource          ../../../libraries/Utils.robot
@@ -66,8 +64,7 @@ Check Vm Instances Have Ip Address
     Set Suite Variable    ${NET2_L3_VM_IPS}
     Set Suite Variable    ${NET2_DHCP_IP}
     [Teardown]    Run Keywords    Show Debugs    @{NET_1_VM_INSTANCES}    @{NET_2_VM_INSTANCES}
-    ...    AND    Get OvsDebugInfo
-    ...    AND    Get Model Dump    ${ODL_SYSTEM_IP}
+    ...    AND    Get Test Teardown Debugs
 
 Create Routers
     [Documentation]    Create Router
@@ -148,8 +145,7 @@ Delete Vm Instances In network_2
     : FOR    ${VmElement}    IN    @{NET_2_VM_INSTANCES}
     \    Delete Vm Instance    ${VmElement}
     [Teardown]    Run Keywords    Show Debugs    @{NET_1_VM_INSTANCES}    @{NET_2_VM_INSTANCES}
-    ...    AND    Get OvsDebugInfo
-    ...    AND    Get Model Dump    ${ODL_SYSTEM_IP}
+    ...    AND    Get Test Teardown Debugs
 
 Delete Router Interfaces
     [Documentation]    Remove Interface to the subnets.
index a50aee9ebdf37da910f75e0359152ceeac8251c7..d4194122450b8dc038774262cfea080c0a122e8b 100644 (file)
@@ -2,13 +2,11 @@
 Documentation     Test suite to check North-South connectivity in L3 using a router and an external network
 Suite Setup       Devstack Suite Setup    source_pwd=yes
 Suite Teardown    Close All Connections
-Test Teardown     Run Keywords    Get OvsDebugInfo
-...               AND    Get Model Dump    ${ODL_SYSTEM_IP}
+Test Teardown     Get Test Teardown Debugs
 Library           SSHLibrary
 Library           OperatingSystem
 Library           RequestsLibrary
 Resource          ../../../libraries/DevstackUtils.robot
-Resource          ../../../libraries/Netvirt.robot
 Resource          ../../../libraries/OpenStackOperations.robot
 Resource          ../../../libraries/Utils.robot
 
@@ -74,16 +72,14 @@ Check Vm Instances Have Ip Address
     \    Wait Until Keyword Succeeds    15s    5s    Verify VM Is ACTIVE    ${vm}
     Wait Until Keyword Succeeds    180s    10s    Verify VMs Received DHCP Lease    @{VM_INSTANCES}
     [Teardown]    Run Keywords    Show Debugs    ${VM_INSTANCES}
-    ...    AND    Get OvsDebugInfo
-    ...    AND    Get Model Dump    ${ODL_SYSTEM_IP}
+    ...    AND    Get Test Teardown Debugs
 
 Create And Associate Floating IPs for VMs
     [Documentation]    Create and associate a floating IP for the VM
     ${VM_FLOATING_IPS}    OpenStackOperations.Create And Associate Floating IPs    ${external_net_name}    @{VM_INSTANCES}
     Set Suite Variable    ${VM_FLOATING_IPS}
     [Teardown]    Run Keywords    Show Debugs    ${VM_INSTANCES}
-    ...    AND    Get OvsDebugInfo
-    ...    AND    Get Model Dump    ${ODL_SYSTEM_IP}
+    ...    AND    Get Test Teardown Debugs
 
 Ping External Gateway From Control Node
     [Documentation]    Check reachability of external gateway by pinging it from the control node.
index fe382de85745aeb6eb84906166c4593e8d94d312..809dd6971ec1eccdb804c500d8e093ed9e48c415 100644 (file)
@@ -4,7 +4,7 @@ Documentation     Test suite for running tempest tests. It is assumed that the t
 Suite Setup       Log In To Tempest Executor And Setup Test Environment
 Suite Teardown    Clean Up After Running Tempest
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
-Test Teardown     Get OvsDebugInfo
+Test Teardown     Run Keywords    Get Test Teardown Debugs
 Test Template     DevstackUtils.Run Tempest Tests
 Library           SSHLibrary
 Resource          ../../../libraries/DevstackUtils.robot