[svn-commits] jbigelow: testsuite/asterisk/trunk r6349 - in /asterisk/trunk/tests/rest_api/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 29 15:37:30 CST 2015


Author: jbigelow
Date: Thu Jan 29 15:37:22 2015
New Revision: 6349

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6349
Log:
Testsuite: Add ext. bridging tests for Stasis bridge (one channel) interactions

This adds the remaining external bridging tests for Stasis bridge (one channel)
interactions as defined on the StasisStart/StasisEnd Test Plan (tests 2.2, 2.3,
and 2.4) at:
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=30279826

This also renames the test
'tests/rest_api/external_interaction/ami_bridge/stasis_bridge/' to
'tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_app'
and adds these new tests under
'tests/rest_api/external_interaction/ami_bridge/stasis_bridge/'.

(closes issue ASTERISK-24610)
Review: https://reviewboard.asterisk.org/r/4330/


Added:
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/configs/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_app/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_app/configs/
      - copied from r6226, asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_app/test-config.yaml
      - copied unchanged from r6226, asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/test-config.yaml
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/configs/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/configs/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/configs/ast1/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/tests.yaml   (with props)
Removed:
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/configs/
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/test-config.yaml
Modified:
    asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/configs/ast1/extensions.conf?view=auto&rev=6349
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/configs/ast1/extensions.conf Thu Jan 29 15:37:22 2015
@@ -1,0 +1,6 @@
+[default]
+
+exten => echo,1,Answer()
+	same => n,Echo()
+	same => n,Hangup()
+

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/test-config.yaml?view=auto&rev=6349
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/test-config.yaml Thu Jan 29 15:37:22 2015
@@ -1,0 +1,202 @@
+testinfo:
+    summary: Bridge channel in stasis bridge with channel in different stasis app.
+    description: |
+        "This test originates a Local channel placing half ('alice') into
+        Stasis(App_A) and the other half ('echo_alice') into Echo(). The
+        'alice' half is added to the bridge 'test_bridge'. Another Local
+        channel is originated with half ('bob') placed into Stasis(App_B) while
+        the other half ('echo_bob') is placed into Echo().
+
+        The AMI bridge action is then used to pull 'alice' out of the
+        Stasis(App_A) bridge and 'bob' out of Stasis(App_B) and push them into
+        a new bridge. The 'bob' channel half is then hung up. This test
+        verifies that the StasisStart & StasisEnd events occur for both 'alice'
+        & 'bob'. Additionally it verifies that 'alice' does not re-enter Stasis
+        when 'bob' is hung up."
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'ari.AriBaseTestObject'
+    modules:
+        -
+            config-section: pluggable-config
+            typename: 'pluggable_modules.EventActionModule'
+
+test-object-config:
+    apps: App_A,App_B
+
+pluggable-config:
+    # Create channel where the 'alice' half enters Stasis and the 'echo_alice'
+    # half enters dialplan executing Echo()
+    -
+        ami-start:
+        ari-requests:
+            method: 'post'
+            uri: 'channels/alice'
+            params:
+                endpoint: 'Local/echo at default'
+                app: 'App_A'
+                otherChannelId: 'echo_alice'
+    # Ensure the 'alice' channel half enters Stasis. Create stasis bridge
+    # 'test_bridge' and add 'alice' to it.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'App_A'
+                args: []
+                channel:
+                    id: 'alice'
+            count: 1
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'bridges/test_bridge'
+            -
+                method: 'post'
+                uri: 'bridges/test_bridge/addChannel'
+                params:
+                    channel: 'alice'
+    # Ensure 'alice' is in a Stasis bridge. Then create channel where the 'bob'
+    # half enters Stasis and the 'echo_bob' half enters dialplan executing
+    # Echo().
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                bridge:
+                    id: 'test_bridge'
+                    channels: ['alice']
+                channel:
+                    id: 'alice'
+                application: 'App_A'
+            count: 1
+        ari-requests:
+                method: 'post'
+                uri: 'channels/bob'
+                params:
+                    endpoint: 'Local/echo at default'
+                    app: 'App_B'
+                    otherChannelId: 'echo_bob'
+    # Ensure the 'bob' channel half enters Stasis. Then bridge 'alice' and
+    # 'bob' using AMI.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'App_B'
+                args: []
+                channel:
+                    id: 'bob'
+            count: 1
+        ami-actions:
+            action:
+                Action: 'Bridge'
+                Channel1: 'alice'
+                Channel2: 'bob'
+    # Ensure 'alice' leaves the Stasis bridge (test_bridge)
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                bridge:
+                    id: 'test_bridge'
+                    channels: []
+                channel:
+                    id: 'alice'
+                application: 'App_A'
+            count: 1
+    # Ensure 'alice' leaves Stasis
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'App_A'
+                channel:
+                    id: 'alice'
+            count: 1
+    # Ensure 'bob' leaves Stasis()
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'App_B'
+                channel:
+                    id: 'bob'
+            count: 1
+    # Ensure 'alice' & 'bob' enter the new bridge.
+    -
+        ami-events:
+            -
+                conditions:
+                    match:
+                        Event: BridgeEnter
+                        UniqueID: 'alice'
+                    nomatch:
+                        Bridgeuniqueid: 'test_bridge'
+                count: 1
+            -
+                conditions:
+                    match:
+                        Event: BridgeEnter
+                        UniqueID: 'bob'
+                    nomatch:
+                        Bridgeuniqueid: 'test_bridge'
+                count: 1
+    # Ensure 'alice' & 'bob' are bridged together and then hang up 'bob'.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: VarSet
+                    Uniqueid: 'alice'
+                    Variable: 'BRIDGEPEER'
+                    Value: 'Local/echo at default-.*'
+            count: 1
+        ami-actions:
+            action:
+                Action: 'Hangup'
+                Channel: 'bob'
+    # Ensure bob is hung up.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Hangup
+                    Uniqueid: 'bob'
+            count: 1
+    # Ensure alice is hung up (not returned to Stasis) and destroy the Stasis
+    # bridge.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Hangup
+                    Uniqueid: 'alice'
+            count: 1
+        ari-requests:
+            method: 'delete'
+            uri: 'bridges/test_bridge'
+    # Ensure the Stasis bridge was destroyed.
+    -
+        ari-events:
+            match:
+                type: BridgeDestroyed
+                bridge:
+                    id: 'test_bridge'
+            count: 1
+        stop_test:
+
+properties:
+    minversion: '13.1.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : res_ari_bridges
+        - asterisk : app_echo
+    tags:
+        - ARI

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/different_stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/configs/ast1/extensions.conf?view=auto&rev=6349
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/configs/ast1/extensions.conf Thu Jan 29 15:37:22 2015
@@ -1,0 +1,14 @@
+[default]
+
+exten => echo,1,Answer()
+	same => n,Echo()
+	same => n,Hangup()
+
+exten => 1003,1,NoOp()
+	same => n,Dial(Local/carol at default)
+        same => n,Hangup()
+
+exten => carol,1,Answer()
+	same => n,Echo()
+	same => n,Hangup()
+

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/test-config.yaml?view=auto&rev=6349
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/test-config.yaml Thu Jan 29 15:37:22 2015
@@ -1,0 +1,210 @@
+testinfo:
+    summary: Bridge channel in stasis bridge with channel in non-stasis bridge.
+    description: |
+        "This test originates a Local channel placing half ('alice') into
+        Stasis() and the other half ('echo_alice') into Echo(). The 'alice'
+        half is added to the bridge 'test_bridge'. Another Local channel is
+        originated with half ('bob') executing Dial(Local/carol at default) while
+        the other half ('echo_bob') executes Echo(). Half of the Local channel
+        representing carol is bridged with 'bob' while the other half executes
+        Echo().
+
+        The AMI bridge action is then used to pull 'alice' and 'bob' out of
+        their bridges and push them into a new bridge. The 'bob' channel half
+        is then hung up. This test verifies that the StasisStart & StasisEnd
+        events occur for 'alice' and that 'alice' does not re-enter Stasis when
+        'bob' is hung up."
+
+test-modules:
+    test-object:
+        typename: ari.AriBaseTestObject
+    modules:
+        -
+            config-section: pluggable-config
+            typename: 'pluggable_modules.EventActionModule'
+
+pluggable-config:
+    # Create channel where the 'alice' half enters Stasis and the 'echo_alice'
+    # half enters dialplan executing Echo(). Then create Stasis bridge
+    # 'test_bridge'.
+    -
+        ami-start:
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'channels/alice'
+                params:
+                    endpoint: 'Local/echo at default'
+                    app: 'testsuite'
+                    otherChannelId: 'echo_alice'
+            -
+                method: 'post'
+                uri: 'bridges/test_bridge'
+    # Ensure the 'alice' channel half enters Stasis and add to bridge
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: []
+                channel:
+                    id: 'alice'
+            count: 1
+        ari-requests:
+            method: 'post'
+            uri: 'bridges/test_bridge/addChannel'
+            params:
+                channel: 'alice'
+    # Ensure 'alice' is in a Stasis bridge
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                bridge:
+                    id: 'test_bridge'
+                    channels: ['alice']
+                channel:
+                    id: 'alice'
+            count: 1
+    # Ensure 'echo_alice' is in Echo() and originate a call from bob to carol
+    -
+        ari-events:
+            match:
+                type: ChannelDialplan
+                channel:
+                    id: 'echo_alice'
+                    state: 'Up'
+            count: 1
+        ami-actions:
+            action:
+                Action: 'Originate'
+                Channel: 'Local/1003 at default'
+                Context: 'default'
+                Exten: 'echo'
+                Priority: '1'
+                ChannelId: 'echo_bob'
+                OtherChannelId: 'bob'
+                Async: 'false'
+    # Ensure 'bob' and the local channel representing carol are bridged and
+    # then bridge the 'alice' & 'bob' channel halfs using AMI.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: VarSet
+                    Uniqueid: 'bob'
+                    Variable: 'BRIDGEPEER'
+                    Value: 'Local/carol at default-.*'
+            count: 1
+        ami-actions:
+            action:
+                Action: 'Bridge'
+                Channel1: 'alice'
+                Channel2: 'bob'
+    # Ensure 'alice' leaves the Stasis bridge (test_bridge)
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                bridge:
+                    id: 'test_bridge'
+                    channels: []
+                channel:
+                    id: 'alice'
+            count: 1
+    # Ensure 'alice' leaves Stasis
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'testsuite'
+                channel:
+                    id: 'alice'
+            count: 1
+    # Ensure alice enters the new bridge
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: BridgeEnter
+                    UniqueID: 'alice'
+                nomatch:
+                    Bridgeuniqueid: 'test_bridge'
+            count: 1
+    # Ensure 'bob' leaves the bridge with carol and later on with alice
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: BridgeLeave
+                    UniqueID: 'bob'
+                nomatch:
+                    Bridgeuniqueid: 'test_bridge'
+            count: 2
+    # Ensure 'alice' and the local channel representing bob are bridged.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: VarSet
+                    Uniqueid: 'alice'
+                    Variable: 'BRIDGEPEER'
+                    Value: 'Local/1003 at default-.*'
+            count: 1
+    # Ensure the non-stasis bridges used for bob & carol and alice & bob are
+    # destroyed.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: BridgeDestroy
+                nomatch:
+                    Bridgeuniqueid: 'test_bridge'
+            count: 2
+    # Ensure carol is hung up and hang up bob
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Hangup
+                    Channel: 'Local/carol at default-.*;2'
+            count: 1
+        ami-actions:
+            action:
+                Action: 'Hangup'
+                Channel: 'bob'
+    # Ensure alice is hung up (not returned to Stasis) and destroy the Stasis
+    # bridge.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Hangup
+                    Uniqueid: 'alice'
+            count: 1
+        ari-requests:
+            method: 'delete'
+            uri: 'bridges/test_bridge'
+    # Ensure the Stasis bridge was destroyed.
+    -
+        ari-events:
+            match:
+                type: BridgeDestroyed
+                bridge:
+                    id: 'test_bridge'
+            count: 1
+        stop_test:
+
+properties:
+    minversion: '13.1.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : res_ari_bridges
+        - asterisk : app_dial
+        - asterisk : app_echo
+    tags:
+        - ARI

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/non_stasis_bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/configs/ast1/extensions.conf?view=auto&rev=6349
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/configs/ast1/extensions.conf Thu Jan 29 15:37:22 2015
@@ -1,0 +1,6 @@
+[default]
+
+exten => echo,1,Answer()
+	same => n,Echo()
+	same => n,Hangup()
+

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/test-config.yaml?view=auto&rev=6349
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/test-config.yaml Thu Jan 29 15:37:22 2015
@@ -1,0 +1,196 @@
+testinfo:
+    summary: Bridge channel in stasis bridge with channel in same stasis app.
+    description: |
+        "This test originates a Local channel placing half ('alice') into
+        Stasis() and the other half ('echo_alice') into Echo(). The 'alice'
+        half is added to the bridge 'test_bridge'. Another Local channel is
+        originated with half ('bob') placed into Stasis() while the other half
+        ('echo_bob') is placed into Echo().
+
+        The AMI bridge action is then used to pull 'alice' out of the Stasis
+        bridge and 'bob' out of Stasis() and push them into a new bridge. The
+        'bob' channel half is then hung up. This test verifies that the
+        StasisStart & StasisEnd events occur for both 'alice' & 'bob'.
+        Additionally it verifies that 'alice' does not re-enter Stasis when
+        'bob' is hung up."
+
+test-modules:
+    test-object:
+        typename: ari.AriBaseTestObject
+    modules:
+        -
+            config-section: pluggable-config
+            typename: 'pluggable_modules.EventActionModule'
+
+pluggable-config:
+    # Create channel where the 'alice' half enters Stasis and the 'echo_alice'
+    # half enters dialplan executing Echo()
+    -
+        ami-start:
+        ari-requests:
+            method: 'post'
+            uri: 'channels/alice'
+            params:
+                endpoint: 'Local/echo at default'
+                app: 'testsuite'
+                otherChannelId: 'echo_alice'
+    # Ensure the 'alice' channel half enters Stasis. Create stasis bridge
+    # 'test_bridge' and add 'alice' to it.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: []
+                channel:
+                    id: 'alice'
+            count: 1
+        ari-requests:
+            -
+                method: 'post'
+                uri: 'bridges/test_bridge'
+            -
+                method: 'post'
+                uri: 'bridges/test_bridge/addChannel'
+                params:
+                    channel: 'alice'
+    # Ensure 'alice' is in a Stasis bridge. Then create channel where the 'bob'
+    # half enters Stasis and the 'echo_bob' half enters dialplan executing
+    # Echo().
+    -
+        ari-events:
+            match:
+                type: ChannelEnteredBridge
+                bridge:
+                    id: 'test_bridge'
+                    channels: ['alice']
+                channel:
+                    id: 'alice'
+            count: 1
+        ari-requests:
+                method: 'post'
+                uri: 'channels/bob'
+                params:
+                    endpoint: 'Local/echo at default'
+                    app: 'testsuite'
+                    otherChannelId: 'echo_bob'
+    # Ensure the 'bob' channel half enters Stasis. Then bridge 'alice' and
+    # 'bob' using AMI.
+    -
+        ari-events:
+            match:
+                type: StasisStart
+                application: 'testsuite'
+                args: []
+                channel:
+                    id: 'bob'
+            count: 1
+        ami-actions:
+            action:
+                Action: 'Bridge'
+                Channel1: 'alice'
+                Channel2: 'bob'
+    # Ensure 'alice' leaves the Stasis bridge (test_bridge)
+    -
+        ari-events:
+            match:
+                type: ChannelLeftBridge
+                bridge:
+                    id: 'test_bridge'
+                    channels: []
+                channel:
+                    id: 'alice'
+            count: 1
+    # Ensure 'alice' leaves Stasis
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'testsuite'
+                channel:
+                    id: 'alice'
+            count: 1
+    # Ensure 'bob' leaves Stasis
+    -
+        ari-events:
+            match:
+                type: StasisEnd
+                application: 'testsuite'
+                channel:
+                    id: 'bob'
+            count: 1
+    # Ensure 'alice' & 'bob' enter the new bridge.
+    -
+        ami-events:
+            -
+                conditions:
+                    match:
+                        Event: BridgeEnter
+                        UniqueID: 'alice'
+                    nomatch:
+                        Bridgeuniqueid: 'test_bridge'
+                count: 1
+            -
+                conditions:
+                    match:
+                        Event: BridgeEnter
+                        UniqueID: 'bob'
+                    nomatch:
+                        Bridgeuniqueid: 'test_bridge'
+                count: 1
+    # Ensure 'alice' & 'bob' are bridged together and then hang up 'bob'.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: VarSet
+                    Uniqueid: 'alice'
+                    Variable: 'BRIDGEPEER'
+                    Value: 'Local/echo at default-.*'
+            count: 1
+        ami-actions:
+            action:
+                Action: 'Hangup'
+                Channel: 'bob'
+    # Ensure bob is hung up.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Hangup
+                    Uniqueid: 'bob'
+            count: 1
+    # Ensure alice is hung up (not returned to Stasis) and destroy the Stasis
+    # bridge.
+    -
+        ami-events:
+            conditions:
+                match:
+                    Event: Hangup
+                    Uniqueid: 'alice'
+            count: 1
+        ari-requests:
+            method: 'delete'
+            uri: 'bridges/test_bridge'
+    # Ensure the Stasis bridge was destroyed.
+    -
+        ari-events:
+            match:
+                type: BridgeDestroyed
+                bridge:
+                    id: 'test_bridge'
+            count: 1
+        stop_test:
+
+properties:
+    minversion: '13.1.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : res_ari_bridges
+        - asterisk : app_echo
+    tags:
+        - ARI

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/same_stasis_app/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/tests.yaml?view=auto&rev=6349
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/tests.yaml (added)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/tests.yaml Thu Jan 29 15:37:22 2015
@@ -1,0 +1,5 @@
+tests:
+    - test: 'non_stasis_app'
+    - test: 'non_stasis_bridge'
+    - test: 'same_stasis_app'
+    - test: 'different_stasis_app'

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml?view=diff&rev=6349&r1=6348&r2=6349
==============================================================================
--- asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml (original)
+++ asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml Thu Jan 29 15:37:22 2015
@@ -1,3 +1,3 @@
 tests:
-    - test: 'stasis_bridge'
+    - dir: 'stasis_bridge'
     - test: 'stasis_app'




More information about the svn-commits mailing list