Set Log level of GossipDeviceStore to Trace

Change-Id: I71950bfb68ec3442c0b77edf06e68ad83cdd6a2f
diff --git a/tests/software-upgrades/ONU_Upgrade.robot b/tests/software-upgrades/ONU_Upgrade.robot
index 2c1c331..7d3930e 100755
--- a/tests/software-upgrades/ONU_Upgrade.robot
+++ b/tests/software-upgrades/ONU_Upgrade.robot
@@ -834,6 +834,19 @@
     [Documentation]    Set up the test suite
     Start Logging Setup or Teardown    Setup-${SUITE NAME}
     Common Test Suite Setup
+    # set log level for org.onosproject.store.device.impl.GossipDeviceStore to TRACE to get reason for hanging ONOS resources
+    ${LogLevelGossipDeviceStore}=    Wait Until Keyword Succeeds    ${timeout}    2s
+        ...    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
+        ...    log:get org.onosproject.store.device.impl.GossipDeviceStore
+    Set Suite Variable    ${LogLevelGossipDeviceStore}
+    Log    Old Log Level of GossipDeviceStore is ${LogLevelGossipDeviceStore}
+    Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    2s
+        ...    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
+        ...    log:set TRACE org.onosproject.store.device.impl.GossipDeviceStore
+     ${NewLogLevelGossipDeviceStore}=    Wait Until Keyword Succeeds    ${timeout}    2s
+        ...    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
+        ...    log:get org.onosproject.store.device.impl.GossipDeviceStore
+    Log    New Log Level of GossipDeviceStore is ${NewLogLevelGossipDeviceStore}
     Run Keyword If    ${logging}    Collect Logs
     Stop Logging Setup or Teardown    Setup-${SUITE NAME}
 
@@ -844,5 +857,17 @@
     Run Keyword If    ${portFwdHandle}!=None    Terminate Process    ${portFwdHandle}    kill=true
     Run Keyword If    ${has_dataplane}    Clean Up Linux
     Run Keyword If    ${logging}    Collect Logs
+    # reset log level for org.onosproject.store.device.impl.GossipDeviceStore to to previous level
+     ${NewLogLevelGossipDeviceStore}=    Wait Until Keyword Succeeds    ${timeout}    2s
+        ...    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
+        ...    log:get org.onosproject.store.device.impl.GossipDeviceStore
+    Log    Log Level of GossipDeviceStore is ${NewLogLevelGossipDeviceStore}
+    Run Keyword And Continue On Failure    Wait Until Keyword Succeeds    ${timeout}    2s
+        ...    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
+        ...    log:set ${LogLevelGossipDeviceStore} org.onosproject.store.device.impl.GossipDeviceStore
+     ${LogLevelGossipDeviceStore}=    Wait Until Keyword Succeeds    ${timeout}    2s
+        ...    Execute ONOS CLI Command use single connection    ${ONOS_SSH_IP}    ${ONOS_SSH_PORT}
+        ...    log:get org.onosproject.store.device.impl.GossipDeviceStore
+    Log    New Log Level of GossipDeviceStore is ${LogLevelGossipDeviceStore}
     Stop Logging Setup or Teardown    Teardown-${SUITE NAME}
     Close All ONOS SSH Connections