<p>Michael Bradeen has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/19869">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_directory: add test for ability to specify configuration file<br><br>Adds new test for the ability to read a voicemail.conf style<br>configuration file separate from voicemail.conf:<br><br>apps/directory/directory_file<br><br>ASTERISK-30404<br><br>Change-Id: I03b68d3e106b6c8829eb8437209c34ff17256f9b<br>(cherry picked from commit 2662c8de3e3b5972b8c2217350ffc158ae93c5cb)<br>---<br>A tests/apps/directory/directory_file/configs/ast1/directory.conf<br>A tests/apps/directory/directory_file/configs/ast1/extensions.conf<br>A tests/apps/directory/directory_file/test-config.yaml<br>M tests/apps/directory/tests.yaml<br>4 files changed, 173 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/69/19869/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/apps/directory/directory_file/configs/ast1/directory.conf b/tests/apps/directory/directory_file/configs/ast1/directory.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..0c5eefe</span><br><span>--- /dev/null</span><br><span>+++ b/tests/apps/directory/directory_file/configs/ast1/directory.conf</span><br><span>@@ -0,0 +1,2 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+2020=2020,Dog Dog,,,,attach=no|saycid=no|envelope=no|delete=no</span><br><span>diff --git a/tests/apps/directory/directory_file/configs/ast1/extensions.conf b/tests/apps/directory/directory_file/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..a70d1f3</span><br><span>--- /dev/null</span><br><span>+++ b/tests/apps/directory/directory_file/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,80 @@</span><br><span style="color: hsl(120, 100%, 40%);">+; Confbridge contexts and extensions</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[directory]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => standard,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Directory(,,c(directory.conf))</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => timeout,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Goto(standard,1)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => operator,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(QueueOperator)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Goto(standard,1)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => assistant,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(QueueAssistant)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Goto(standard,1)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => select,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(QueueSelect)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Goto(standard,1)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => exit,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(QueueExit)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Goto(standard,1)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => hangup,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(QueueHangup)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Goto(standard,1)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => failselect,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(QueueSelect)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Directory(,bogocontext,c(directory.conf))</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => h,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(TestStatus,Status: ${DIRECTORY_RESULT})</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => o,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(OperatorExtension)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => a,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(AssistantExtension)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => 2020,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(DogExtension)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => 2020,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,goto(directory,2020,1)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => sendDTMF,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Verbose(1, Sending DTMF Signal ${DTMF_TO_SEND})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,SendDTMF(${DTMF_TO_SEND})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Goto(wait,1)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => sendAudio,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Verbose(1, Sending audio file ${TALK_AUDIO})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Playback(${TALK_AUDIO})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Goto(wait,1)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => sendAudioWithDTMF,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Verbose(1, Sending audio file ${TALK_AUDIO})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Playback(${TALK_AUDIO})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Verbose(1, Sending DTMF Signal ${DTMF_TO_SEND})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,SendDTMF(${DTMF_TO_SEND})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Goto(wait,1)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => hangup,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Verbose(1, Hanging up)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exten => wait,1,NoOp()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Wait(10000)</span><br><span>diff --git a/tests/apps/directory/directory_file/test-config.yaml b/tests/apps/directory/directory_file/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..ef04ae8</span><br><span>--- /dev/null</span><br><span>+++ b/tests/apps/directory/directory_file/test-config.yaml</span><br><span>@@ -0,0 +1,73 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test that app_directory can read from a specified conf file.'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ Tests that directory app can read extension configuration from a</span><br><span style="color: hsl(120, 100%, 40%);">+ specified file, in this test 'directory.conf'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'apptest.AppTest'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ app: 'Directory'</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ # Send DTMF for extension's name</span><br><span style="color: hsl(120, 100%, 40%);">+ channels:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ channel-id: 'selectchan'</span><br><span style="color: hsl(120, 100%, 40%);">+ channel-name: 'LOCAL/select@directory'</span><br><span style="color: hsl(120, 100%, 40%);">+ context: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ exten: 'wait'</span><br><span style="color: hsl(120, 100%, 40%);">+ start-on-create: True</span><br><span style="color: hsl(120, 100%, 40%);">+ events:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'UserEvent'</span><br><span style="color: hsl(120, 100%, 40%);">+ UserEvent: 'QueueSelect'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'Local/select@directory-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ # select user 'dog'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ action-type: 'send-dtmf'</span><br><span style="color: hsl(120, 100%, 40%);">+ delay: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ dtmf: '364'</span><br><span style="color: hsl(120, 100%, 40%);">+ # choose to direct to selected user</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ action-type: 'send-dtmf'</span><br><span style="color: hsl(120, 100%, 40%);">+ delay: '4'</span><br><span style="color: hsl(120, 100%, 40%);">+ dtmf: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ action-type: 'set-expected-result'</span><br><span style="color: hsl(120, 100%, 40%);">+ expected-result: 'Send DTMF'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'UserEvent'</span><br><span style="color: hsl(120, 100%, 40%);">+ UserEvent: 'TestStatus'</span><br><span style="color: hsl(120, 100%, 40%);">+ Status: 'SELECTED'</span><br><span style="color: hsl(120, 100%, 40%);">+ actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ action-type: 'set-expected-result'</span><br><span style="color: hsl(120, 100%, 40%);">+ expected-result: 'Success'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - apps</span><br><span style="color: hsl(120, 100%, 40%);">+ - directory</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - buildoption: 'TEST_FRAMEWORK'</span><br><span style="color: hsl(120, 100%, 40%);">+ - python : 'twisted'</span><br><span style="color: hsl(120, 100%, 40%);">+ - python : 'starpy'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_directory'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_playback'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_senddtmf'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_userevent'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_verbose'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'pbx_config'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/apps/directory/tests.yaml b/tests/apps/directory/tests.yaml</span><br><span>index c895480..1c9ce7a 100644</span><br><span>--- a/tests/apps/directory/tests.yaml</span><br><span>+++ b/tests/apps/directory/tests.yaml</span><br><span>@@ -4,3 +4,4 @@</span><br><span> - test: 'directory_context_operator_exit'</span><br><span> - test: 'directory_attendant_exit'</span><br><span> - test: 'directory_result'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'directory_file'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/19869">change 19869</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/testsuite/+/19869"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: certified/18.9 </div>
<div style="display:none"> Gerrit-Change-Id: I03b68d3e106b6c8829eb8437209c34ff17256f9b </div>
<div style="display:none"> Gerrit-Change-Number: 19869 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Michael Bradeen <mbradeen@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>