[asterisk-commits] rmudgett: testsuite/asterisk/trunk r4189 - in /asterisk/trunk/tests/masquerad...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Sep 13 17:30:52 CDT 2013
Author: rmudgett
Date: Fri Sep 13 17:30:44 2013
New Revision: 4189
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4189
Log:
testsuite: Update the masquerade supertest.
Change the masquerade supertest for more flexibility.
* Changed to be able to detect if the call disconnects before all channels
have optimized out. The IAX2 call was getting into a screwed up state
under stress and disconnected too early.
* Changed the test to easily switch between SIP and IAX2. The test will
now use SIP since IAX2 has difficulty under stress.
(closes issue ASTERISK-22221)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2847/
Added:
asterisk/trunk/tests/masquerade/configs/ast1/sip.conf (with props)
asterisk/trunk/tests/masquerade/configs/ast2/sip.conf (with props)
Modified:
asterisk/trunk/tests/masquerade/configs/ast1/extensions.conf
asterisk/trunk/tests/masquerade/configs/ast2/extensions.conf
asterisk/trunk/tests/masquerade/run-test
asterisk/trunk/tests/masquerade/test-config.yaml
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=4189&r1=4188&r2=4189
==============================================================================
--- asterisk/trunk/tests/masquerade/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/masquerade/configs/ast1/extensions.conf Fri Sep 13 17:30:44 2013
@@ -4,24 +4,33 @@
lastaction=""
[outgoing]
-exten => _9XXX,1,NoOp(Call to park)
-exten => _9XXX,n,Set(FIRST=1)
-exten => _9XXX,n,Goto(optout,${EXTEN},1)
-
-[optout]
-exten => _9XXX,1,NoOp(Local channel chain to park call)
-exten => _9XXX,n,GotoIf($[${EXTEN} = 9000]?done:)
-exten => _9XXX,n,Dial(Local/$[${EXTEN} - 1]@optout)
-exten => _9XXX,n,UserEvent(ast1,status: FAILURE Dial Local continued in dialplan DIALSTATUS=${DIALSTATUS})
-exten => _9XXX,n,Hangup()
-exten => _9XXX,n(done),Dial(IAX2/ast2/${EXTEN},30)
-exten => _9XXX,n,UserEvent(ast1,status: FAILURE Dial IAX continued in dialplan DIALSTATUS=${DIALSTATUS})
-exten => _9XXX,n,Hangup()
+exten => _XXXX,1,NoOp(Local channel chain to park call)
+exten => _XXXX,n,Set(NEXT=$[${EXTEN} - 1])
+exten => _XXXX,n,GotoIf($[${NEXT:1} = 000]?last)
+exten => _XXXX,n,Dial(Local/${NEXT}@outgoing)
+exten => _XXXX,n,UserEvent(ast1,status: FAILURE Dial Local continued in dialplan DIALSTATUS=${DIALSTATUS})
+exten => _XXXX,n,Hangup()
+exten => _XXXX,n(last),NoOp()
+exten => _XXXX,n,Dial(Local/${NEXT}@last_call/n)
+exten => _XXXX,n,UserEvent(ast1,status: FAILURE Dial last Local continued in dialplan DIALSTATUS=${DIALSTATUS})
+exten => _XXXX,n,Hangup()
exten => h,1,NoOp(Report local channel optimized out)
-exten => h,n,GotoIf($[x${FIRST}x = x1x]?first:)
exten => h,n,UserEvent(optout,status: REMOVED ${CHANNEL(name)})
-exten => h,n(first),NoOp()
+
+[last_call]
+exten => 8000,1,NoOp(Last call in chain)
+exten => 8000,n,Dial(SIP/ast2/last_in_chain,30)
+exten => 8000,n,UserEvent(ast1,status: FAILURE Last call continued in dialplan DIALSTATUS=${DIALSTATUS})
+exten => 8000,n,Hangup()
+
+exten => 9000,1,NoOp(Last call in chain)
+exten => 9000,n,Dial(IAX2/ast2/last_in_chain,30)
+exten => 9000,n,UserEvent(ast1,status: FAILURE Last call continued in dialplan DIALSTATUS=${DIALSTATUS})
+exten => 9000,n,Hangup()
+
+exten => h,1,NoOp(Report last call hangup)
+exten => h,n,UserEvent(last_call,status: HANGUP)
[parked]
; Pre-Asterisk 12 parking
Added: asterisk/trunk/tests/masquerade/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/masquerade/configs/ast1/sip.conf?view=auto&rev=4189
==============================================================================
--- asterisk/trunk/tests/masquerade/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/masquerade/configs/ast1/sip.conf Fri Sep 13 17:30:44 2013
@@ -1,0 +1,22 @@
+[general]
+udpbindaddr=127.0.0.1
+
+[ast1]
+type=friend
+fromuser=ast1
+host=127.0.0.2
+context=parkedcalls
+disallow=all
+allow=gsm
+qualify=no
+insecure=invite
+
+[ast2]
+type=friend
+fromuser=ast2
+host=127.0.0.2
+context=parkedcalls
+disallow=all
+allow=gsm
+qualify=no
+insecure=invite
Propchange: asterisk/trunk/tests/masquerade/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/masquerade/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/masquerade/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/trunk/tests/masquerade/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/masquerade/configs/ast2/extensions.conf?view=diff&rev=4189&r1=4188&r2=4189
==============================================================================
--- asterisk/trunk/tests/masquerade/configs/ast2/extensions.conf (original)
+++ asterisk/trunk/tests/masquerade/configs/ast2/extensions.conf Fri Sep 13 17:30:44 2013
@@ -3,13 +3,13 @@
writeprotect=no
[incoming]
-exten => 9000,1,NoOp(Wait for parked call to be retrieved)
-exten => 9000,n,Answer()
+exten => last_in_chain,1,NoOp(Wait for parked call to be retrieved)
+exten => last_in_chain,n,Answer()
; Please wait a long time for the local channels to be optimized out!
; 330 seconds is not quite long enough!
-exten => 9000,n,WaitExten(930,m)
-exten => 9000,n,UserEvent(ast1,status: FAILURE WaitExten timeout)
-exten => 9000,n,Hangup()
+exten => last_in_chain,n,WaitExten(930,m)
+exten => last_in_chain,n,UserEvent(ast1,status: FAILURE WaitExten timeout)
+exten => last_in_chain,n,Hangup()
exten => 5432,1,NoOp(Ack parking retrieval)
exten => 5432,n,Wait(1)
Added: asterisk/trunk/tests/masquerade/configs/ast2/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/masquerade/configs/ast2/sip.conf?view=auto&rev=4189
==============================================================================
--- asterisk/trunk/tests/masquerade/configs/ast2/sip.conf (added)
+++ asterisk/trunk/tests/masquerade/configs/ast2/sip.conf Fri Sep 13 17:30:44 2013
@@ -1,0 +1,22 @@
+[general]
+udpbindaddr=127.0.0.2
+
+[ast1]
+type=friend
+fromuser=ast1
+host=127.0.0.1
+context=incoming
+disallow=all
+allow=gsm
+qualify=no
+insecure=invite
+
+[ast2]
+type=friend
+fromuser=ast2
+host=127.0.0.1
+context=incoming
+disallow=all
+allow=gsm
+qualify=no
+insecure=invite
Propchange: asterisk/trunk/tests/masquerade/configs/ast2/sip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/masquerade/configs/ast2/sip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/masquerade/configs/ast2/sip.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=4189&r1=4188&r2=4189
==============================================================================
--- asterisk/trunk/tests/masquerade/run-test (original)
+++ asterisk/trunk/tests/masquerade/run-test Fri Sep 13 17:30:44 2013
@@ -38,6 +38,15 @@
# Initial call chain parameters.
self.chain_length = 200
self.expected_space = 701
+ # Use IAX calls
+ #self.use_sip_calls = False
+ # Use SIP calls
+ self.use_sip_calls = True
+
+ if self.use_sip_calls:
+ self.base_exten = 8000
+ else:
+ self.base_exten = 9000
# Clear test completion stage flags.
self.removed_count = 0
@@ -75,16 +84,19 @@
# Initiate test call chain.
def initiate_call_chain(self):
logger.info("Initiating test call for a chain length of " + str(self.chain_length))
- exten = 9000 + self.chain_length
+ exten = self.base_exten + self.chain_length
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")
+ self.ast[0].cli_originate("Local/" + str(exten) + "@outgoing extension parkme at parked")
+ return
+ self.ast[0].cli_originate("Local/" + str(exten) + "@outgoing extension parkme12 at parked")
# Initiate a call to retrieve the parked call.
def get_parkedcall(self):
logger.info("Fetching parked call at " + str(self.expected_space))
- self.ast[1].cli_originate("IAX2/ast1/" + str(self.expected_space) + " extension retrieve at getit")
+ tech_prefix = "IAX2/ast1/"
+ if self.use_sip_calls:
+ tech_prefix = "SIP/ast1/"
+ self.ast[1].cli_originate(tech_prefix + str(self.expected_space) + " extension retrieve at getit")
# Called when got ParkedCall AMI event
def evt_parkedcall(self, ami, event):
@@ -140,6 +152,13 @@
self.reset_timeout()
self.check_result()
return
+ elif evt == "last_call":
+ if status == "HANGUP":
+ if self.park_retrieved:
+ return
+ logger.warning("The last call in the chain disconnected too early.")
+ else:
+ logger.info("Unknown status")
elif evt == "ast1":
if status == "SUCCESS":
self.ast1_event = True
@@ -181,6 +200,8 @@
# This is called when we stop the reactor.
def stop_reactor(self):
+ self.test_complete = True
+
# Get some useful output from the Asterisk instance
# under test before tearing down in case of problems.
self.ast[0].cli_exec("core show locks")
@@ -190,7 +211,6 @@
#self.ast[0].cli_exec("core show channels concise")
self.ast[0].cli_exec("core show channels")
- self.test_complete = True
TestCase.stop_reactor(self)
Modified: asterisk/trunk/tests/masquerade/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/masquerade/test-config.yaml?view=diff&rev=4189&r1=4188&r2=4189
==============================================================================
--- asterisk/trunk/tests/masquerade/test-config.yaml (original)
+++ asterisk/trunk/tests/masquerade/test-config.yaml Fri Sep 13 17:30:44 2013
@@ -14,4 +14,5 @@
- 'autoservice_run'
tags:
- parking
- - iax2
+ # - iax2
+ - SIP
More information about the asterisk-commits
mailing list