Add additional OVS logs 36/67036/3
authorSam Hague <shague@redhat.com>
Wed, 10 Jan 2018 21:55:16 +0000 (16:55 -0500)
committerSam Hague <shague@redhat.com>
Wed, 10 Jan 2018 23:28:37 +0000 (23:28 +0000)
Change-Id: I3b076102d0ad716d8cf1fa1184563c899ed97abf
Signed-off-by: Sam Hague <shague@redhat.com>
csit/libraries/OVSDB.robot
csit/libraries/OpenStackOperations.robot

index ed520988d92c353d90704cf72e93ab41396c7d92..b347e49fe77e65b9d10c65e8ac27862dcb59fa85 100644 (file)
@@ -199,3 +199,19 @@ Get Default Gateway
     ${gateway} =    Run Command On Remote System    ${ip}    /usr/sbin/route -n | grep '^0.0.0.0' | cut -d " " -f 10
     Log    ${gateway}
     [Return]    ${gateway}
+
+Add OVS Logging
+    [Arguments]    ${conn_id}
+    [Documentation]    Add higher levels of OVS logging
+    SSHLibrary.Switch Connection    ${conn_id}
+    @{modules} =    BuiltIn.Create List    bridge:file:dbg    connmgr:file:dbg    inband:file:dbg    ofp_actions:file:dbg    ofp_errors:file:dbg
+    ...    ofp_msgs:file:dbg    ovsdb_error:file:dbg    rconn:file:dbg    tunnel:file:dbg    vconn:file:dbg
+    : FOR    ${module}    IN    @{modules}
+    \    Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/set ${module}    ${DEFAULT_LINUX_PROMPT_STRICT}
+    Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/list    ${DEFAULT_LINUX_PROMPT_STRICT}
+
+Reset OVS Logging
+    [Arguments]    ${conn_id}
+    [Documentation]    Reset the OVS logging
+    SSHLibrary.Switch Connection    ${conn_id}
+    ${output} =    Write Commands Until Expected Prompt    sudo ovs-appctl --target ovs-vswitchd vlog/set :file:info    ${DEFAULT_LINUX_PROMPT_STRICT}
index 21380901ce8026c683fae3129c6c6ddbc5057006..d079f83ddb50f04e456953ffa3b3c1d0710e0e5a 100644 (file)
@@ -7,6 +7,7 @@ Library           SSHLibrary
 Resource          DataModels.robot
 Resource          DevstackUtils.robot
 Resource          L2GatewayOperations.robot
+Resource          OVSDB.robot
 Resource          SetupUtils.robot
 Resource          SSHKeywords.robot
 Resource          Utils.robot
@@ -1155,6 +1156,7 @@ OpenStack Suite Setup
     [Documentation]    Wrapper teardown keyword that can be used in any suite running in an openstack environement
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     DevstackUtils.Devstack Suite Setup
+    Add OVS Logging On All OpenStack Nodes
 
 OpenStack Suite Teardown
     [Documentation]    Wrapper teardown keyword that can be used in any suite running in an openstack environement
@@ -1179,3 +1181,15 @@ Is Feature Installed
     \    ${status}    ${output}    Run Keyword And Ignore Error    Builtin.Should Contain    ${CONTROLLERFEATURES}    ${feature}
     \    Return From Keyword If    "${status}" == "PASS"    True
     [Return]    False
+
+Add OVS Logging On All OpenStack Nodes
+    [Documentation]    Add higher levels of OVS logging to all the OpenStack nodes
+    Run Keyword If    0 < ${NUM_OS_SYSTEM}    OVSDB.Add OVS Logging    ${OS_CNTL_CONN_ID}
+    Run Keyword If    1 < ${NUM_OS_SYSTEM}    OVSDB.Add OVS Logging    ${OS_CMP1_CONN_ID}
+    Run Keyword If    2 < ${NUM_OS_SYSTEM}    OVSDB.Add OVS Logging    ${OS_CMP2_CONN_ID}
+
+Reset OVS Logging On All OpenStack Nodes
+    [Documentation]    Reset the OVS logging to all the OpenStack nodes
+    Run Keyword If    0 < ${NUM_OS_SYSTEM}    OVSDB.Reset OVS Logging    ${OS_CNTL_CONN_ID}
+    Run Keyword If    1 < ${NUM_OS_SYSTEM}    OVSDB.Reset OVS Logging    ${OS_CMP1_CONN_ID}
+    Run Keyword If    2 < ${NUM_OS_SYSTEM}    OVSDB.Reset OVS Logging    ${OS_CMP2_CONN_ID}