Add function to check ONOS logs for exception and case66 to sanity test to call the function on the 4 nodes
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 412fb23..3c03714 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -1043,3 +1043,39 @@
main.log.info(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
main.cleanup()
main.exit()
+
+ def check_exceptions(self):
+ '''
+ Greps the logs for "xception"
+ '''
+ try:
+ output = ''
+ self.handle.sendline("")
+ self.handle.expect(["\$",pexpect.EOF,pexpect.TIMEOUT])
+ self.handle.sendline("cd "+self.home+"/onos-logs")
+ self.handle.sendline("grep \"xception\" * -c")
+ self.handle.expect("\s-c")
+ self.handle.expect("\$")
+ response = self.handle.before
+ for line in response.splitlines():
+ if re.search("log:", line):
+ output +="Exceptions found in " + line + "\n"
+ elif re.search("std...:",line):
+ output+="Exceptions found in " + line + "\n"
+ else:
+ pass
+ #these should be the old logs
+ return output
+ except pexpect.TIMEOUT:
+ main.log.error(self.name + ": Timeout exception found in check_exceptions function")
+ except pexpect.EOF:
+ main.log.error(self.name + ": EOF exception found")
+ main.log.error(self.name + ": " + self.handle.before)
+ main.cleanup()
+ main.exit()
+ except:
+ main.log.info(self.name + ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
+ main.log.error( traceback.print_exc() )
+ main.log.info(":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
+ main.cleanup()
+ main.exit()