blob: 2d9242c57d334c0a6e67e40654ca44cf90f84de9 [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()
12 onosLog.close()
13 except: pass
14
15 def tearDown(self):
16 '''Dump the log buffer for ERRORS/warnings'''
17 try:
18 onosLog = OnosLog()
19 st, output = onosLog.get_log( ('ERROR','WARN') )
20 onosLog.close()
21 if st and output:
22 log.info('\nTest %s has errors and warnings\n' %self._testMethodName)
23 log.info('%s' %output)
24 else:
25 log.info('\nTest %s has no errors and warnings in the logs' %self._testMethodName)
26 except: pass