[asterisk-commits] mjordan: branch mjordan/voicemail_tests_082811 r2299 - in /asterisk/team/mjor...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 16 09:54:29 CDT 2011


Author: mjordan
Date: Fri Sep 16 09:54:27 2011
New Revision: 2299

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2299
Log:
Synchronized with branch to remove local repository

Modified:
    asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/TestCase.py
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/run-test

Modified: asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/TestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/TestCase.py?view=diff&rev=2299&r1=2298&r2=2299
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/TestCase.py (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/TestCase.py Fri Sep 16 09:54:27 2011
@@ -11,6 +11,7 @@
 import logging
 import logging.config
 import os
+import datetime
 from twisted.internet import reactor
 from starpy import manager, fastagi
 
@@ -30,7 +31,7 @@
     def __init__(self):
         self.test_name = os.path.dirname(sys.argv[0])
         self.base = self.test_name.lstrip("tests/")
-
+        self.timeoutId = None
         self.testStateController = None
 
         """ Set up logging """
@@ -118,7 +119,8 @@
         """
 
         """
-        reactor.callLater(self.reactor_timeout, self.stop_reactor)
+        if (self.reactor_timeout > 0):
+            self.timeoutId = reactor.callLater(self.reactor_timeout, self.stop_reactor)
 
     def ami_login_error(self, ami):
         logger.error("Error logging into AMI")
@@ -134,3 +136,13 @@
         logger.error(reason.getTraceback())
         self.stop_reactor()
         return reason
+
+    def reset_timeout(self):
+        """
+        Resets the reactor timeout
+        """
+        if (self.timeoutId != None):
+            originalTime = datetime.datetime.fromtimestamp(self.timeoutId.getTime())
+            self.timeoutId.reset(self.reactor_timeout)
+            newTime = datetime.datetime.fromtimestamp(self.timeoutId.getTime())
+            logger.info("Reactor timeout originally scheduled for %s, rescheduled for %s" % (str(originalTime), str(newTime)))

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/run-test?view=diff&rev=2299&r1=2298&r2=2299
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/run-test Fri Sep 16 09:54:27 2011
@@ -219,6 +219,8 @@
             elif message == 'vm-savedto':
                 """ Notify the test that we saved a message """
                 self.voiceMailTest.setTestCondition("savedMessages", 1)
+                """ Reset the reactor timeout """
+                self.voiceMailTest.reset_timeout()
                 self.changeState(PlayNextMessageTestState(self.controller, self.voiceMailTest))
         else:
             self.handleDefaultState(event)
@@ -295,7 +297,7 @@
             return False
         self.addTestCondition("savedMessages", TestCondition(checkSavedMessages, 0))
 
-        self.reactor_timeout = 120
+        self.reactor_timeout = 60
         self.create_asterisk(2)
 
     def ami_connect(self, ami):




More information about the asterisk-commits mailing list