[svn-commits] pabelanger: testsuite/asterisk/trunk r1011 - in /asterisk/trunk/tests/fastagi...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Nov 29 15:38:03 CST 2010


Author: pabelanger
Date: Mon Nov 29 15:37:59 2010
New Revision: 1011

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1011
Log:
Pass DTMF between Asterisk instance before starting tests.

The current fastagi tests are dependent on the speed of the host computer, on a
slow system they will usually fail. The 2nd reactor has not full started but the
1st has already started the test.  I've now added 2-way communication between
the dialplans.  Since side A starts first, we now WaitExten(10) expecting side B
to send DTMF (it confirms B is ready).

I also noticed we don't properly stop reactor A, which was an issue on the
FreeBSD host.  It basically created a deadlock on 'core stop now', eventually
the testsuite had to kill the process to stop asterisk.

Review: https://reviewboard.asterisk.org/r/1035/

Modified:
    asterisk/trunk/tests/fastagi/configs/extensions.conf
    asterisk/trunk/tests/fastagi/connect/run-test
    asterisk/trunk/tests/fastagi/control-stream-file/run-test
    asterisk/trunk/tests/fastagi/database/run-test
    asterisk/trunk/tests/fastagi/execute/run-test
    asterisk/trunk/tests/fastagi/get-data/run-test
    asterisk/trunk/tests/fastagi/hangup/run-test
    asterisk/trunk/tests/fastagi/record-file/run-test
    asterisk/trunk/tests/fastagi/say-alpha/run-test
    asterisk/trunk/tests/fastagi/say-date/run-test
    asterisk/trunk/tests/fastagi/say-datetime/run-test
    asterisk/trunk/tests/fastagi/say-digits/run-test
    asterisk/trunk/tests/fastagi/say-number/run-test
    asterisk/trunk/tests/fastagi/say-phonetic/run-test
    asterisk/trunk/tests/fastagi/say-time/run-test
    asterisk/trunk/tests/fastagi/stream-file/run-test

Modified: asterisk/trunk/tests/fastagi/configs/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/configs/extensions.conf?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/configs/extensions.conf (original)
+++ asterisk/trunk/tests/fastagi/configs/extensions.conf Mon Nov 29 15:37:59 2010
@@ -10,11 +10,12 @@
 ; Used in connect, hangup, control-stream-file, stream-file, database,
 ; execute, get-data, record-file, say-alpha, say-date, say-datetime,
 ; say-time, say-digits, say-number, say-phonetic
-exten => basic_agi,1,Answer()
-exten => basic_agi,n,Set(GLOBAL(DEBUG)=FAIL - before agi)
-exten => basic_agi,n,AGI(agi://127.0.0.1:4573)
-exten => basic_agi,n,Set(GLOBAL(DEBUG)=${AGISTATUS})
-exten => basic_agi,n,HangUp()
+exten => _5XX,1,Answer()
+exten => _5XX,n,Set(GLOBAL(DEBUG)=FAIL - before agi)
+exten => _5XX,n,SendDTMF(${EXTEN})
+exten => _5XX,n,AGI(agi://127.0.0.1:4573)
+exten => _5XX,n,Set(GLOBAL(DEBUG)=${AGISTATUS})
+exten => _5XX,n,HangUp()
 
 ; Used in channel-status
 exten => no_answer,1,Set(GLOBAL(DEBUG)=FAIL - before agi)
@@ -22,44 +23,56 @@
 exten => no_answer,n,Set(GLOBAL(DEBUG)=${AGISTATUS})
 exten => no_answer,n,HangUp()
 
-; Used in get-data
-exten => play_dtmf,1,Answer()
-exten => play_dtmf,n,Set(GLOBAL(DEBUG)=FAIL - play_dtmf answered)
-exten => play_dtmf,n,SendDTMF(w3w2w1w2w3w3w3w#)
-exten => play_dtmf,n,Set(GLOBAL(DEBUG)=FAIL - play_dtmf sent DTMF)
-exten => play_dtmf,n,HangUp()
+
+
+[get-data]
+exten => 1,1,Answer()
+exten => 1,n,Set(GLOBAL(DEBUG)=FAIL - play_dtmf answered)
+exten => 1,n,WaitExten(10)
+exten => 1,n,HangUp()
+
+exten => 502,1,Wait(1)
+exten => 502,n,SendDTMF(w3w2w1w2w3w3w3w#)
+exten => 502,n,Set(GLOBAL(DEBUG)=FAIL - play_dtmf sent DTMF)
+exten => 502,n,Hangup()
+
+[record-file]
+exten => 1,1,Answer()
+exten => 1,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_term answered)
+exten => 1,n,WaitExten(10)
+exten => 1,n,Hangup()
+
+exten => 508,1,Wait(1)
+exten => 508,n,Playback(beep)
+exten => 508,n,SendDTMF(#)
+exten => 508,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_term sent sounds and exit digit)
+exten => 508,n,Hangup()
 
 ; Used in record-file
-exten => play_snd_and_term,1,Answer()
-exten => play_snd_and_term,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_term answered)
-exten => play_snd_and_term,n,Wait(1)
-exten => play_snd_and_term,n,Playback(beep)
-exten => play_snd_and_term,n,SendDTMF(#)
-exten => play_snd_and_term,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_term sent sounds and exit digit)
-exten => play_snd_and_term,n,HangUp()
+exten => 2,1,Answer()
+exten => 2,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_hangup answered)
+exten => 2,n,WaitExten(10)
+exten => 2,n,Hangip()
 
-; Used in record-file
-exten => play_snd_and_hangup,1,Answer()
-exten => play_snd_and_hangup,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_hangup answered)
-exten => play_snd_and_hangup,n,Wait(1)
-exten => play_snd_and_hangup,n,Playback(beep)
-exten => play_snd_and_hangup,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_hangup sent sounds)
-exten => play_snd_and_hangup,n,HangUp()
+exten => 509,1,Wait(1)
+exten => 509,n,Playback(beep)
+exten => 509,n,Set(GLOBAL(DEBUG)=FAIL - play_snd_and_hangup sent sounds)
+exten => 509,n,HangUp()
 
-; Used in say-alpha, say-date, say-datetime, say-time, say-digits, say-number, say-phonetic
-; listen for the AGI script to talk
-; check to see if we detected any talking
-; notify AGI script over a second port if talkdetect succeeds.
-exten => td_and_agi_notify,1,Answer()
-exten => td_and_agi_notify,n,Set(GLOBAL(DEBUG)=FAIL - td_and_agi_notify answered)
-exten => td_and_agi_notify,n,Set(TALK_DETECTED=0)
-exten => td_and_agi_notify,n,BackgroundDetect(silence/10,100,10,20000)
-exten => td_and_agi_notify,n,Wait(15)
-exten => td_and_agi_notify,n,Set(GLOBAL(DEBUG)=FAIL - td_and_agi_notify listening for sounds)
-exten => td_and_agi_notify,n,GoToIf($[${TALK_DETECTED}=0]?fail:pass)
-exten => td_and_agi_notify,n(fail),Set(GLOBAL(DEBUG)=FAIL - talk detect failed with result ${TALK_DETECTED})
-exten => td_and_agi_notify,n,HangUp()
-exten => td_and_agi_notify,n(pass),Set(GLOBAL(DEBUG)=PASS)
-exten => td_and_agi_notify,n,AGI(agi://127.0.0.1:4574)
-exten => td_and_agi_notify,n,HangUp()
+[td_and_agi_notify]
+exten => 1,1,Answer()
+exten => 1,n,Set(GLOBAL(DEBUG)=FAIL - td_and_agi_notify answered)
+exten => 1,n,WaitExten(10)
+exten => 1,n,Hangup()
 
+exten => _5XX,1,Wait(1)
+exten => _5XX,n,Set(TALK_DETECTED=0)
+exten => _5xx,n,BackgroundDetect(silence/10,100,10,20000)
+exten => _5XX,n,Wait(15)
+exten => _5XX,n,Set(GLOBAL(DEBUG)=FAIL - td_and_agi_notify listening for sounds)
+exten => _5XX,n,GoToIf($[${TALK_DETECTED}=0]?fail:pass)
+exten => _5XX,n(fail),Set(GLOBAL(DEBUG)=FAIL - talk detect failed with result ${TALK_DETECTED})
+exten => _5XX,n,HangUp()
+exten => _5XX,n(pass),Set(GLOBAL(DEBUG)=PASS)
+exten => _5XX,n,AGI(agi://127.0.0.1:4574)
+exten => _5XX,n,HangUp()

Modified: asterisk/trunk/tests/fastagi/connect/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/connect/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/connect/run-test (original)
+++ asterisk/trunk/tests/fastagi/connect/run-test Mon Nov 29 15:37:59 2010
@@ -71,7 +71,7 @@
     def launch_test(self):
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension echo at agitest"
+            "Local/501 at agitest extension echo at agitest"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/control-stream-file/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/control-stream-file/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/control-stream-file/run-test (original)
+++ asterisk/trunk/tests/fastagi/control-stream-file/run-test Mon Nov 29 15:37:59 2010
@@ -85,7 +85,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension echo at agitest"
+            "Local/504 at agitest extension echo at agitest"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/database/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/database/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/database/run-test (original)
+++ asterisk/trunk/tests/fastagi/database/run-test Mon Nov 29 15:37:59 2010
@@ -188,7 +188,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension echo at agitest"
+            "Local/506 at agitest extension echo at agitest"
         )
 
     def start_asterisk(self):

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=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/execute/run-test (original)
+++ asterisk/trunk/tests/fastagi/execute/run-test Mon Nov 29 15:37:59 2010
@@ -173,7 +173,7 @@
         self.asterisk.cli_exec("agi set debug on")
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension echo at agitest"
+            "Local/507 at agitest extension echo at agitest"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/get-data/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/get-data/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/get-data/run-test (original)
+++ asterisk/trunk/tests/fastagi/get-data/run-test Mon Nov 29 15:37:59 2010
@@ -62,8 +62,7 @@
         self.agi = agi
         print "Connection established."
         return agi.getData("beep", timeout=10, maxDigits=10).addCallback(
-            self.finish_test
-        ).addErrback(self.on_failure)
+            self.finish_test).addErrback(self.on_failure)
 
 	# Read test results and dialplan globals
     def read_result(self):
@@ -93,7 +92,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension play_dtmf at agitest"
+            "Local/502 at agitest extension 1 at get-data"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/hangup/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/hangup/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/hangup/run-test (original)
+++ asterisk/trunk/tests/fastagi/hangup/run-test Mon Nov 29 15:37:59 2010
@@ -112,7 +112,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension echo at agitest"
+            "Local/503 at agitest extension echo at agitest"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/record-file/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/record-file/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/record-file/run-test (original)
+++ asterisk/trunk/tests/fastagi/record-file/run-test Mon Nov 29 15:37:59 2010
@@ -133,11 +133,11 @@
             "with", self.test
         if self.test is "DTMF":
             self.asterisk.cli_originate(
-                "Local/basic_agi at agitest extension play_snd_and_term at agitest"
+                "Local/508 at agitest extension 1 at record-file"
             )
         elif self.test is "HANGUP":
             self.asterisk.cli_originate(
-                "Local/basic_agi at agitest extension play_snd_and_hangup at agitest"
+                "Local/509 at agitest extension 2 at record-file"
             )
         else:
             self.result_changed()

Modified: asterisk/trunk/tests/fastagi/say-alpha/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-alpha/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/say-alpha/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-alpha/run-test Mon Nov 29 15:37:59 2010
@@ -46,6 +46,7 @@
         print "Got test success confirmation from dialplan."
         self.notified = True
         agi.finish()
+        self.agi.finish()
         self.result_changed()
 
     def on_failure(self, reason):
@@ -95,7 +96,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension td_and_agi_notify at agitest"
+            "Local/510 at agitest extension 1 at td_and_agi_notify"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/say-date/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-date/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/say-date/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-date/run-test Mon Nov 29 15:37:59 2010
@@ -47,6 +47,7 @@
         print "Got test success confirmation from dialplan."
         self.notified = True
         agi.finish()
+        self.agi.finish()
         self.result_changed()
 
     def on_failure(self, reason):
@@ -96,7 +97,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension td_and_agi_notify at agitest"
+            "Local/511 at agitest extension 1 at td_and_agi_notify"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/say-datetime/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-datetime/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/say-datetime/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-datetime/run-test Mon Nov 29 15:37:59 2010
@@ -46,6 +46,7 @@
         print "Got test success confirmation from dialplan."
         self.notified = True
         agi.finish()
+        self.agi.finish()
         self.result_changed()
 
     def on_failure(self, reason):
@@ -95,7 +96,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension td_and_agi_notify at agitest"
+            "Local/512 at agitest extension 1 at td_and_agi_notify"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/say-digits/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-digits/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/say-digits/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-digits/run-test Mon Nov 29 15:37:59 2010
@@ -46,6 +46,7 @@
         print "Got test success confirmation from dialplan."
         self.notified = True
         agi.finish()
+        self.agi.finish()
         self.result_changed()
 
     def on_failure(self, reason):
@@ -95,7 +96,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension td_and_agi_notify at agitest"
+            "Local/514 at agitest extension 1 at td_and_agi_notify"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/say-number/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-number/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/say-number/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-number/run-test Mon Nov 29 15:37:59 2010
@@ -46,6 +46,7 @@
         print "Got test success confirmation from dialplan."
         self.notified = True
         agi.finish()
+        self.agi.finish()
         self.result_changed()
 
     def on_failure(self, reason):
@@ -95,7 +96,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension td_and_agi_notify at agitest"
+            "Local/515 at agitest extension 1 at td_and_agi_notify"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/say-phonetic/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-phonetic/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/say-phonetic/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-phonetic/run-test Mon Nov 29 15:37:59 2010
@@ -46,6 +46,7 @@
         print "Got test success confirmation from dialplan."
         self.notified = True
         agi.finish()
+        self.agi.finish()
         self.result_changed()
 
     def on_failure(self, reason):
@@ -95,7 +96,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension td_and_agi_notify at agitest"
+            "Local/516 at agitest extension 1 at td_and_agi_notify"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/say-time/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/say-time/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/say-time/run-test (original)
+++ asterisk/trunk/tests/fastagi/say-time/run-test Mon Nov 29 15:37:59 2010
@@ -47,6 +47,7 @@
         print "Got test success confirmation from dialplan."
         self.notified = True
         agi.finish()
+        agi.self.finish()
         self.result_changed()
 
     def on_failure(self, reason):
@@ -96,7 +97,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension td_and_agi_notify at agitest"
+            "Local/513 at agitest extension 1 at td_and_agi_notify"
         )
 
     def start_asterisk(self):

Modified: asterisk/trunk/tests/fastagi/stream-file/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/fastagi/stream-file/run-test?view=diff&rev=1011&r1=1010&r2=1011
==============================================================================
--- asterisk/trunk/tests/fastagi/stream-file/run-test (original)
+++ asterisk/trunk/tests/fastagi/stream-file/run-test Mon Nov 29 15:37:59 2010
@@ -83,7 +83,7 @@
 
         print "Originating call to begin test."
         self.asterisk.cli_originate(
-            "Local/basic_agi at agitest extension echo at agitest"
+            "Local/505 at agitest extension echo at agitest"
         )
 
     def start_asterisk(self):




More information about the svn-commits mailing list