[asterisk-commits] kharwell: testsuite/asterisk/trunk r4438 - in /asterisk/trunk/tests/rest_api/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Dec 13 10:42:35 CST 2013
Author: kharwell
Date: Fri Dec 13 10:42:32 2013
New Revision: 4438
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4438
Log:
ARI: Adding a channel being recorded to a bridge
Test to make sure that when trying to add a channel that is being recorded
to a bridge a 409 is received.
(issue ASTERISK-22624)
Reported by: Joshua Colp
Review: https://reviewboard.asterisk.org/r/2951/
Added:
asterisk/trunk/tests/rest_api/bridges/add_recording_channel/
asterisk/trunk/tests/rest_api/bridges/add_recording_channel/add_recording_channel.py (with props)
asterisk/trunk/tests/rest_api/bridges/add_recording_channel/configs/
asterisk/trunk/tests/rest_api/bridges/add_recording_channel/configs/ast1/
asterisk/trunk/tests/rest_api/bridges/add_recording_channel/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/rest_api/bridges/add_recording_channel/test-config.yaml (with props)
Modified:
asterisk/trunk/tests/rest_api/bridges/tests.yaml
Added: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/add_recording_channel.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/add_recording_channel/add_recording_channel.py?view=auto&rev=4438
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/add_recording_channel/add_recording_channel.py (added)
+++ asterisk/trunk/tests/rest_api/bridges/add_recording_channel/add_recording_channel.py Fri Dec 13 10:42:32 2013
@@ -1,0 +1,29 @@
+'''
+Copyright (C) 2013, Digium, Inc.
+Kevin Harwell <kharwell at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import requests
+
+def on_start(ari, event, obj):
+ channel_id = event['channel']['id']
+
+ ari.post('channels', channel_id, 'record',
+ name='test_adding_recording', format='wav')
+
+ bridge_id = ari.post('bridges').json()['id']
+
+ try:
+ ari.post('bridges', bridge_id, 'addChannel', channel=channel_id)
+ except requests.HTTPError, e:
+ # assert '409' not in e
+ assert 409 == e.response.status_code
+ finally:
+ # done so stop recording and remove
+ ari.delete('recordings/live', 'test_adding_recording')
+ ari.delete('channels', channel_id)
+
+ return True
Propchange: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/add_recording_channel.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/add_recording_channel.py
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/add_recording_channel.py
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/add_recording_channel/configs/ast1/extensions.conf?view=auto&rev=4438
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/add_recording_channel/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/rest_api/bridges/add_recording_channel/configs/ast1/extensions.conf Fri Dec 13 10:42:32 2013
@@ -1,0 +1,6 @@
+[default]
+
+exten => s,1,NoOp()
+ same => n,Answer()
+ same => n,Stasis(testsuite)
+ same => n,Hangup()
Propchange: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/bridges/add_recording_channel/test-config.yaml?view=auto&rev=4438
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/add_recording_channel/test-config.yaml (added)
+++ asterisk/trunk/tests/rest_api/bridges/add_recording_channel/test-config.yaml Fri Dec 13 10:42:32 2013
@@ -1,0 +1,45 @@
+testinfo:
+ summary: Tests failure on adding a channel being recorded to a bridge.
+ description: |
+ Create a channel, start recording on it and then try to put it
+ into a bridge. Test succeeds if it fails to put the channel
+ being recorded into the bridge.
+
+test-modules:
+ add-test-to-search-path: True
+ test-object:
+ typename: ari.AriTestObject
+ modules:
+ - config-section: ari-config
+ typename: ari.WebSocketEventModule
+
+ari-config:
+ apps: testsuite
+ events:
+ - conditions:
+ match:
+ type: StasisStart
+ application: testsuite
+ args: []
+ count: 1
+ callback:
+ module: add_recording_channel
+ method: on_start
+ - conditions:
+ match:
+ type: StasisEnd
+ application: testsuite
+ count: 1
+
+properties:
+ minversion: '12.0.0'
+ dependencies:
+ - python : autobahn.websocket
+ - python : requests
+ - python : twisted
+ - python : starpy
+ - asterisk : res_ari_channels
+ - asterisk : res_ari_recordings
+ - asterisk : app_echo
+ tags:
+ - ARI
Propchange: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/rest_api/bridges/add_recording_channel/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=4438&r1=4437&r2=4438
==============================================================================
--- asterisk/trunk/tests/rest_api/bridges/tests.yaml (original)
+++ asterisk/trunk/tests/rest_api/bridges/tests.yaml Fri Dec 13 10:42:32 2013
@@ -4,3 +4,4 @@
- test: 'hangup'
- test: 'move'
- test: 'delete'
+ - test: 'add_recording_channel'
More information about the asterisk-commits
mailing list