blob: 5f38c8c54330ded0b5b759da2144106e615f9a94 [file] [log] [blame]
A R Karthick9313b762016-11-07 13:14:35 -08001from OnosLog import OnosLog
2from scapy.all import log
3import unittest
4
5class CordLogger(unittest.TestCase):
6
7 def setUp(self):
8 '''Read the log buffer'''
9 try:
10 onosLog = OnosLog()
11 st, output = onosLog.get_log()
A R Karthick9313b762016-11-07 13:14:35 -080012 except: pass
13
14 def tearDown(self):
15 '''Dump the log buffer for ERRORS/warnings'''
16 try:
17 onosLog = OnosLog()
18 st, output = onosLog.get_log( ('ERROR','WARN') )
A R Karthick9313b762016-11-07 13:14:35 -080019 if st and output:
20 log.info('\nTest %s has errors and warnings\n' %self._testMethodName)
21 log.info('%s' %output)
22 else:
23 log.info('\nTest %s has no errors and warnings in the logs' %self._testMethodName)
24 except: pass