[asterisk-commits] rmudgett: testsuite/asterisk/trunk r4082 - in /asterisk/trunk/tests/masquerad...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Aug 26 19:42:22 CDT 2013
Author: rmudgett
Date: Mon Aug 26 19:42:20 2013
New Revision: 4082
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4082
Log:
* Made the masquerade super-test compatible with Asterisk 12.
* Made the test not have Park announce the parking space in case the
optimizations finish before the call has completed saying the parking
space. The test may try to pickup the parked call before it has completed
parking it. This is only going to occur if the local channel chain is
very short; such as a chain of 10.
(issue ASTERISK-22221)
Reported by: Matt Jordan
Added:
asterisk/trunk/tests/masquerade/configs/ast1/res_parking.conf (with props)
Modified:
asterisk/trunk/tests/masquerade/configs/ast1/extensions.conf
asterisk/trunk/tests/masquerade/run-test
Modified: asterisk/trunk/tests/masquerade/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/masquerade/configs/ast1/extensions.conf?view=diff&rev=4082&r1=4081&r2=4082
==============================================================================
--- asterisk/trunk/tests/masquerade/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/masquerade/configs/ast1/extensions.conf Mon Aug 26 19:42:20 2013
@@ -24,10 +24,17 @@
exten => h,n(first),NoOp()
[parked]
+; Pre-Asterisk 12 parking
exten => parkme,1,NoOp(Park the outgoing call)
-exten => parkme,n,Park(,parked,failed,1)
+exten => parkme,n,Park(,parked,failed,1,s)
exten => parkme,n,UserEvent(ast1,status: FAILURE Park continued in dialplan)
exten => parkme,n,Hangup()
+
+; Asterisk 12 and later parking
+exten => parkme12,1,NoOp(Park the outgoing call)
+exten => parkme12,n,Park(,c(parked,failed,1)s)
+exten => parkme12,n,UserEvent(ast1,status: FAILURE Park continued in dialplan)
+exten => parkme12,n,Hangup()
exten => failed,1,NoOp(Parked call failed to be picked up before timeout)
exten => failed,n,UserEvent(ast1,status: FAILURE Park timeout)
Added: asterisk/trunk/tests/masquerade/configs/ast1/res_parking.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/masquerade/configs/ast1/res_parking.conf?view=auto&rev=4082
==============================================================================
--- asterisk/trunk/tests/masquerade/configs/ast1/res_parking.conf (added)
+++ asterisk/trunk/tests/masquerade/configs/ast1/res_parking.conf Mon Aug 26 19:42:20 2013
@@ -1,0 +1,7 @@
+[default]
+parkext => 700
+parkpos => 701-720
+context => parkedcalls
+; A 15 minute parking timeout ought to be long enough!
+parkingtime => 900
+findslot => next ; Continue to the 'next' free parking space.
Propchange: asterisk/trunk/tests/masquerade/configs/ast1/res_parking.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/masquerade/configs/ast1/res_parking.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/masquerade/configs/ast1/res_parking.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/trunk/tests/masquerade/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/masquerade/run-test?view=diff&rev=4082&r1=4081&r2=4082
==============================================================================
--- asterisk/trunk/tests/masquerade/run-test (original)
+++ asterisk/trunk/tests/masquerade/run-test Mon Aug 26 19:42:20 2013
@@ -13,6 +13,7 @@
sys.path.append("lib/python")
from asterisk.TestCase import TestCase
+from asterisk.version import AsteriskVersion
logger = logging.getLogger(__name__)
@@ -23,6 +24,10 @@
self.ami_count = 0
self.test_complete = False
+
+ self.parking_space_hdr = "exten"
+ if AsteriskVersion() >= AsteriskVersion('12'):
+ self.parking_space_hdr = "parkingspace"
# Set longer timeout than default.
#
@@ -63,6 +68,7 @@
return
# Call chain completed successfully.
+ logger.info("Test completed successfully")
self.passed = True
self.stop_reactor()
@@ -70,7 +76,10 @@
def initiate_call_chain(self):
logger.info("Initiating test call for a chain length of " + str(self.chain_length))
exten = 9000 + self.chain_length
- self.ast[0].cli_originate("Local/" + str(exten) + "@outgoing/n extension parkme at parked")
+ if AsteriskVersion() < AsteriskVersion('12'):
+ self.ast[0].cli_originate("Local/" + str(exten) + "@outgoing/n extension parkme at parked")
+ return
+ self.ast[0].cli_originate("Local/" + str(exten) + "@outgoing/n extension parkme12 at parked")
# Initiate a call to retrieve the parked call.
def get_parkedcall(self):
@@ -81,12 +90,12 @@
def evt_parkedcall(self, ami, event):
if self.test_complete:
return
- exten = event.get("exten").lower()
- logger.info("Call parked at exten: " + str(exten))
- if exten != str(self.expected_space):
+ exten = event.get(self.parking_space_hdr)
+ if not exten or exten != str(self.expected_space):
logger.warning("Call not parked in expected space " + str(self.expected_space))
self.stop_reactor()
return
+ logger.info("Call parked at exten: " + str(exten))
self.got_AMI_ParkedCall = True
self.check_result()
@@ -95,12 +104,12 @@
def evt_unparkedcall(self, ami, event):
if self.test_complete:
return
- exten = event.get("exten").lower()
- logger.info("Parked call retrieved from exten: " + str(exten))
- if exten != str(self.expected_space):
+ exten = event.get(self.parking_space_hdr)
+ if not exten or exten != str(self.expected_space):
logger.warning("Call not retrieved from expected space " + str(self.expected_space))
self.stop_reactor()
return
+ logger.info("Parked call retrieved from exten: " + str(exten))
self.got_AMI_UnParkedCall = True
self.check_result()
More information about the asterisk-commits
mailing list