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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 24 10:20:17 CST 2014


Author: kharwell
Date: Wed Dec 24 10:20:13 2014
New Revision: 6142

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6142
Log:
Single channel redirect tests

Wrote two tests:

1) Redirect a single channel that is in the Echo application, verify that it
gets redirected to the appropriate dialplan location, and make sure no surrogate
channels are hanging around.

2) Redirect a single channel that is in a bridge with another channel, verify
that the channel gets redirected to the appropriate dialplan location, and make
sure the channel it was bridged with is hung up.

ASTERISK-24536
Reported by: Niklas Larsson
Review: https://reviewboard.asterisk.org/r/4281/

Added:
    asterisk/trunk/tests/manager/redirect/
    asterisk/trunk/tests/manager/redirect/single/
    asterisk/trunk/tests/manager/redirect/single/app/
    asterisk/trunk/tests/manager/redirect/single/app/configs/
    asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/
    asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml   (with props)
    asterisk/trunk/tests/manager/redirect/single/bridge/
    asterisk/trunk/tests/manager/redirect/single/bridge/configs/
    asterisk/trunk/tests/manager/redirect/single/bridge/configs/ast1/
    asterisk/trunk/tests/manager/redirect/single/bridge/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/manager/redirect/single/bridge/test-config.yaml   (with props)
    asterisk/trunk/tests/manager/redirect/single/tests.yaml   (with props)
    asterisk/trunk/tests/manager/redirect/tests.yaml   (with props)
Modified:
    asterisk/trunk/tests/manager/tests.yaml

Added: 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=auto&rev=6142
==============================================================================
--- asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf Wed Dec 24 10:20:13 2014
@@ -1,0 +1,9 @@
+[default]
+
+exten => s,1,Answer()
+      same => n,Echo()
+      same => n,Hangup()
+
+exten => redirect,1,Answer()
+      same => n,UserEvent(Redirected)
+      same => n,Hangup()

Propchange: asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/manager/redirect/single/app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=auto&rev=6142
==============================================================================
--- asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml (added)
+++ asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml Wed Dec 24 10:20:13 2014
@@ -1,0 +1,77 @@
+testinfo:
+    summary: 'Redirect a single channel that is in a dialplan application'
+    description: |
+        Redirect a single channel that is in the Echo application, verify
+        that it gets redirected to the appropriate dialplan location, and
+        make sure no surrogate channels are hanging around.
+
+properties:
+    minversion: '13.2.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk: 'app_echo'
+        - asterisk: 'app_userevent'
+    tags:
+        - manager
+
+test-modules:
+    test-object:
+        config-section: test-config
+        typename: 'test_case.SimpleTestCase'
+    modules:
+        -
+            config-section: event-action-config
+            typename: 'pluggable_modules.EventActionModule'
+
+test-config:
+    test-iterations:
+        -
+            channel: 'Local/s at default'
+            application: 'Echo'
+
+event-action-config:
+    -
+        ami-events:
+            # if a DialEnd event is received and the channel is in the 'up'
+            # state assume the local channel is in the 'echo' application
+            conditions:
+                match:
+                    Event: 'DialEnd'
+                    DestChannel: 'Local/s.*1'
+            requirements:
+                match:
+                   DestChannelState: '6' # Up
+            count: '1'
+        ami-actions:
+            # redirect the channel to the "redirect" extension
+            action:
+                Action: 'Redirect'
+                Channel: 'Local/s at default-00000000;1'
+                Context: 'default'
+                Exten: 'redirect'
+                Priority: '1'
+    -
+        ami-events:
+            # check to make sure that the user event is received (raised
+            # from the extension the channel got redirected)
+            conditions:
+                match:
+                    Event: 'UserEvent'
+                    Channel: 'Local/s.*1'
+                requirements:
+                    UserEvent: 'Redirected'
+            count: '1'
+        ami-actions:
+            # the channel has been redirected at this point so check the
+            # current channel status
+            action:
+                Action: 'Status'
+    -
+        ami-events:
+            # make sure the surrogate channel is not hanging around
+            conditions:
+                match:
+                    Event: 'Status'
+                    Channel: 'Surrogate/Local/s.*1'
+            count: '0'

Propchange: asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/manager/redirect/single/app/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/manager/redirect/single/bridge/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/single/bridge/configs/ast1/extensions.conf?view=auto&rev=6142
==============================================================================
--- asterisk/trunk/tests/manager/redirect/single/bridge/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/manager/redirect/single/bridge/configs/ast1/extensions.conf Wed Dec 24 10:20:13 2014
@@ -1,0 +1,16 @@
+[default]
+
+exten => alice,1,Answer()
+      same => n,Echo()
+
+exten => call-bob,1,Dial(Local/bob at default,,Tt)
+      same => n,Hangup
+
+exten => bob,1,Answer()
+      same => n,Echo()
+
+exten => redirect,1,Answer()
+      same => n,UserEvent(Redirected)
+      ; have the channel enter the echo application since the
+      ; simple test case will hang it up
+      same => n,Echo()

Propchange: asterisk/trunk/tests/manager/redirect/single/bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/manager/redirect/single/bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/manager/redirect/single/bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/manager/redirect/single/bridge/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/single/bridge/test-config.yaml?view=auto&rev=6142
==============================================================================
--- asterisk/trunk/tests/manager/redirect/single/bridge/test-config.yaml (added)
+++ asterisk/trunk/tests/manager/redirect/single/bridge/test-config.yaml Wed Dec 24 10:20:13 2014
@@ -1,0 +1,88 @@
+testinfo:
+    summary: 'Redirect a single channel that is in bridge'
+    description: |
+        Redirect a single channel that is in a bridge with another channel,
+        verify that the channel gets redirected to the appropriate dialplan
+        location, and make sure the channel it was bridged with is hung up.
+
+properties:
+    minversion: '13.2.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - asterisk: 'app_dial'
+        - asterisk: 'app_echo'
+        - asterisk: 'app_userevent'
+    tags:
+        - manager
+
+test-modules:
+    test-object:
+        config-section: test-config
+        typename: 'test_case.SimpleTestCase'
+    modules:
+        -
+            config-section: event-action-config
+            typename: 'pluggable_modules.EventActionModule'
+
+test-config:
+    test-iterations:
+        -
+            channel: 'Local/alice at default'
+            context: 'default'
+            exten: 'call-bob'
+            priority: '1'
+
+event-action-config:
+    -
+        ami-events:
+            # verify the alice and bob get bridged
+            -
+                conditions:
+                    match:
+                        Event: 'BridgeEnter'
+                        Channel: 'Local/alice.*1$'
+                count: '1'
+            -
+                conditions:
+                    match:
+                        Event: 'BridgeEnter'
+                        Channel: 'Local/bob.*1$'
+                count: '1'
+    -
+        ami-events:
+            # wait for bob to enter the echo application before redirecting
+            conditions:
+                match:
+                    Event: 'Newexten'
+                    Channel: 'Local/bob.*2$'
+                    ChannelState: '6' # Up
+            count: '1'
+
+        ami-actions:
+            # redirect alice to the "redirect" extension
+            action:
+                Action: 'Redirect'
+                Channel: 'Local/alice at default-00000000;1'
+                Context: 'default'
+                Exten: 'redirect'
+                Priority: '1'
+    -
+        ami-events:
+            -
+                # check to make sure bob got hungup
+                conditions:
+                    match:
+                        Event: 'Hangup'
+                        Channel: 'Local/bob.*1$'
+                count: '1'
+            -
+                # check to make sure that the user event is received (raised
+                # from the extension the channel got redirected)
+                conditions:
+                    match:
+                        Event: 'UserEvent'
+                        Channel: 'Local/alice.*1$'
+                    requirements:
+                        UserEvent: 'Redirected'
+                count: '1'

Propchange: asterisk/trunk/tests/manager/redirect/single/bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/manager/redirect/single/bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/manager/redirect/single/bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/manager/redirect/single/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/single/tests.yaml?view=auto&rev=6142
==============================================================================
--- asterisk/trunk/tests/manager/redirect/single/tests.yaml (added)
+++ asterisk/trunk/tests/manager/redirect/single/tests.yaml Wed Dec 24 10:20:13 2014
@@ -1,0 +1,4 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'app'
+    - test: 'bridge'

Propchange: asterisk/trunk/tests/manager/redirect/single/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/manager/redirect/single/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/manager/redirect/single/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/manager/redirect/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/redirect/tests.yaml?view=auto&rev=6142
==============================================================================
--- asterisk/trunk/tests/manager/redirect/tests.yaml (added)
+++ asterisk/trunk/tests/manager/redirect/tests.yaml Wed Dec 24 10:20:13 2014
@@ -1,0 +1,3 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - dir:  'single'

Propchange: asterisk/trunk/tests/manager/redirect/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/manager/redirect/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/manager/redirect/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/manager/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/tests.yaml?view=diff&rev=6142&r1=6141&r2=6142
==============================================================================
--- asterisk/trunk/tests/manager/tests.yaml (original)
+++ asterisk/trunk/tests/manager/tests.yaml Wed Dec 24 10:20:13 2014
@@ -22,3 +22,4 @@
     - test: 'connected_line'
     # Temporarily disabled while failures are debugged
     #- test: 'response-time'
+    - dir:  'redirect'




More information about the asterisk-commits mailing list