[asterisk-commits] jrose: testsuite/asterisk/trunk r4392 - in /asterisk/trunk/tests/apps: ./ dir...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Dec 2 11:21:38 CST 2013
Author: jrose
Date: Mon Dec 2 11:21:35 2013
New Revision: 4392
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4392
Log:
Testsuite: Add tests for DIRECTORY_RESULT variable being set by app_directory
Also reorganizes directory application tests to exist within a subdirectory of
the tests/apps directory.
Review: https://reviewboard.asterisk.org/r/3021/
Added:
asterisk/trunk/tests/apps/directory/
asterisk/trunk/tests/apps/directory/directory_attendant_exit/
- copied from r4344, asterisk/trunk/tests/apps/directory_attendant_exit/
asterisk/trunk/tests/apps/directory/directory_context_operator_exit/
- copied from r4344, asterisk/trunk/tests/apps/directory_context_operator_exit/
asterisk/trunk/tests/apps/directory/directory_operator_exit/
- copied from r4344, asterisk/trunk/tests/apps/directory_operator_exit/
asterisk/trunk/tests/apps/directory/directory_result/
asterisk/trunk/tests/apps/directory/directory_result/configs/
asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/
asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/users.conf (with props)
asterisk/trunk/tests/apps/directory/directory_result/test-config.yaml (with props)
asterisk/trunk/tests/apps/directory/tests.yaml (with props)
Removed:
asterisk/trunk/tests/apps/directory_attendant_exit/
asterisk/trunk/tests/apps/directory_context_operator_exit/
asterisk/trunk/tests/apps/directory_operator_exit/
Modified:
asterisk/trunk/tests/apps/tests.yaml
Added: asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/extensions.conf?view=auto&rev=4392
==============================================================================
--- asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/extensions.conf Mon Dec 2 11:21:35 2013
@@ -1,0 +1,80 @@
+; Confbridge contexts and extensions
+
+[directory]
+exten => standard,1,NoOp()
+ same => n,Directory()
+
+exten => timeout,1,NoOp()
+ same => n,Answer()
+ same => n,Goto(standard,1)
+
+exten => operator,1,NoOp()
+ same => n,Answer()
+ same => n,UserEvent(QueueOperator)
+ same => n,Goto(standard,1)
+
+exten => assistant,1,NoOp()
+ same => n,Answer()
+ same => n,UserEvent(QueueAssistant)
+ same => n,Goto(standard,1)
+
+exten => select,1,NoOp()
+ same => n,Answer()
+ same => n,UserEvent(QueueSelect)
+ same => n,Goto(standard,1)
+
+exten => exit,1,NoOp()
+ same => n,Answer()
+ same => n,UserEvent(QueueExit)
+ same => n,Goto(standard,1)
+
+exten => hangup,1,NoOp()
+ same => n,Answer()
+ same => n,UserEvent(QueueHangup)
+ same => n,Goto(standard,1)
+
+exten => failselect,1,NoOp()
+ same => n,Answer()
+ same => n,UserEvent(QueueSelect)
+ same => n,Directory(,bogocontext)
+
+exten => h,1,NoOp()
+ same => n,UserEvent(TestStatus,Status: ${DIRECTORY_RESULT})
+
+exten => o,1,NoOp()
+ same => n,UserEvent(OperatorExtension)
+
+exten => a,1,NoOp()
+ same => n,UserEvent(AssistantExtension)
+
+exten => 2020,1,NoOp()
+ same => n,UserEvent(DogExtension)
+
+[default]
+
+exten => 2020,1,NoOp()
+ same => n,goto(directory,2020,1)
+
+exten => sendDTMF,1,NoOp()
+ same => n,Verbose(1, Sending DTMF Signal ${DTMF_TO_SEND})
+ same => n,SendDTMF(${DTMF_TO_SEND})
+ same => n,Goto(wait,1)
+
+exten => sendAudio,1,NoOp()
+ same => n,Verbose(1, Sending audio file ${TALK_AUDIO})
+ same => n,Playback(${TALK_AUDIO})
+ same => n,Goto(wait,1)
+
+exten => sendAudioWithDTMF,1,NoOp()
+ same => n,Verbose(1, Sending audio file ${TALK_AUDIO})
+ same => n,Playback(${TALK_AUDIO})
+ same => n,Verbose(1, Sending DTMF Signal ${DTMF_TO_SEND})
+ same => n,SendDTMF(${DTMF_TO_SEND})
+ same => n,Goto(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/directory/directory_result/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/users.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/users.conf?view=auto&rev=4392
==============================================================================
--- asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/users.conf (added)
+++ asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/users.conf Mon Dec 2 11:21:35 2013
@@ -1,0 +1,5 @@
+[2020]
+fullname=Dog Dog
+description=easy test DTMF string with no overlaps - 364
+userbase=2020
+hasdirectory=true
Propchange: asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/users.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/users.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/apps/directory/directory_result/configs/ast1/users.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/apps/directory/directory_result/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directory/directory_result/test-config.yaml?view=auto&rev=4392
==============================================================================
--- asterisk/trunk/tests/apps/directory/directory_result/test-config.yaml (added)
+++ asterisk/trunk/tests/apps/directory/directory_result/test-config.yaml Mon Dec 2 11:21:35 2013
@@ -1,0 +1,315 @@
+testinfo:
+ summary: 'Test DIRECTORY_RESULT for common routes through app_directory.'
+ description: |
+ Tests common usage of the directory app to make sure the correct value
+ for channel variable DIRECTORY_RESULT is set in each of the following
+ conditions
+ * User allows directory application to timeout from initial prompt
+ * User issues DTMF '0' for operator
+ * User issues DTMF '*' for assistant
+ * User selects item from the directory and issues DTMF '1' to connect
+ * User selects item from the directory and issues DTMF '#' to exit
+ * User hangs up the phone at at the initial prompt
+ * User selects item from the directory and issues DTMF '1' to connect,
+ but can not connect because the extension is not in the dialplan at
+ the requested context
+
+test-modules:
+ test-object:
+ config-section: test-object-config
+ typename: 'apptest.AppTest'
+
+test-object-config:
+ app: 'Directory'
+ scenarios:
+ # Phase 0: Timeout
+ -
+ channels:
+ -
+ channel-id: 'timeoutchan'
+ channel-name: 'LOCAL/timeout at directory'
+ context: 'default'
+ exten: 'wait'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'TestStatus'
+ Status: 'TIMEOUT'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 0: Success'
+ -
+ action-type: 'end-scenario'
+ # Phase 1: Operator
+ -
+ channels:
+ -
+ channel-id: 'operatorchan'
+ channel-name: 'LOCAL/operator at directory'
+ context: 'default'
+ exten: 'wait'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'QueueOperator'
+ Channel: 'Local/operator at directory-.*'
+ actions:
+ # select to go to operator
+ -
+ action-type: 'send-dtmf'
+ delay: '1'
+ dtmf: '0'
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 1 - Send DTMF'
+
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'TestStatus'
+ Status: 'OPERATOR'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 1: Success'
+ -
+ action-type: 'end-scenario'
+ # Phase 2: Assistant
+ -
+ channels:
+ -
+ channel-id: 'assistantchan'
+ channel-name: 'LOCAL/assistant at directory'
+ context: 'default'
+ exten: 'wait'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'QueueAssistant'
+ Channel: 'Local/assistant at directory-.*'
+ actions:
+ # select to go to assistant
+ -
+ action-type: 'send-dtmf'
+ delay: '1'
+ dtmf: '*'
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 2 - Send DTMF'
+
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'TestStatus'
+ Status: 'ASSISTANT'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 2: Success'
+ -
+ action-type: 'end-scenario'
+ # Phase 3: Select
+ -
+ channels:
+ -
+ channel-id: 'selectchan'
+ channel-name: 'LOCAL/select at directory'
+ context: 'default'
+ exten: 'wait'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'QueueSelect'
+ Channel: 'Local/select at directory-.*'
+ actions:
+ # select user 'dog'
+ -
+ action-type: 'send-dtmf'
+ delay: '1'
+ dtmf: '364'
+ # choose to direct to selected user
+ -
+ action-type: 'send-dtmf'
+ delay: '4'
+ dtmf: '1'
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 3 - Send DTMF'
+
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'TestStatus'
+ Status: 'SELECTED'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 3: Success'
+ -
+ action-type: 'end-scenario'
+ # Phase 4: Exit
+ -
+ channels:
+ -
+ channel-id: 'exitchan'
+ channel-name: 'LOCAL/exit at directory'
+ context: 'default'
+ exten: 'wait'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'QueueExit'
+ Channel: 'Local/exit at directory-.*'
+ actions:
+ # select user 'dog'
+ -
+ action-type: 'send-dtmf'
+ delay: '1'
+ dtmf: '364'
+ # Exit with '#'
+ -
+ action-type: 'send-dtmf'
+ delay: '4'
+ dtmf: '#'
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 4 - Send DTMF'
+
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'TestStatus'
+ Status: 'USEREXIT'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 4: Success'
+ -
+ action-type: 'end-scenario'
+ # Phase 5: Hangup
+ -
+ channels:
+ -
+ channel-id: 'hangupchan'
+ channel-name: 'LOCAL/hangup at directory'
+ context: 'default'
+ exten: 'wait'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'QueueHangup'
+ Channel: 'Local/hangup at directory-.*'
+ actions:
+ # Hangup. Just Hangup.
+ -
+ action-type: 'hangup'
+ delay: '1'
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 5 - Hang that Crap up.'
+
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'TestStatus'
+ Status: 'HANGUP'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 5: Success'
+ -
+ action-type: 'end-scenario'
+ # Phase 6: Fail due to extension not existing at the selected directory context
+ -
+ channels:
+ -
+ channel-id: 'failselectchan'
+ channel-name: 'LOCAL/failselect at directory'
+ context: 'default'
+ exten: 'wait'
+ start-on-create: True
+ events:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'QueueSelect'
+ Channel: 'Local/failselect at directory-.*'
+ actions:
+ # select user 'dog'
+ -
+ action-type: 'send-dtmf'
+ delay: '1'
+ dtmf: '364'
+ # choose to direct to selected user
+ -
+ action-type: 'send-dtmf'
+ delay: '4'
+ dtmf: '1'
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 6 - Send DTMF'
+
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'TestStatus'
+ Status: 'FAILED'
+ actions:
+ -
+ action-type: 'set-expected-result'
+ expected-result: 'Phase 6: Success'
+ -
+ action-type: 'end-scenario'
+
+properties:
+ minversion: '13.0.0'
+ tags:
+ - apps
+ - directory
+ dependencies:
+ - buildoption: 'TEST_FRAMEWORK'
+ - python : 'twisted'
+ - python : 'starpy'
+ - asterisk : 'app_directory'
+ - asterisk : 'app_senddtmf'
+ - asterisk : 'app_playback'
+
Propchange: asterisk/trunk/tests/apps/directory/directory_result/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/apps/directory/directory_result/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/apps/directory/directory_result/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/apps/directory/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/directory/tests.yaml?view=auto&rev=4392
==============================================================================
--- asterisk/trunk/tests/apps/directory/tests.yaml (added)
+++ asterisk/trunk/tests/apps/directory/tests.yaml Mon Dec 2 11:21:35 2013
@@ -1,0 +1,6 @@
+# Enter tests here in the order they should be considered for execution:
+tests:
+ - test: 'directory_operator_exit'
+ - test: 'directory_context_operator_exit'
+ - test: 'directory_attendant_exit'
+ - test: 'directory_result'
Propchange: asterisk/trunk/tests/apps/directory/tests.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/apps/directory/tests.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/apps/directory/tests.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/trunk/tests/apps/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/tests.yaml?view=diff&rev=4392&r1=4391&r2=4392
==============================================================================
--- asterisk/trunk/tests/apps/tests.yaml (original)
+++ asterisk/trunk/tests/apps/tests.yaml Mon Dec 2 11:21:35 2013
@@ -1,8 +1,6 @@
# Enter tests here in the order they should be considered for execution:
tests:
- - test: 'directory_operator_exit'
- - test: 'directory_context_operator_exit'
- - test: 'directory_attendant_exit'
+ - dir: 'directory'
- dir: 'bridge'
- dir: 'dial'
- dir: 'voicemail'
More information about the asterisk-commits
mailing list