summaryrefslogtreecommitdiff
path: root/cesar/maximus/python
diff options
context:
space:
mode:
authorCeline Buret2012-01-13 16:27:58 +0100
committerCeline Buret2012-04-12 14:26:53 +0200
commite50c8cfc7de9e375c8d0ce4a1820860a52cb1e8f (patch)
tree5d1e21c3b5a63e0d8a43cd7dacfb726ad0355c2b /cesar/maximus/python
parentea8a5d730db3d1e20b35d20e7163f1427831e564 (diff)
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.
Diffstat (limited to 'cesar/maximus/python')
-rw-r--r--cesar/maximus/python/py/test_log.py45
1 files changed, 45 insertions, 0 deletions
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 ()])