[asterisk-commits] pabelanger: testsuite/asterisk/trunk r1305 - /asterisk/trunk/tests/chanspy/ch...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Dec 28 19:31:16 UTC 2010
Author: pabelanger
Date: Tue Dec 28 13:31:14 2010
New Revision: 1305
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1305
Log:
Rework chanspy_barge test
Modified:
asterisk/trunk/tests/chanspy/chanspy_barge/run-test
asterisk/trunk/tests/chanspy/chanspy_barge/test-config.yaml
Modified: asterisk/trunk/tests/chanspy/chanspy_barge/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/chanspy/chanspy_barge/run-test?view=diff&rev=1305&r1=1304&r2=1305
==============================================================================
--- asterisk/trunk/tests/chanspy/chanspy_barge/run-test (original)
+++ asterisk/trunk/tests/chanspy/chanspy_barge/run-test Tue Dec 28 13:31:14 2010
@@ -65,6 +65,7 @@
return sequence()
def readResult(self):
+ self.stop_reactor()
self.logLastStep("Reading results")
self.ast1.cli_exec("core show locks") # get lock output in case of deadlock before tearing down.
self.ast1.cli_exec("core show channels")# if channels are still up for some reason, we want to know that as well
@@ -79,10 +80,9 @@
else:
print 'SIP ChanSpy Test FAILED'
- self.stopProcesses()
-
+ def stop_reactor(self):
+ print "Stopping Reactor ..."
if reactor.running:
- print "Stopping Reactor ..."
reactor.stop()
def chanspyEvent(self, ami, event):
@@ -91,27 +91,34 @@
reactor.callLater(3, self.aHangup)
reactor.callLater(4, self.bHangup)
print event
+
def amiOnConnect(self, ami):
self.logLastStep("Connected to the AMI")
self.ami = ami
self.ami.registerEvent('ChanSpyStart', self.chanspyEvent)
+
def amiLoginError(self, ami):
self.logLastStep("AMI login failed")
reactor.callLater(1, self.readResult)
+
def amiLogin(self):
self.logLastStep("Logging in to the AMI")
self.ami_factory = manager.AMIFactory("user", "mysecret")
self.ami_factory.login('127.0.0.1', 5038).addCallbacks(self.amiOnConnect, self.amiLoginError)
+
def aCall(self):
self.logLastStep("A Calling into Wait")
self.pja.stdin.write("m\n")
self.pja.stdin.write("sip:play_exten at 127.0.0.1:5060\n")
+
def bCall(self):
self.logLastStep("B Calling into Playback")
self.pjb.stdin.write("m\n")
self.pjb.stdin.write("sip:play_exten at 127.0.0.1:5060\n")
+
def aHangup(self):
self.pja.stdin.write("h\n")
+
def bHangup(self): #calls into chanspy extension and plays audio to A using Barge
self.pjb.stdin.write("h\n")
reactor.callLater(2, self.verifyAudio)
@@ -154,10 +161,6 @@
self.ast1.cli_exec("channel originate Local/play_recording at test extension detect_audio at test")
def run(self):
-
- # start up the processes
- self.startProcesses()
-
# call extensions
self.amiLogin()
reactor.callLater(1, self.callChanSpy)
@@ -172,6 +175,7 @@
# Run Test
test = ChanSpyBarge(argv)
+ test.startProcesses()
reactor.run()
test.stopProcesses()
if test.passed != True:
@@ -181,3 +185,5 @@
if __name__ == "__main__":
sys.exit(main() or 0)
+
+# vim:sw=4:ts=4:expandtab:textwidth=79
Modified: asterisk/trunk/tests/chanspy/chanspy_barge/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/chanspy/chanspy_barge/test-config.yaml?view=diff&rev=1305&r1=1304&r2=1305
==============================================================================
--- asterisk/trunk/tests/chanspy/chanspy_barge/test-config.yaml (original)
+++ asterisk/trunk/tests/chanspy/chanspy_barge/test-config.yaml Tue Dec 28 13:31:14 2010
@@ -1,5 +1,4 @@
testinfo:
- skip: 'Skip while failures are debugged'
summary: 'Test Chanspy with the \"B\" option for barging in on both channels.'
description: |
'This test verifies basic functionality of using ChanSpy with the
@@ -17,3 +16,4 @@
- python : 'twisted'
- python : 'starpy'
- app : 'pjsua'
+ - custom : 'soundcard'
More information about the asterisk-commits
mailing list