[asterisk-commits] mmichelson: testsuite/asterisk/trunk r4414 - in /asterisk/trunk: lib/python/a...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Dec 9 11:33:02 CST 2013
Author: mmichelson
Date: Mon Dec 9 11:32:59 2013
New Revision: 4414
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4414
Log:
Add a test for the CONFBRIDGE_RESULT channel variable.
Review: https://reviewboard.asterisk.org/r/3015
Added:
asterisk/trunk/tests/apps/confbridge/confbridge_result/
asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/
asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/
asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/confbridge.conf (with props)
asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/manager.general.conf.inc (with props)
asterisk/trunk/tests/apps/confbridge/confbridge_result/test-config.yaml (with props)
Modified:
asterisk/trunk/lib/python/asterisk/apptest.py
asterisk/trunk/tests/apps/confbridge/tests.yaml
Modified: asterisk/trunk/lib/python/asterisk/apptest.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/apptest.py?view=diff&rev=4414&r1=4413&r2=4414
==============================================================================
--- asterisk/trunk/lib/python/asterisk/apptest.py (original)
+++ asterisk/trunk/lib/python/asterisk/apptest.py Mon Dec 9 11:32:59 2013
@@ -228,7 +228,7 @@
if 'exten' in channel_def:
self._controller_initial_exten = channel_def['exten']
else:
- self.controller_initial_exten = ChannelObject.default_wait_exten
+ self._controller_initial_exten = ChannelObject.default_wait_exten
if 'hangup-exten' in channel_def:
self._controller_hangup_exten = channel_def['hangup-exten']
else:
@@ -664,11 +664,20 @@
self.dtmf = action_config['dtmf']
self.delay = 0 if 'delay' not in action_config \
else int(action_config['delay'])
-
+ if 'channel-id' in action_config:
+ self.channel_id = action_config['channel-id']
+ else:
+ self.channel_id = ''
def __call__(self, channel_object):
- return channel_object.send_dtmf(dtmf=self.dtmf,
- delay=self.delay)
+ channel = channel_object
+ if (len(self.channel_id) > 0):
+ test_object = AppTest.get_instance()
+ channel = test_object.get_channel_object(self.channel_id)
+ LOGGER.debug("Sending DTMF %s over Controlling Channel %s" %
+ (self.dtmf, channel))
+ return channel.send_dtmf(dtmf=self.dtmf,
+ delay=self.delay)
class ActionStreamAudio(object):
Added: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/confbridge.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/confbridge.conf?view=auto&rev=4414
==============================================================================
--- asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/confbridge.conf (added)
+++ asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/confbridge.conf Mon Dec 9 11:32:59 2013
@@ -1,0 +1,32 @@
+[endmarked]
+type=user
+end_marked=yes
+
+[admin]
+type=user
+marked=yes
+admin=yes
+
+[usermenu]
+type=menu
+*=leave_conference
+
+[adminmenu]
+type=menu
+*=admin_kick_last
+[endmarked]
+type=user
+end_marked=yes
+
+[admin]
+type=user
+marked=yes
+admin=yes
+
+[usermenu]
+type=menu
+*=leave_conference
+
+[adminmenu]
+type=menu
+*=admin_kick_last
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/confbridge.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/confbridge.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/confbridge.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/extensions.conf?view=auto&rev=4414
==============================================================================
--- asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/extensions.conf Mon Dec 9 11:32:59 2013
@@ -1,0 +1,46 @@
+[default]
+exten => alice,1,ConfBridge(1,,endmarked)
+
+exten => bob,1,ConfBridge(1,,sausage)
+
+exten => carol,1,ConfBridge(1,,,usermenu)
+
+exten => darnell,1,ConfBridge(1,,admin,adminmenu)
+
+exten => egbert,1,ConfBridge(1)
+
+
+exten => sendDTMF,1,NoOp()
+ same => n,Verbose(1, Sending DTMF Signal ${DTMF_TO_SEND})
+ same => n,SendDTMF(${DTMF_TO_SEND})
+ same => n,Goto(default,wait,1)
+
+exten => hangup,1,NoOp()
+ same => n,Verbose(1, Hanging up)
+ same => n,Hangup()
+
+exten => wait,1,NoOp()
+ same => n,Wait(10000)
+[default]
+exten => alice,1,ConfBridge(1,,endmarked)
+
+exten => bob,1,ConfBridge(1,,sausage)
+
+exten => carol,1,ConfBridge(1,,,usermenu)
+
+exten => darnell,1,ConfBridge(1,,admin,adminmenu)
+
+exten => egbert,1,ConfBridge(1)
+
+
+exten => sendDTMF,1,NoOp()
+ same => n,Verbose(1, Sending DTMF Signal ${DTMF_TO_SEND})
+ same => n,SendDTMF(${DTMF_TO_SEND})
+ same => n,Goto(default,wait,1)
+
+exten => hangup,1,NoOp()
+ same => n,Verbose(1, Hanging up)
+ same => n,Hangup()
+
+exten => wait,1,NoOp()
+ same => n,Wait(10000)
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/manager.general.conf.inc
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/manager.general.conf.inc?view=auto&rev=4414
==============================================================================
--- asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/manager.general.conf.inc (added)
+++ asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/manager.general.conf.inc Mon Dec 9 11:32:59 2013
@@ -1,0 +1,2 @@
+channelvars = CONFBRIDGE_RESULT
+channelvars = CONFBRIDGE_RESULT
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/configs/ast1/manager.general.conf.inc
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/apps/confbridge/confbridge_result/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/confbridge/confbridge_result/test-config.yaml?view=auto&rev=4414
==============================================================================
--- asterisk/trunk/tests/apps/confbridge/confbridge_result/test-config.yaml (added)
+++ asterisk/trunk/tests/apps/confbridge/confbridge_result/test-config.yaml Mon Dec 9 11:32:59 2013
@@ -1,0 +1,424 @@
+testinfo:
+ summary: 'Basic tests of CONFBRIDGE_STATUS channel variable'
+ description: |
+ 'Five channels are placed into a ConfBridge(). Each is removed from
+ the Confbridge in a way that results in their CONFBRIDGE_STATUS being
+ set to a different value. This ensures that the values are as expected.
+ Alice enters first. She has the endmarked option applied to him.
+ Bob attempts to enter next. He tries to use a non-existent user profile though.
+ Carol enters next. There is nothing special about her.
+ Darnell enters next. He is a marked user and an admin.
+ Egbert enters last. There is nothing special about him.
+ Darnell kicks Egbert from the conference.
+ Carol presses a DTMF sequence to exit the conference.
+ Darnell hangs up, causing Alice to be kicked from the conference.
+ In the end, their CONFBRIDGE_STATUS variables should be set as follows:
+ Alice: ENDMARKED
+ Bob: FAILED
+ Carol: DTMF
+ Darnell: HANGUP
+ Egbert: KICKED'
+
+test-modules:
+ test-object:
+ config-section: test-object-config
+ typename: 'apptest.AppTest'
+
+test-object-config:
+ app: 'ConfBridge'
+ scenarios:
+ -
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeStart'
+ Conference: '1'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Conference Started'
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeEnd'
+ Conference: '1'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Conference Ended'
+ -
+ action-type: 'end-scenario'
+ channels:
+ -
+ channel-id: 'Alice'
+ channel-name: 'Local/alice at default'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeJoin'
+ Conference: '1'
+ Channel: 'Local/alice at default-.*'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Alice Joined'
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeLeave'
+ Conference: '1'
+ Channel: 'Local/alice at default-.*'
+ ChanVariable: 'CONFBRIDGE_RESULT=ENDMARKED'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Alice Left (Endmarked)'
+ -
+ channel-id: 'Bob'
+ channel-name: 'Local/bob at default'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'Hangup'
+ Channel: 'Local/bob at default-.*'
+ ChanVariable: 'CONFBRIDGE_RESULT=FAILED'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Bob Failed to Join'
+
+ -
+ channel-id: 'Carol'
+ channel-name: 'Local/carol at default'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeJoin'
+ Conference: '1'
+ Channel: 'Local/carol at default-.*'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Carol Joined'
+ -
+ action-type: 'start-call'
+ channel-id: 'Darnell'
+ -
+ action-type: 'send-dtmf'
+ delay: '1'
+ dtmf: '*'
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeLeave'
+ Conference: '1'
+ Channel: 'Local/carol at default-.*'
+ ChanVariable: 'CONFBRIDGE_RESULT=DTMF'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Carol Left (DTMF)'
+ -
+ channel-id: 'Darnell'
+ channel-name: 'Local/darnell at default'
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeJoin'
+ Conference: '1'
+ Channel: 'Local/darnell at default-.*'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Darnell Joined'
+ -
+ action-type: 'start-call'
+ channel-id: 'Egbert'
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeLeave'
+ Conference: '1'
+ Channel: 'Local/darnell at default-.*'
+ ChanVariable: 'CONFBRIDGE_RESULT=HANGUP'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Darnell Left (Hangup)'
+ -
+ channel-id: 'Egbert'
+ channel-name: 'Local/egbert at default'
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeJoin'
+ Conference: '1'
+ Channel: 'Local/egbert at default-.*'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Egbert Joined'
+ -
+ action-type: 'send-dtmf'
+ delay: '1'
+ dtmf: '*'
+ channel-id: 'Darnell'
+
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeLeave'
+ Conference: '1'
+ Channel: 'Local/egbert at default-.*'
+ ChanVariable: 'CONFBRIDGE_RESULT=KICKED'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Egbert Left (Kicked)'
+ -
+ action-type: 'hangup'
+ channel-id: 'Darnell'
+
+
+properties:
+ minversion: '13.0.0'
+ tags:
+ - confbridge
+ - apps
+ dependencies:
+ - python: 'twisted'
+ - python: 'starpy'
+ - asterisk: 'app_confbridge'
+ - asterisk: 'app_senddtmf'
+testinfo:
+ summary: 'Basic tests of CONFBRIDGE_STATUS channel variable'
+ description: |
+ 'Five channels are placed into a ConfBridge(). Each is removed from
+ the Confbridge in a way that results in their CONFBRIDGE_STATUS being
+ set to a different value. This ensures that the values are as expected.
+ Alice enters first. She has the endmarked option applied to him.
+ Bob attempts to enter next. He tries to use a non-existent user profile though.
+ Carol enters next. There is nothing special about her.
+ Darnell enters next. He is a marked user and an admin.
+ Egbert enters last. There is nothing special about him.
+ Darnell kicks Egbert from the conference.
+ Carol presses a DTMF sequence to exit the conference.
+ Darnell hangs up, causing Alice to be kicked from the conference.
+ In the end, their CONFBRIDGE_STATUS variables should be set as follows:
+ Alice: ENDMARKED
+ Bob: FAILED
+ Carol: DTMF
+ Darnell: HANGUP
+ Egbert: KICKED'
+
+test-modules:
+ test-object:
+ config-section: test-object-config
+ typename: 'apptest.AppTest'
+
+test-object-config:
+ app: 'ConfBridge'
+ scenarios:
+ -
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeStart'
+ Conference: '1'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Conference Started'
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeEnd'
+ Conference: '1'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Conference Ended'
+ -
+ action-type: 'end-scenario'
+ channels:
+ -
+ channel-id: 'Alice'
+ channel-name: 'Local/alice at default'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeJoin'
+ Conference: '1'
+ Channel: 'Local/alice at default-.*'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Alice Joined'
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeLeave'
+ Conference: '1'
+ Channel: 'Local/alice at default-.*'
+ ChanVariable: 'CONFBRIDGE_RESULT=ENDMARKED'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Alice Left (Endmarked)'
+ -
+ channel-id: 'Bob'
+ channel-name: 'Local/bob at default'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'Hangup'
+ Channel: 'Local/bob at default-.*'
+ ChanVariable: 'CONFBRIDGE_RESULT=FAILED'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Bob Failed to Join'
+
+ -
+ channel-id: 'Carol'
+ channel-name: 'Local/carol at default'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeJoin'
+ Conference: '1'
+ Channel: 'Local/carol at default-.*'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Carol Joined'
+ -
+ action-type: 'start-call'
+ channel-id: 'Darnell'
+ -
+ action-type: 'send-dtmf'
+ delay: '1'
+ dtmf: '*'
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeLeave'
+ Conference: '1'
+ Channel: 'Local/carol at default-.*'
+ ChanVariable: 'CONFBRIDGE_RESULT=DTMF'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Carol Left (DTMF)'
+ -
+ channel-id: 'Darnell'
+ channel-name: 'Local/darnell at default'
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeJoin'
+ Conference: '1'
+ Channel: 'Local/darnell at default-.*'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Darnell Joined'
+ -
+ action-type: 'start-call'
+ channel-id: 'Egbert'
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeLeave'
+ Conference: '1'
+ Channel: 'Local/darnell at default-.*'
+ ChanVariable: 'CONFBRIDGE_RESULT=HANGUP'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Darnell Left (Hangup)'
+ -
+ channel-id: 'Egbert'
+ channel-name: 'Local/egbert at default'
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeJoin'
+ Conference: '1'
+ Channel: 'Local/egbert at default-.*'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Egbert Joined'
+ -
+ action-type: 'send-dtmf'
+ delay: '1'
+ dtmf: '*'
+ channel-id: 'Darnell'
+
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'ConfbridgeLeave'
+ Conference: '1'
+ Channel: 'Local/egbert at default-.*'
+ ChanVariable: 'CONFBRIDGE_RESULT=KICKED'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Egbert Left (Kicked)'
+ -
+ action-type: 'hangup'
+ channel-id: 'Darnell'
+
+
+properties:
+ minversion: '13.0.0'
+ tags:
+ - confbridge
+ - apps
+ dependencies:
+ - python: 'twisted'
+ - python: 'starpy'
+ - asterisk: 'app_confbridge'
+ - asterisk: 'app_senddtmf'
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/apps/confbridge/confbridge_result/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/trunk/tests/apps/confbridge/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/confbridge/tests.yaml?view=diff&rev=4414&r1=4413&r2=4414
==============================================================================
--- asterisk/trunk/tests/apps/confbridge/tests.yaml (original)
+++ asterisk/trunk/tests/apps/confbridge/tests.yaml Mon Dec 9 11:32:59 2013
@@ -4,3 +4,4 @@
- test: 'confbridge_nominal'
- test: 'confbridge_recording'
- test: 'confbridge_dynamic_menus'
+ - test: 'confbridge_result'
More information about the asterisk-commits
mailing list