[asterisk-commits] kharwell: testsuite/asterisk/trunk r6178 - in /asterisk/trunk/tests/manager/r...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 6 12:54:51 CST 2015


Author: kharwell
Date: Tue Jan  6 12:54:45 2015
New Revision: 6178

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6178
Log:
Manager Channel redirect tests race condition

There was a race condition in the channel redirect tests where the test could
shut down before all expected events were received. Updated the current channel
redirect tests to "keepalive" (initiates a final call using simple test case)
the test until all events were received or the reactor timeout is reached.

ASTERISK-24536
Reported by: Niklas Larsson


Modified:
    asterisk/trunk/tests/manager/redirect/dual/app/configs/ast1/extensions.conf
    asterisk/trunk/tests/manager/redirect/dual/app/test-config.yaml
    asterisk/trunk/tests/manager/redirect/dual/bridge/different/configs/ast1/extensions.conf
    asterisk/trunk/tests/manager/redirect/dual/bridge/different/test-config.yaml
    asterisk/trunk/tests/manager/redirect/dual/bridge/same/configs/ast1/extensions.conf
    asterisk/trunk/tests/manager/redirect/dual/bridge/same/test-config.yaml
    asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf
    asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml

Modified: asterisk/trunk/tests/manager/redirect/dual/app/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/dual/app/configs/ast1/extensions.conf?view=diff&rev=6178&r1=6177&r2=6178
==============================================================================
--- asterisk/trunk/tests/manager/redirect/dual/app/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/manager/redirect/dual/app/configs/ast1/extensions.conf Tue Jan  6 12:54:45 2015
@@ -1,14 +1,19 @@
 [default]
 
-exten => one,1,Answer()
+exten => keepalive,1,Answer()
+      same => n,Echo()
+      same => n,Hangup()
+
+exten => real_one,1,Answer()
       same => n,UserEvent(Next)
       same => n,Echo()
       same => n,Hangup()
 
-exten => two,1,Answer()
+exten => real_two,1,Answer()
       same => n,Echo()
       same => n,Hangup()
 
 exten => redirect,1,Answer()
       same => n,UserEvent(Redirected)
       same => n,Echo() ; simple test case takes care of hangups
+      same => n,Hangup()

Modified: asterisk/trunk/tests/manager/redirect/dual/app/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/dual/app/test-config.yaml?view=diff&rev=6178&r1=6177&r2=6178
==============================================================================
--- asterisk/trunk/tests/manager/redirect/dual/app/test-config.yaml (original)
+++ asterisk/trunk/tests/manager/redirect/dual/app/test-config.yaml Tue Jan  6 12:54:45 2015
@@ -27,38 +27,40 @@
 test-config:
     # expect three user events - the first will kick off the second originate
     # and the second/third one will be raised during redirect
-    expected_events: 3
+    expected_events: 4
     test-iterations:
         -
-            channel: 'Local/one at default'
+            channel: 'Local/real_one at default'
             application: 'Echo'
         -
-            channel: 'Local/two at default'
+            channel: 'Local/real_two at default'
+            application: 'Echo'
+        -
+            # keep the simple test case alive until all user events
+            # have been raised
+            channel: 'Local/keepalive at default'
             application: 'Echo'
 
 event-action-config:
     -
         ami-events:
-            # once we receive two DialEnd events (both in the 'up' state)
-            # assume the channels are ready to be redirected
+            # once we receive two DialEnd events assume the channels are ready
+            # to be redirected
             conditions:
                 match:
                     Event: 'DialEnd'
-                    DestChannel: 'Local/.*1'
-            requirements:
-                match:
-                   DestChannelState: '6' # Up
+                    DestChannel: 'Local/real.*1'
             count: '2'
             trigger-on-count: True
         ami-actions:
             # redirect the channels to the "redirect" extension
             action:
                 Action: 'Redirect'
-                Channel: 'Local/one at default-00000000;1'
+                Channel: 'Local/real_one at default-00000000;1'
                 Context: 'default'
                 Exten: 'redirect'
                 Priority: '1'
-                Extrachannel: 'Local/two at default-00000001;1'
+                Extrachannel: 'Local/real_two at default-00000001;1'
                 Extracontext: 'default'
                 Extraexten: 'redirect'
                 Extrapriority: '1'
@@ -87,3 +89,11 @@
                     Event: 'Status'
                     Channel: 'Surrogate/Local/.*'
             count: '0'
+            conditions:
+                match:
+                    Event: 'StatusComplete'
+            count: '1'
+        ami-actions:
+            action:
+                Action: 'UserEvent'
+                UserEvent: 'Done'

Modified: asterisk/trunk/tests/manager/redirect/dual/bridge/different/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/dual/bridge/different/configs/ast1/extensions.conf?view=diff&rev=6178&r1=6177&r2=6178
==============================================================================
--- asterisk/trunk/tests/manager/redirect/dual/bridge/different/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/manager/redirect/dual/bridge/different/configs/ast1/extensions.conf Tue Jan  6 12:54:45 2015
@@ -1,4 +1,8 @@
 [default]
+
+exten => keepalive,1,Answer()
+      same => n,Echo()
+      same => n,Hangup()
 
 exten => alice0,1,Answer()
       same => n,UserEvent(Next)

Modified: asterisk/trunk/tests/manager/redirect/dual/bridge/different/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/dual/bridge/different/test-config.yaml?view=diff&rev=6178&r1=6177&r2=6178
==============================================================================
--- asterisk/trunk/tests/manager/redirect/dual/bridge/different/test-config.yaml (original)
+++ asterisk/trunk/tests/manager/redirect/dual/bridge/different/test-config.yaml Tue Jan  6 12:54:45 2015
@@ -40,6 +40,11 @@
             context: 'default'
             exten: 'call-bob1'
             priority: '1'
+        -
+            # keep the simple test case alive until all user events
+            # have been raised
+            channel: 'Local/keepalive at default'
+            application: 'Echo'
 
 event-action-config:
     -
@@ -51,9 +56,6 @@
                 match:
                     Event: 'DialEnd'
                     DestChannel: 'Local/bob.*1'
-            requirements:
-                match:
-                   DestChannelState: '6' # Up
             count: '2'
             trigger-on-count: True
 
@@ -94,7 +96,6 @@
             # once we receive two redirected events check alices's status
             action:
                 Action: 'Status'
-
     -
         ami-events:
             # make sure the alices are still up

Modified: asterisk/trunk/tests/manager/redirect/dual/bridge/same/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/dual/bridge/same/configs/ast1/extensions.conf?view=diff&rev=6178&r1=6177&r2=6178
==============================================================================
--- asterisk/trunk/tests/manager/redirect/dual/bridge/same/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/manager/redirect/dual/bridge/same/configs/ast1/extensions.conf Tue Jan  6 12:54:45 2015
@@ -1,14 +1,21 @@
 [default]
+
+exten => keepalive,1,Answer()
+      same => n,Echo()
+      same => n,Hangup()
 
 exten => alice,1,Answer()
       same => n,Echo()
+      same => n,Hangup()
 
 exten => call-bob,1,Dial(Local/bob at default,,Tt)
       same => n,Hangup()
 
 exten => bob,1,Answer()
       same => n,Echo()
+      same => n,Hangup()
 
 exten => redirect,1,Answer()
       same => n,UserEvent(Redirected)
       same => n,Echo() ; simple test case takes care of hangups
+      same => n,Hangup()

Modified: asterisk/trunk/tests/manager/redirect/dual/bridge/same/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/dual/bridge/same/test-config.yaml?view=diff&rev=6178&r1=6177&r2=6178
==============================================================================
--- asterisk/trunk/tests/manager/redirect/dual/bridge/same/test-config.yaml (original)
+++ asterisk/trunk/tests/manager/redirect/dual/bridge/same/test-config.yaml Tue Jan  6 12:54:45 2015
@@ -35,6 +35,11 @@
             context: 'default'
             exten: 'call-bob'
             priority: '1'
+        -
+            # keep the simple test case alive until all user events
+            # have been raised
+            channel: 'Local/keepalive at default'
+            application: 'Echo'
 
 event-action-config:
     -
@@ -53,9 +58,6 @@
                 match:
                     Event: 'DialEnd'
                     DestChannel: 'Local/bob.*1'
-            requirements:
-                match:
-                   DestChannelState: '6' # Up
             count: '1'
 
         ami-actions:
@@ -103,7 +105,7 @@
             conditions:
                 match:
                     Event: 'Status'
-                    Channel: 'Local/.*1$'
+                    Channel: 'Local/a|b.*1$'
             count: '2'
             trigger-on-count: True
 

Modified: asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf?view=diff&rev=6178&r1=6177&r2=6178
==============================================================================
--- asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf Tue Jan  6 12:54:45 2015
@@ -6,4 +6,5 @@
 
 exten => redirect,1,Answer()
       same => n,UserEvent(Redirected)
+      same => n,Echo()
       same => n,Hangup()

Modified: asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml?view=diff&rev=6178&r1=6177&r2=6178
==============================================================================
--- asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml (original)
+++ asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml Tue Jan  6 12:54:45 2015
@@ -25,6 +25,7 @@
             typename: 'pluggable_modules.EventActionModule'
 
 test-config:
+    expected_events: 2
     test-iterations:
         -
             channel: 'Local/s at default'
@@ -75,3 +76,13 @@
                     Event: 'Status'
                     Channel: 'Surrogate/Local/s.*1'
             count: '0'
+            conditions:
+                match:
+                    Event: 'StatusComplete'
+            count: '1'
+        ami-actions:
+            action:
+                Action: 'UserEvent'
+                UserEvent: 'Done'
+
+




More information about the asterisk-commits mailing list