[asterisk-commits] dlee: branch dlee/ari-bridge-tests r4013 - in /asterisk/team/dlee/ari-bridge-...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Aug 13 16:41:41 CDT 2013
Author: dlee
Date: Tue Aug 13 16:41:39 2013
New Revision: 4013
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4013
Log:
Bridge hangup test
Added:
asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/
asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/bridge_hangup.py (with props)
asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/configs/
asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/configs/ast1/
asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/configs/ast1/extensions.conf (with props)
asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/test-config.yaml (with props)
Modified:
asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/tests.yaml
Added: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/bridge_hangup.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/bridge_hangup.py?view=auto&rev=4013
==============================================================================
--- asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/bridge_hangup.py (added)
+++ asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/bridge_hangup.py Tue Aug 13 16:41:39 2013
@@ -1,0 +1,39 @@
+'''
+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 BridgeSimple(object):
+ def on_start(self, ari, event):
+ LOGGER.debug("on_start(%r)" % event)
+ self.channel_id = event['channel']['id']
+ self.bridge_id = ari.post('bridges').json()['id']
+ ari.post('channels', self.channel_id, 'answer')
+ ari.post('bridges', self.bridge_id, 'addChannel', channel=self.channel_id)
+ return True
+
+ def on_enter(self, ari, event):
+ channel_id = event['channel']['id']
+ bridge_id = event['bridge']['id']
+ assert self.channel_id == channel_id
+ assert self.bridge_id == bridge_id
+ ari.delete('channels', channel_id)
+ return True
+
+TEST = BridgeSimple()
+
+def on_start(ari, event):
+ return TEST.on_start(ari, event)
+
+def on_enter(ari, event):
+ return TEST.on_enter(ari, event)
+
+def on_leave(ari, event):
+ return TEST.on_leave(ari, event)
Propchange: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/bridge_hangup.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/bridge_hangup.py
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/bridge_hangup.py
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/configs/ast1/extensions.conf?view=auto&rev=4013
==============================================================================
--- asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/configs/ast1/extensions.conf (added)
+++ asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/configs/ast1/extensions.conf Tue Aug 13 16:41:39 2013
@@ -1,0 +1,6 @@
+[default]
+
+exten => s,1,NoOp()
+ same => n,Answer()
+ same => n,Stasis(testsuite)
+ same => n,Hangup()
Propchange: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/test-config.yaml?view=auto&rev=4013
==============================================================================
--- asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/test-config.yaml (added)
+++ asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/test-config.yaml Tue Aug 13 16:41:39 2013
@@ -1,0 +1,58 @@
+testinfo:
+ summary: Test hanging up a channel still sends the leave bridge event.
+ description: |
+ Put a channel in a bridge, hang it up. Do we get the expected events?
+
+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:
+ apps: testsuite
+ events:
+ - conditions:
+ match:
+ type: StasisStart
+ application: testsuite
+ args: []
+ count: 1
+ callback:
+ module: bridge_hangup
+ method: on_start
+ - conditions:
+ match:
+ type: ChannelEnteredBridge
+ application: testsuite
+ count: 1
+ callback:
+ module: bridge_hangup
+ method: on_enter
+ - conditions:
+ match:
+ type: ChannelLeftBridge
+ application: testsuite
+ count: 1
+ - 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 : app_echo
+ tags:
+ - ARI
Propchange: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/hangup/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/tests.yaml?view=diff&rev=4013&r1=4012&r2=4013
==============================================================================
--- asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/tests.yaml (original)
+++ asterisk/team/dlee/ari-bridge-tests/tests/rest_api/bridges/tests.yaml Tue Aug 13 16:41:39 2013
@@ -1,2 +1,3 @@
tests:
- test: 'happy'
+ - test: 'hangup'
More information about the asterisk-commits
mailing list