[asterisk-commits] dlee: branch dlee/ASTERISK-22451-ari-subscribe-tests r4154 - in /asterisk/tea...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 10 16:15:08 CDT 2013


Author: dlee
Date: Tue Sep 10 16:15:04 2013
New Revision: 4154

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4154
Log:
Subscription tests

Added:
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/configs/
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/configs/ast1/
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/configs/ast1/extensions.conf   (with props)
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/test-config.yaml   (with props)
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf   (with props)
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py   (with props)
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml   (with props)
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/configs/
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/configs/ast1/
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/configs/ast1/extensions.conf   (with props)
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml   (with props)
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/tests.yaml   (with props)
Modified:
    asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/tests.yaml

Added: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/configs/ast1/extensions.conf?view=auto&rev=4154
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/configs/ast1/extensions.conf (added)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/configs/ast1/extensions.conf Tue Sep 10 16:15:04 2013
@@ -1,0 +1,7 @@
+[default]
+
+exten => s,1,NoOp()
+	same => n,Answer()
+	same => n,Stasis(testsuite)
+	same => n,Stasis(testsuite,fin)
+	same => n,Hangup()

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/test-config.yaml?view=auto&rev=4154
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/test-config.yaml (added)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/test-config.yaml Tue Sep 10 16:15:04 2013
@@ -1,0 +1,43 @@
+testinfo:
+    summary: Test continuing on from the RESTful API back to the dialplan
+    description: |
+        This test simply waits for a call via the WebSocket, then hits the
+        continue controller to send it back to the dialplan.
+
+test-modules:
+    add-test-to-search-path: True
+    test-object:
+        config-section: test-object-config
+        typename: ari.AriTestObject
+    modules:
+        -   config-section: ari-config
+            typename: ari.WebSocketEventModule
+
+test-object-config:
+
+
+ari-config:
+    events:
+        -   conditions:
+                match:
+                    type: StasisStart
+                    application: testsuite
+                    args: []
+            count: 1
+            callback:
+                module: 
+                method: on_start
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : app_echo
+    tags:
+        - ARI
+
+

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-bridge/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf?view=auto&rev=4154
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf (added)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf Tue Sep 10 16:15:04 2013
@@ -1,0 +1,7 @@
+[default]
+
+exten => s,1,NoOp()
+	same => n,Answer()
+	same => n,Stasis(testsuite)
+	same => n,UserEvent(CanYouSeeMe)
+	same => n,Hangup()

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py?view=auto&rev=4154
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py (added)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py Tue Sep 10 16:15:04 2013
@@ -1,0 +1,38 @@
+"""
+Copyright (C) 2013, Digium, Inc.
+David M. Lee, II <dlee at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+"""
+
+import logging
+
+LOGGER = logging.getLogger(__name__)
+
+class TestData(object):
+    def __init__(self):
+        self.channel_id = None
+        self.has_ended = False
+
+test_data = TestData()
+
+def on_start(ari, event):
+    LOGGER.debug("on_start(%r)" % event)
+    test_data.channel_id = event["channel"]["id"]
+    ari.post("applications", "testsuite", "subscribe",
+             eventSource="channel:%s" % test_data.channel_id)
+    ari.post("chanels", test_data.channel_id, "continue")
+    return True
+
+
+def on_end(ari, event):
+    LOGGER.debug("on_end(%r)" % event)
+    self.has_ended = True
+    return True
+
+
+def on_state_change(ari, event):
+    LOGGER.debug("on_state_change(%r)" % event)
+    assert self.has_ended, "Expected no state changes before StasisEnd"
+    return True

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/subscribe_channel.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml?view=auto&rev=4154
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml (added)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml Tue Sep 10 16:15:04 2013
@@ -1,0 +1,62 @@
+testinfo:
+    summary: Test subscribing to a channel from an application.
+    description: |
+        Typical case of sending a channel to an application, application
+        subscribes to the channel, sends it back to the dialplan, continues
+        to receive events about the channel.
+
+test-modules:
+    add-test-to-search-path: True
+    test-object:
+        config-section: test-object-config
+        typename: ari.AriTestObject
+    modules:
+        -   config-section: ari-config
+            typename: ari.WebSocketEventModule
+
+test-object-config:
+
+
+ari-config:
+    events:
+        -   conditions:
+                match:
+                    type: StasisStart
+                    application: testsuite
+                    args: []
+            count: 1
+            callback:
+                module: subscribe_channel
+                method: on_start
+        -   conditions:
+                match:
+                    type: StasisEnd
+                    application: testsuite
+            count: 1
+            callback:
+                module: subscribe_channel
+                method: on_end
+        -   conditions:
+                match:
+                    type: ChannelStateChange
+                    application: testsuite
+                    args: []
+            count: 1
+            callback:
+                module: subscribe_channel
+                method: on_state_change
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : app_echo
+        - asterisk : app_userevent
+    tags:
+        - ARI
+
+

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-channel/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/configs/ast1/extensions.conf?view=auto&rev=4154
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/configs/ast1/extensions.conf (added)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/configs/ast1/extensions.conf Tue Sep 10 16:15:04 2013
@@ -1,0 +1,7 @@
+[default]
+
+exten => s,1,NoOp()
+	same => n,Answer()
+	same => n,Stasis(testsuite)
+	same => n,Stasis(testsuite,fin)
+	same => n,Hangup()

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml?view=auto&rev=4154
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml (added)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml Tue Sep 10 16:15:04 2013
@@ -1,0 +1,43 @@
+testinfo:
+    summary: Test continuing on from the RESTful API back to the dialplan
+    description: |
+        This test simply waits for a call via the WebSocket, then hits the
+        continue controller to send it back to the dialplan.
+
+test-modules:
+    add-test-to-search-path: True
+    test-object:
+        config-section: test-object-config
+        typename: ari.AriTestObject
+    modules:
+        -   config-section: ari-config
+            typename: ari.WebSocketEventModule
+
+test-object-config:
+
+
+ari-config:
+    events:
+        -   conditions:
+                match:
+                    type: StasisStart
+                    application: testsuite
+                    args: []
+            count: 1
+            callback:
+                module: 
+                method: on_start
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - python : autobahn.websocket
+        - python : requests
+        - python : twisted
+        - python : starpy
+        - asterisk : res_ari_channels
+        - asterisk : app_echo
+    tags:
+        - ARI
+
+

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/subscribe-endpoint/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/tests.yaml?view=auto&rev=4154
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/tests.yaml (added)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/tests.yaml Tue Sep 10 16:15:04 2013
@@ -1,0 +1,5 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+    - test: 'subscribe-channel'
+#    - test: 'subscribe-endpoint'
+#    - test: 'subscribe-bridge'

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/tests.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/tests.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/applications/tests.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/tests.yaml?view=diff&rev=4154&r1=4153&r2=4154
==============================================================================
--- asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/tests.yaml (original)
+++ asterisk/team/dlee/ASTERISK-22451-ari-subscribe-tests/tests/rest_api/tests.yaml Tue Sep 10 16:15:04 2013
@@ -3,3 +3,4 @@
     - test: 'continue'
     - test: 'authentication'
     - test: 'CORS'
+    - dir:  'applications'




More information about the asterisk-commits mailing list