[svn-commits] mjordan: testsuite/asterisk/trunk r3135 - in /asterisk/trunk/tests/fastagi: e...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Fri Mar 23 09:20:13 CDT 2012
Author: mjordan
Date: Fri Mar 23 09:20:09 2012
New Revision: 3135
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3135
Log:
Migrate two fastagi tests to use twisted for process management
Tests fastagi/execute and fastagi/wait-for-digit were missed in the
migration patch, due to the fact that neither actually failed. In
the case of wait-for-digit, that's because its not executed; execute
did not fail despite the fact that Asterisk never started. This patch
migrates them to use twisted for their process management in the same
manner as the other non-TestCase derived fastagi tests.
Modified:
asterisk/trunk/tests/fastagi/execute/run-test
asterisk/trunk/tests/fastagi/wait-for-digit/run-test
Modified: asterisk/trunk/tests/fastagi/execute/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/execute/run-test?view=diff&rev=3135&r1=3134&r2=3135
==============================================================================
--- asterisk/trunk/tests/fastagi/execute/run-test (original)
+++ asterisk/trunk/tests/fastagi/execute/run-test Fri Mar 23 09:20:09 2012
@@ -156,21 +156,18 @@
print "Failed"
def stop_reactor(self):
- print "Stopping Reactor ..."
- if reactor.running:
- reactor.stop()
+ def __finish_stop(result):
+ print "Stopping Reactor ..."
+ if reactor.running:
+ reactor.stop()
+ return result
+
+ df = self.ast1.stop()
+ df.addCallback(__finish_stop)
def launch_test(self):
print "Originating call to begin test."
self.ast1.cli_originate("Local/507 at agitest extension echo at agitest")
-
- def start_asterisk(self):
- print "Starting Asterisk"
- self.ast1.start()
-
- def stop_asterisk(self):
- print "Stopping Asterisk"
- self.ast1.stop()
# Read result before timeout
def result_changed(self):
@@ -180,14 +177,18 @@
self.read_result()
def run(self):
- self.launch_test()
- reactor.callLater(self.timeout, self.stop_reactor)
+ def __finish_start_ops(result):
+ self.launch_test()
+ reactor.callLater(self.timeout, self.stop_reactor)
+ return result
+
+ print "Starting Asterisk"
+ df = self.ast1.start()
+ df.addCallback(__finish_start_ops)
def main():
test = FastAGIExecuteTest()
- test.start_asterisk()
reactor.run()
- test.stop_asterisk()
if test.overall_result is not True:
return 1
Modified: asterisk/trunk/tests/fastagi/wait-for-digit/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/wait-for-digit/run-test?view=diff&rev=3135&r1=3134&r2=3135
==============================================================================
--- asterisk/trunk/tests/fastagi/wait-for-digit/run-test (original)
+++ asterisk/trunk/tests/fastagi/wait-for-digit/run-test Fri Mar 23 09:20:09 2012
@@ -64,21 +64,18 @@
print "Failed"
def stop_reactor(self):
- print "Stopping Reactor ..."
- if reactor.running:
- reactor.stop()
+ def __finish_stop(result):
+ print "Stopping Reactor ..."
+ if reactor.running:
+ reactor.stop()
+ return result
+
+ df = self.ast1.stop()
+ df.addCallback(__finish_stop)
def launch_test(self):
print "Originating call to begin test."
self.ast1.cli_originate("Local/basic_agi at agitest extension play_dtmf at agitest")
-
- def start_asterisk(self):
- print "Starting Asterisk"
- self.ast1.start()
-
- def stop_asterisk(self):
- print "Stopping Asterisk"
- self.ast1.stop()
# Read result before timeout
def result_changed(self):
@@ -86,15 +83,19 @@
self.read_result()
def run(self):
- self.launch_test()
- reactor.callLater(self.timeout, self.stop_reactor)
+ def __finish_start_ops(result):
+ self.launch_test()
+ reactor.callLater(self.timeout, self.stop_reactor)
+ return result
+
+ print "Starting Asterisk"
+ df = self.ast1.start()
+ df.addCallback(__finish_start_ops)
def main():
test = FastAGIWaitForDigitTest()
- test.start_asterisk()
reactor.run()
- test.stop_asterisk()
if test.passed is not True:
return 1
More information about the svn-commits
mailing list