[svn-commits] twilson: testsuite/asterisk/trunk r289 - in /asterisk/trunk/tests/cdr: cdr_un...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 12 00:36:21 CDT 2010


Author: twilson
Date: Wed May 12 00:36:17 2010
New Revision: 289

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=289
Log:
Fix a hang possibility in console_dial_sip_congestion

Also adds global timeouts of 60 seconds for each test

Modified:
    asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test
    asterisk/trunk/tests/cdr/cdr_userfield/run-test
    asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test
    asterisk/trunk/tests/cdr/console_dial_sip_busy/run-test
    asterisk/trunk/tests/cdr/console_dial_sip_congestion/run-test
    asterisk/trunk/tests/cdr/console_dial_sip_transfer/run-test
    asterisk/trunk/tests/cdr/console_fork_after_busy_forward/run-test
    asterisk/trunk/tests/cdr/console_fork_before_dial/run-test
    asterisk/trunk/tests/cdr/nocdr/run-test

Modified: asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test?view=diff&rev=289&r1=288&r2=289
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test (original)
+++ asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test Wed May 12 00:36:17 2010
@@ -23,6 +23,9 @@
 class Test:
     def __init__(self):
         self.passed = False
+
+        reactor.callLater(60, self.abort)
+
         asterisk1 = Asterisk(base=workingdir)
         asterisk1.install_config("%s/configs/manager.conf" % (testdir))
         asterisk1.install_config("%s/configs/extensions.conf" % (testdir))
@@ -42,8 +45,12 @@
         self.asterisk1.stop()
 
     def abort(self):
+        print "Aborting ..."
         self.stop_asterisk()
-        reactor.stop()
+        if reactor.running:
+            for call in reactor.getDelayedCalls():
+                call.cancel()
+            reactor.stop()
 
     def end(self, ami, event):
         self.stop_asterisk()

Modified: asterisk/trunk/tests/cdr/cdr_userfield/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr_userfield/run-test?view=diff&rev=289&r1=288&r2=289
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_userfield/run-test (original)
+++ asterisk/trunk/tests/cdr/cdr_userfield/run-test Wed May 12 00:36:17 2010
@@ -23,6 +23,9 @@
 class Test:
     def __init__(self):
         self.passed = False
+
+        reactor.callLater(60, self.abort)
+
         asterisk1 = Asterisk(base=workingdir)
         asterisk1.install_config("%s/configs/manager.conf" % (testdir))
         asterisk1.install_config("%s/configs/extensions.conf" % (testdir))
@@ -43,8 +46,12 @@
         self.asterisk1.stop()
 
     def abort(self):
+        print "Aborting ..."
         self.stop_asterisk()
-        reactor.stop()
+        if reactor.running:
+            for call in reactor.getDelayedCalls():
+                call.cancel()
+            reactor.stop()
 
     def end(self, ami, event):
         self.stop_asterisk()

Modified: asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test?view=diff&rev=289&r1=288&r2=289
==============================================================================
--- asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test (original)
+++ asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test Wed May 12 00:36:17 2010
@@ -23,6 +23,9 @@
 class Test:
     def __init__(self):
         self.passed = False
+
+        reactor.callLater(60, self.abort)
+
         asterisk1 = Asterisk(base=workingdir)
         asterisk1.install_config("%s/configs1/sip.conf" % (testdir))
         asterisk1.install_config("%s/configs1/extensions.conf" % (testdir))
@@ -51,8 +54,12 @@
         self.asterisk2.stop()
 
     def abort(self):
+        print "Aborting ..."
         self.stop_asterisk()
-        reactor.stop()
+        if reactor.running:
+            for call in reactor.getDelayedCalls():
+                call.cancel()
+            reactor.stop()
 
     def end(self, ami, event):
         if event.get("channel").lower() != "console/dsp":

Modified: asterisk/trunk/tests/cdr/console_dial_sip_busy/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/console_dial_sip_busy/run-test?view=diff&rev=289&r1=288&r2=289
==============================================================================
--- asterisk/trunk/tests/cdr/console_dial_sip_busy/run-test (original)
+++ asterisk/trunk/tests/cdr/console_dial_sip_busy/run-test Wed May 12 00:36:17 2010
@@ -23,6 +23,9 @@
 class Test:
     def __init__(self):
         self.passed = False
+
+        reactor.callLater(60, self.abort)
+
         asterisk1 = Asterisk(base=workingdir)
         asterisk1.install_config("%s/configs1/sip.conf" % (testdir))
         asterisk1.install_config("%s/configs1/extensions.conf" % (testdir))
@@ -51,8 +54,12 @@
         self.asterisk2.stop()
 
     def abort(self):
+        print "Aborting ..."
         self.stop_asterisk()
-        reactor.stop()
+        if reactor.running:
+            for call in reactor.getDelayedCalls():
+                call.cancel()
+            reactor.stop()
 
     def end(self, ami, event):
         self.stop_asterisk()

Modified: asterisk/trunk/tests/cdr/console_dial_sip_congestion/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/console_dial_sip_congestion/run-test?view=diff&rev=289&r1=288&r2=289
==============================================================================
--- asterisk/trunk/tests/cdr/console_dial_sip_congestion/run-test (original)
+++ asterisk/trunk/tests/cdr/console_dial_sip_congestion/run-test Wed May 12 00:36:17 2010
@@ -23,6 +23,9 @@
 class Test:
     def __init__(self):
         self.passed = False
+
+        reactor.callLater(60, self.abort)
+
         asterisk1 = Asterisk(base=workingdir)
         asterisk1.install_config("%s/configs1/sip.conf" % (testdir))
         asterisk1.install_config("%s/configs1/extensions.conf" % (testdir))
@@ -51,10 +54,17 @@
         self.asterisk2.stop()
 
     def abort(self):
+        print "Aborting ..."
         self.stop_asterisk()
-        reactor.stop()
+        if reactor.running:
+            for call in reactor.getDelayedCalls():
+                call.cancel()
+            reactor.stop()
 
     def end(self, ami, event):
+        if event.get('channel').lower() != "console/dsp":
+            return
+
         self.stop_asterisk()
 
         cdr1 = AsteriskCSVCDR(fn="%s/var/log/asterisk/cdr-csv/Master.csv" % (self.asterisk1.base))

Modified: asterisk/trunk/tests/cdr/console_dial_sip_transfer/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/console_dial_sip_transfer/run-test?view=diff&rev=289&r1=288&r2=289
==============================================================================
--- asterisk/trunk/tests/cdr/console_dial_sip_transfer/run-test (original)
+++ asterisk/trunk/tests/cdr/console_dial_sip_transfer/run-test Wed May 12 00:36:17 2010
@@ -23,6 +23,9 @@
 class Test:
     def __init__(self):
         self.passed = False
+
+        reactor.callLater(60, self.abort)
+
         asterisk1 = Asterisk(base=workingdir)
         asterisk1.install_config("%s/configs1/sip.conf" % (testdir))
         asterisk1.install_config("%s/configs1/extensions.conf" % (testdir))
@@ -52,8 +55,12 @@
         self.asterisk2.stop()
 
     def abort(self):
+        print "Aborting ..."
         self.stop_asterisk()
-        reactor.stop()
+        if reactor.running:
+            for call in reactor.getDelayedCalls():
+                call.cancel()
+            reactor.stop()
 
     def end(self, ami, event):
         if event.get('channel').lower() != "console/dsp":

Modified: asterisk/trunk/tests/cdr/console_fork_after_busy_forward/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/console_fork_after_busy_forward/run-test?view=diff&rev=289&r1=288&r2=289
==============================================================================
--- asterisk/trunk/tests/cdr/console_fork_after_busy_forward/run-test (original)
+++ asterisk/trunk/tests/cdr/console_fork_after_busy_forward/run-test Wed May 12 00:36:17 2010
@@ -23,6 +23,9 @@
 class Test:
     def __init__(self):
         self.passed = False
+
+        reactor.callLater(60, self.abort)
+
         asterisk1 = Asterisk(base=workingdir)
         asterisk1.install_config("%s/configs1/sip.conf" % (testdir))
         asterisk1.install_config("%s/configs1/manager.conf" % (testdir))
@@ -53,8 +56,12 @@
         self.asterisk2.stop()
 
     def abort(self):
+        print "Aborting ..."
         self.stop_asterisk()
-        reactor.stop()
+        if reactor.running:
+            for call in reactor.getDelayedCalls():
+                call.cancel()
+            reactor.stop()
 
     def end(self, ami, event):
         if event.get('channel').lower() != "console/dsp":

Modified: asterisk/trunk/tests/cdr/console_fork_before_dial/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/console_fork_before_dial/run-test?view=diff&rev=289&r1=288&r2=289
==============================================================================
--- asterisk/trunk/tests/cdr/console_fork_before_dial/run-test (original)
+++ asterisk/trunk/tests/cdr/console_fork_before_dial/run-test Wed May 12 00:36:17 2010
@@ -23,6 +23,9 @@
 class Test:
     def __init__(self):
         self.passed = False
+
+        reactor.callLater(60, self.abort)
+
         asterisk1 = Asterisk(base=workingdir)
         asterisk1.install_config("%s/configs1/sip.conf" % (testdir))
         asterisk1.install_config("%s/configs1/manager.conf" % (testdir))
@@ -53,8 +56,12 @@
         self.asterisk2.stop()
 
     def abort(self):
+        print "Aborting ..."
         self.stop_asterisk()
-        self.reactor.stop()
+        if reactor.running:
+            for call in reactor.getDelayedCalls():
+                call.cancel()
+            reactor.stop()
 
     def end(self, ami, event):
         self.stop_asterisk()

Modified: asterisk/trunk/tests/cdr/nocdr/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/nocdr/run-test?view=diff&rev=289&r1=288&r2=289
==============================================================================
--- asterisk/trunk/tests/cdr/nocdr/run-test (original)
+++ asterisk/trunk/tests/cdr/nocdr/run-test Wed May 12 00:36:17 2010
@@ -23,6 +23,9 @@
 class Test:
     def __init__(self):
         self.passed = False
+
+        reactor.callLater(60, self.abort)
+
         asterisk1 = Asterisk(base=workingdir)
         asterisk1.install_config("%s/configs/extensions.conf" % (testdir))
         asterisk1.install_config("%s/configs/manager.conf" % (testdir))
@@ -44,8 +47,12 @@
         self.asterisk1.stop()
 
     def abort(self):
+        print "Aborting ..."
         self.stop_asterisk()
-        reactor.stop()
+        if reactor.running:
+            for call in reactor.getDelayedCalls():
+                call.cancel()
+            reactor.stop()
 
     def end(self, ami, event):
         self.stop_asterisk()




More information about the svn-commits mailing list