From e50c8cfc7de9e375c8d0ce4a1820860a52cb1e8f Mon Sep 17 00:00:00 2001 From: Celine Buret Date: Fri, 13 Jan 2012 16:27:58 +0100 Subject: cesar/{host,maximus}: warn user if log is truncated, refs #43 Until now, log was truncated silently if its length reached the max log length. With this commit, user is informed when the station log is too big and truncated. --- cesar/maximus/python/py/test_log.py | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 cesar/maximus/python/py/test_log.py (limited to 'cesar/maximus/python') diff --git a/cesar/maximus/python/py/test_log.py b/cesar/maximus/python/py/test_log.py new file mode 100644 index 0000000000..4848256600 --- /dev/null +++ b/cesar/maximus/python/py/test_log.py @@ -0,0 +1,45 @@ +#! usr/bin/env python + +import sys, unittest + +# for maximus package +sys.path.append('../python') +sys.path.append('../../python') + +# for interface module +sys.path.append('./obj') +sys.path.append('../obj') + +from maximus.station import * +from interface import * + + +# Create a Maximus instance +m = Maximus () + +# Initialize Maximus with command line arguments +m.init (sys.argv) + +class TestSTAFunctions (unittest.TestCase): + + def setUp (self): + # Create station + self.station = STA (m, debug=False, config=Config (default_config=False)) + + def tearDown (self): + # Remove station + m.create_fcall ("uninit_ether").send (self.station.get ()) + self.station.remove () + + def testLog (self): + m.wait (1000000) + m.create_fcall ("test_log").send (self.station.get ()) + +suite = unittest.TestLoader ().loadTestsFromTestCase (TestSTAFunctions) + +if __name__ == '__main__': + testResult = unittest.TextTestRunner (verbosity=2).run (suite) + # Stop Maximus + m.uninit () + # For nightly build errors + sys.exit ((1, 0)[testResult.wasSuccessful ()]) -- cgit v1.2.3