Changes to enable debug logs for the controller restart test case
Change-Id: I24fa972bdc56fccb65a9f39e4236d12d85c9459d
diff --git a/src/test/cli/onosclidriver.py b/src/test/cli/onosclidriver.py
index d9c6011..eb64194 100644
--- a/src/test/cli/onosclidriver.py
+++ b/src/test/cli/onosclidriver.py
@@ -328,6 +328,37 @@
main.cleanup()
main.exit()
+ def logSet( self, level="INFO", app="org.onosproject" ):
+ """
+ Set the logging level to lvl for a specific app
+ returns main.TRUE on success
+ returns main.FALSE if Error occurred
+ if noExit is True, TestON will not exit, but clean up
+ Available level: DEBUG, TRACE, INFO, WARN, ERROR
+ Level defaults to INFO
+ """
+ try:
+ self.handle.sendline( "log:set %s %s" %( level, app ) )
+ self.handle.expect( "onos>" )
+
+ response = self.handle.before
+ if re.search( "Error", response ):
+ return main.FALSE
+ return main.TRUE
+ except pexpect.TIMEOUT:
+ main.log.exception( self.name + ": TIMEOUT exception found" )
+ main.cleanup()
+ main.exit()
+ except pexpect.EOF:
+ main.log.error( self.name + ": EOF exception found" )
+ main.log.error( self.name + ": " + self.handle.before )
+ main.cleanup()
+ main.exit()
+ except Exception:
+ main.log.exception( self.name + ": Uncaught exception!" )
+ main.cleanup()
+ main.exit()
+
def log( self, cmdStr, level="" ):
"""
log the commands in the onos CLI.