|
|
@ -215,15 +215,28 @@ class IgnoreIPDNS(IgnoreIP):
|
|
|
|
self.assertFalse(self.filter.inIgnoreIPList("128.178.50.11"))
|
|
|
|
self.assertFalse(self.filter.inIgnoreIPList("128.178.50.11"))
|
|
|
|
self.assertFalse(self.filter.inIgnoreIPList("128.178.50.13"))
|
|
|
|
self.assertFalse(self.filter.inIgnoreIPList("128.178.50.13"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LogFile(LogCaptureTestCase):
|
|
|
|
|
|
|
|
|
|
|
|
class LogFile(unittest.TestCase):
|
|
|
|
MISSING = 'testcases/missingLogFile'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
|
|
|
|
LogCaptureTestCase.setUp(self)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def tearDown(self):
|
|
|
|
|
|
|
|
LogCaptureTestCase.tearDown(self)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def testMissingLogFiles(self):
|
|
|
|
|
|
|
|
self.filter = FilterPoll(None)
|
|
|
|
|
|
|
|
self.assertRaises(IOError, self.filter.addLogPath, LogFile.MISSING)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LogFileFilterPoll(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
|
|
FILENAME = "testcases/files/testcase01.log"
|
|
|
|
FILENAME = "testcases/files/testcase01.log"
|
|
|
|
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
def setUp(self):
|
|
|
|
"""Call before every test case."""
|
|
|
|
"""Call before every test case."""
|
|
|
|
self.filter = FilterPoll(None)
|
|
|
|
self.filter = FilterPoll(None)
|
|
|
|
self.filter.addLogPath(LogFile.FILENAME)
|
|
|
|
self.filter.addLogPath(LogFileFilterPoll.FILENAME)
|
|
|
|
|
|
|
|
|
|
|
|
def tearDown(self):
|
|
|
|
def tearDown(self):
|
|
|
|
"""Call after every test case."""
|
|
|
|
"""Call after every test case."""
|
|
|
@ -233,7 +246,8 @@ class LogFile(unittest.TestCase):
|
|
|
|
# self.filter.openLogFile(LogFile.FILENAME)
|
|
|
|
# self.filter.openLogFile(LogFile.FILENAME)
|
|
|
|
|
|
|
|
|
|
|
|
def testIsModified(self):
|
|
|
|
def testIsModified(self):
|
|
|
|
self.assertTrue(self.filter.isModified(LogFile.FILENAME))
|
|
|
|
self.assertTrue(self.filter.isModified(LogFileFilterPoll.FILENAME))
|
|
|
|
|
|
|
|
self.assertFalse(self.filter.isModified(LogFileFilterPoll.FILENAME))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LogFileMonitor(LogCaptureTestCase):
|
|
|
|
class LogFileMonitor(LogCaptureTestCase):
|
|
|
@ -604,11 +618,11 @@ class GetFailures(unittest.TestCase):
|
|
|
|
"""Call after every test case."""
|
|
|
|
"""Call after every test case."""
|
|
|
|
|
|
|
|
|
|
|
|
def testTail(self):
|
|
|
|
def testTail(self):
|
|
|
|
self.filter.addLogPath(LogFile.FILENAME, tail=True)
|
|
|
|
self.filter.addLogPath(GetFailures.FILENAME_01, tail=True)
|
|
|
|
self.assertEqual(self.filter.getLogPath()[-1].getPos(), 1653)
|
|
|
|
self.assertEqual(self.filter.getLogPath()[-1].getPos(), 1653)
|
|
|
|
self.filter.getLogPath()[-1].close()
|
|
|
|
self.filter.getLogPath()[-1].close()
|
|
|
|
self.assertEqual(self.filter.getLogPath()[-1].readline(), "")
|
|
|
|
self.assertEqual(self.filter.getLogPath()[-1].readline(), "")
|
|
|
|
self.filter.delLogPath(LogFile.FILENAME)
|
|
|
|
self.filter.delLogPath(GetFailures.FILENAME_01)
|
|
|
|
self.assertEqual(self.filter.getLogPath(),[])
|
|
|
|
self.assertEqual(self.filter.getLogPath(),[])
|
|
|
|
|
|
|
|
|
|
|
|
def testGetFailures01(self, filename=None, failures=None):
|
|
|
|
def testGetFailures01(self, filename=None, failures=None):
|
|
|
|