[svn-commits] mjordan: testsuite/asterisk/trunk r5434 - in /asterisk/trunk/tests/rest_api/b...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Aug 12 15:17:30 CDT 2014


Author: mjordan
Date: Tue Aug 12 15:17:22 2014
New Revision: 5434

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5434
Log:
rest_api/bridges: Add tests for accountcode/linkedid propagation in ARI

This patch adds two tests:
(1) The first test (id_propagate) checks that when two channels with
    accountcodes are stored in a mixing bridge, that the accountcode of one
    channel is stored in the other's peeraccount, and that the LinkedId of the
    channel that entered the bridge first replaces the LinkedId of the bridge
    that entered last.
(2) The second test (no_id_propagate) checks the same conditions of the first
    test, but verfies that they do NOT happen when the two channels enter a
    holding bridge.

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

ASTERISK-24003 #close
Reported by: Matt Jordan
patches:
  diffPropagate.diff uploaded by cwolfe (License 6609)

Added:
    asterisk/trunk/tests/rest_api/bridges/id_propagate/
    asterisk/trunk/tests/rest_api/bridges/id_propagate/configs/
    asterisk/trunk/tests/rest_api/bridges/id_propagate/configs/ast1/
    asterisk/trunk/tests/rest_api/bridges/id_propagate/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/bridges/id_propagate/test-config.yaml   (with props)
    asterisk/trunk/tests/rest_api/bridges/no_id_propagate/
    asterisk/trunk/tests/rest_api/bridges/no_id_propagate/configs/
    asterisk/trunk/tests/rest_api/bridges/no_id_propagate/configs/ast1/
    asterisk/trunk/tests/rest_api/bridges/no_id_propagate/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/rest_api/bridges/no_id_propagate/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/rest_api/bridges/tests.yaml

Added: asterisk/trunk/tests/rest_api/bridges/id_propagate/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/id_propagate/configs/ast1/extensions.conf?view=auto&rev=5434
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/id_propagate/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/bridges/id_propagate/configs/ast1/extensions.conf Tue Aug 12 15:17:22 2014
@@ -1,0 +1,5 @@
+[default]
+
+exten => s,1,NoOp()
+	same => n,Answer()
+	same => n,Echo()

Propchange: asterisk/trunk/tests/rest_api/bridges/id_propagate/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/bridges/id_propagate/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/bridges/id_propagate/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/bridges/id_propagate/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/id_propagate/test-config.yaml?view=auto&rev=5434
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/id_propagate/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/bridges/id_propagate/test-config.yaml Tue Aug 12 15:17:22 2014
@@ -1,0 +1,206 @@
+testinfo:
+    summary: Test checks whether in a mixing two party bridge, the bridge propagates
+             linkedids and accountcodes.
+    description: |
+             Two channels are created, named alice and bob.  Their accountcodes are set
+             to the same name of their respective channelIds, as are their linkedIds.
+             They both enter a mixing bridge, and their accountcodes should be stored
+             in the other's respective peeraccount.  The channel that entered first also
+             replaces the other's linkedId with its own.  If these events occur, the
+             test passes.
+
+
+test-modules:
+    add-test-to-search-path: True
+    test-object:
+        config-section: test-object-config
+        typename: ari.AriOriginateTestObject
+    modules:
+        -   config-section: ari-config
+            typename: ari.WebSocketEventModule
+        -
+            config-section: cel-config
+            typename: ami.AMIEventModule
+
+test-object-config:
+    test-iterations:
+        -
+            endpoint: 'Local/s at default'
+            channelId: 'alice'
+            app: 'testsuite'
+
+
+
+ari-config:
+    apps: testsuite
+    events:
+        -
+            conditions:
+                match:
+                    type: StasisStart
+                    application: testsuite
+                    channel:
+                        id: 'alice'
+            count: 1
+            requests:
+                -
+                    method: 'post'
+                    uri: 'channels/alice/variable'
+                    params:
+                        variable: 'CHANNEL(accountcode)'
+                        value: 'alice'
+                -
+                    method: 'post'
+                    uri: 'channels'
+                    params:
+                        endpoint: 'Local/s at default'
+                        app: 'testsuite'
+                        channelId: 'bob'
+        -
+            conditions:
+                match:
+                    type: StasisStart
+                    application: testsuite
+                    channel:
+                        id: 'bob'
+            count: 1
+            requests:
+                -
+                    method: 'post'
+                    uri: 'channels/bob/variable'
+                    params:
+                        variable: 'CHANNEL(accountcode)'
+                        value: 'bob'
+                -
+                    method: 'post'
+                    uri: 'bridges'
+                    params:
+                        bridgeId: 'TheBridge'
+                        type: 'mixing'
+                -
+                    method: 'post'
+                    uri: 'bridges/TheBridge/addChannel'
+                    params:
+                        channel: 'alice'
+        -
+            conditions:
+                match:
+                    type: ChannelEnteredBridge
+                    application: testsuite
+                    channel:
+                        id: 'alice'
+            count: 1
+            requests:
+                method: 'post'
+                uri: 'bridges/TheBridge/addChannel'
+                params:
+                    channel: 'bob'
+        -
+            conditions:
+                match:
+                    type: ChannelEnteredBridge
+                    application: testsuite
+                    channel:
+                        id: 'bob'
+            count: 1
+            requests:
+                method: 'post'
+                uri: 'bridges/TheBridge/removeChannel'
+                params:
+                    channel: 'alice'
+        -
+            conditions:
+                match:
+                    type: ChannelLeftBridge
+                    application: testsuite
+                    channel:
+                        id: 'alice'
+            count: 1
+            requests:
+                method: 'post'
+                uri: 'bridges/TheBridge/removeChannel'
+                params:
+                    channel: 'bob'
+        -
+            conditions:
+                match:
+                    type: ChannelLeftBridge
+                    application: testsuite
+                    channel:
+                        id: 'bob'
+            count: 1
+            requests:
+                -
+                    method: 'delete'
+                    uri: 'bridges/TheBridge'
+                -
+                    method: 'delete'
+                    uri: 'channels/bob'
+                -
+                    method: 'delete'
+                    uri: 'channels/alice'
+
+
+cel-config:
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/s at default-.{7}0;1'
+        requirements:
+            -
+                match:
+                    EventName: 'CHAN_START'
+                    UniqueID: 'alice'
+                    PeerAccount: ''
+                    LinkedID: 'alice'
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/s at default-.{7}1;1'
+        requirements:
+            -
+                match:
+                    EventName: 'CHAN_START'
+                    UniqueID: 'bob'
+                    PeerAccount: ''
+                    LinkedID: 'bob'
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/s at default-.{7}0;1'
+        requirements:
+            -
+                match:
+                    EventName: 'BRIDGE_EXIT'
+                    UniqueID: 'alice'
+                    PeerAccount: 'bob'
+                    LinkedID: 'alice'
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/s at default-.{7}1;1'
+        requirements:
+            -
+                match:
+                     EventName: 'BRIDGE_EXIT'
+                     UniqueID: 'bob'
+                     PeerAccount: 'alice'
+                     LinkedID: 'alice'
+
+
+
+properties:
+    minversion: '13.0.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+    tags:
+        - ARI
+        - accountcode

Propchange: asterisk/trunk/tests/rest_api/bridges/id_propagate/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/bridges/id_propagate/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/bridges/id_propagate/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/bridges/no_id_propagate/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/no_id_propagate/configs/ast1/extensions.conf?view=auto&rev=5434
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/no_id_propagate/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/bridges/no_id_propagate/configs/ast1/extensions.conf Tue Aug 12 15:17:22 2014
@@ -1,0 +1,6 @@
+[default]
+
+exten => s,1,NoOp()
+	same => n,Answer()
+	same => n,Echo()
+

Propchange: asterisk/trunk/tests/rest_api/bridges/no_id_propagate/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/bridges/no_id_propagate/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/bridges/no_id_propagate/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/rest_api/bridges/no_id_propagate/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/no_id_propagate/test-config.yaml?view=auto&rev=5434
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/no_id_propagate/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/bridges/no_id_propagate/test-config.yaml Tue Aug 12 15:17:22 2014
@@ -1,0 +1,199 @@
+testinfo:
+    summary: Test checks whether in a holding two party bridge, the bridge does NOT
+             propagate linkedids and accountcodes.
+    description: |
+             Two channels, labelled as alice and bob, both enter a holding bridge. One
+             channel, alice, has an accountcode, while the other one doesn't. When they
+             enter the bridge, the accountcode of one channel should NOT be stored in
+             in the other's peeraccount.  The LinkedId of the channel that entered the
+             bridge first should not replace the LinkedId of the channel that entered
+             last. Fails if conditions aren't met.
+
+
+test-modules:
+    add-test-to-search-path: True
+    test-object:
+        config-section: test-object-config
+        typename: ari.AriOriginateTestObject
+    modules:
+        -   config-section: ari-config
+            typename: ari.WebSocketEventModule
+        -
+            config-section: cel-config
+            typename: ami.AMIEventModule
+
+test-object-config:
+    test-iterations:
+        -
+            endpoint: 'Local/s at default'
+            channelId: 'alice'
+            app: 'testsuite'
+
+
+ari-config:
+    apps: testsuite
+    events:
+        -
+            conditions:
+                match:
+                    type: StasisStart
+                    application: testsuite
+                    channel:
+                        id: 'alice'
+            count: 1
+            requests:
+                -
+                    method: 'post'
+                    uri: 'channels/alice/variable'
+                    params:
+                        variable: 'CHANNEL(accountcode)'
+                        value: 'alice'
+                -
+                    method: 'post'
+                    uri: 'channels'
+                    params:
+                        endpoint: 'Local/s at default'
+                        app: 'testsuite'
+                        channelId: 'bob'
+        -
+            conditions:
+                match:
+                    type: StasisStart
+                    application: testsuite
+                    channel:
+                        id: 'bob'
+            count: 1
+            requests:
+                -
+                    method: 'post'
+                    uri: 'bridges'
+                    params:
+                        bridgeId: 'TheBridge'
+                        type: 'holding'
+                -
+                    method: 'post'
+                    uri: 'bridges/TheBridge/addChannel'
+                    params:
+                        channel: 'alice'
+        -
+            conditions:
+                match:
+                    type: ChannelEnteredBridge
+                    application: testsuite
+                    channel:
+                        id: 'alice'
+            count: 1
+            requests:
+                method: 'post'
+                uri: 'bridges/TheBridge/addChannel'
+                params:
+                    channel: 'bob'
+        -
+            conditions:
+                match:
+                    type: ChannelEnteredBridge
+                    application: testsuite
+                    channel:
+                        id: 'bob'
+            count: 1
+            requests:
+                method: 'post'
+                uri: 'bridges/TheBridge/removeChannel'
+                params:
+                    channel: 'alice'
+        -
+            conditions:
+                match:
+                    type: ChannelLeftBridge
+                    application: testsuite
+                    channel:
+                        id: 'alice'
+            count: 1
+            requests:
+                method: 'post'
+                uri: 'bridges/TheBridge/removeChannel'
+                params:
+                    channel: 'bob'
+        -
+            conditions:
+                match:
+                    type: ChannelLeftBridge
+                    application: testsuite
+                    channel:
+                        id: 'bob'
+            count: 1
+            requests:
+                -
+                    method: 'delete'
+                    uri: 'bridges/TheBridge'
+                -
+                    method: 'delete'
+                    uri: 'channels/bob'
+                -
+                    method: 'delete'
+                    uri: 'channels/alice'
+
+
+cel-config:
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/s at default-.{7}0;1'
+        requirements:
+            -
+                match:
+                    EventName: 'CHAN_START'
+                    UniqueID: 'alice'
+                    PeerAccount: ''
+                    LinkedID: 'alice'
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/s at default-.{7}1;1'
+        requirements:
+            -
+                match:
+                    EventName: 'CHAN_START'
+                    UniqueID: 'bob'
+                    PeerAccount: ''
+                    LinkedID: 'bob'
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/s at default-.{7}0;1'
+        requirements:
+            -
+                match:
+                     EventName: 'BRIDGE_EXIT'
+                     UniqueID: 'alice'
+                     PeerAccount: ''
+                     LinkedID: 'alice'
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/s at default-.{7}1;1'
+        requirements:
+            -
+                match:
+                     EventName: 'BRIDGE_EXIT'
+                     UniqueID: 'bob'
+                     PeerAccount: ''
+                     LinkedID: 'bob'
+
+
+
+properties:
+    minversion: '13.0.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+    tags:
+        - ARI
+        - accountcode

Propchange: asterisk/trunk/tests/rest_api/bridges/no_id_propagate/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/rest_api/bridges/no_id_propagate/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/rest_api/bridges/no_id_propagate/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/rest_api/bridges/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/tests.yaml?view=diff&rev=5434&r1=5433&r2=5434
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/tests.yaml (original)
+++ asterisk/trunk/tests/rest_api/bridges/tests.yaml Tue Aug 12 15:17:22 2014
@@ -9,4 +9,6 @@
     - test: 'attended_transfer'
     - test: 'bridge_by_id'
     - test: 'bridge_record'
+    - test: 'id_propagate'
+    - test: 'no_id_propagate'
     - dir: 'playback'




More information about the svn-commits mailing list