<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/17593">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_mf: Add tests for app_mf module<br><br>Adds tests for the following functionality:<br>- SendMF application<br>- ReceiveMF application<br>- Dial D MF option<br><br>Change-Id: I95a20b869933afc3fb43b6f31e81811d3a913494<br>---<br>A tests/apps/mf/configs/ast1/extensions.conf<br>A tests/apps/mf/test-config.yaml<br>M tests/apps/tests.yaml<br>3 files changed, 104 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/93/17593/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/apps/mf/configs/ast1/extensions.conf b/tests/apps/mf/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..5093bbb</span><br><span>--- /dev/null</span><br><span>+++ b/tests/apps/mf/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,44 @@</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%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => s,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,MSet(GLOBAL(sendmf1)=*123#)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,MSet(GLOBAL(sendmf2)=*123A)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,MSet(GLOBAL(sendmf3)=**123#)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,MSet(GLOBAL(sendmf4)=*1254*123#)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,MSet(GLOBAL(sendmf5)=*009####)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Set(i=0)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,While($[${INC(i)}<=5])</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Originate(Local/${i}@send-mf,exten,receive-mf,${i},1,,a)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,EndWhile()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Dial(Local/6@receive-mf,,D(:::*987#))</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%);">+[nothing]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => 0,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Wait(8)</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%);">+[send-mf]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => _X!,1,Answer(0.5)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,SendMF(${sendmf${EXTEN}})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Wait(99) ; needed so ReceiveMF has time to finish.</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%);">+[receive-mf]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => _X!,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,ReceiveMF(digits)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,GotoIf($["${digits}"="${sendmf${EXTEN}}"]?success,1:fail,1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => 5,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,ReceiveMF(digits)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,GotoIf($["${digits}"="*009#"]?success,1:fail,1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => 6,1,Progress()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,ReceiveMF(digits,,kos)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,GotoIf($["${digits}"="987"]?success,1:fail,1)</span><br><span style="color: hsl(120, 100%, 40%);">+exten => success,1,Answer(1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(ReceiveMFSuccess,Result: Pass)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span style="color: hsl(120, 100%, 40%);">+exten => fail,1,Answer(1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(ReceiveMFSuccess,Result: Fail ${RECEIVEMFSTATUS} ${digits},Reason: ${digits})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span>diff --git a/tests/apps/mf/test-config.yaml b/tests/apps/mf/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..83b2fda</span><br><span>--- /dev/null</span><br><span>+++ b/tests/apps/mf/test-config.yaml</span><br><span>@@ -0,0 +1,59 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Ensure that app_mf module functions correctly.'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'This tests the SendMF and ReceiveMF applications as</span><br><span style="color: hsl(120, 100%, 40%);">+ well as Dial D option work correctly.'</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: 'test_case.TestCaseModule'</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: caller-originator</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.Originator'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: hangup-monitor</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.HangupMonitor'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</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%);">+ connect-ami: True</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+caller-originator:</span><br><span style="color: hsl(120, 100%, 40%);">+ channel: 'Local/s@default'</span><br><span style="color: hsl(120, 100%, 40%);">+ context: 'nothing'</span><br><span style="color: hsl(120, 100%, 40%);">+ exten: '0'</span><br><span style="color: hsl(120, 100%, 40%);">+ priority: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ trigger: 'ami_connect'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+hangup-monitor:</span><br><span style="color: hsl(120, 100%, 40%);">+ ids: '0'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</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: 'ReceiveMFSuccess'</span><br><span style="color: hsl(120, 100%, 40%);">+ requirements:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Result: 'Pass'</span><br><span style="color: hsl(120, 100%, 40%);">+ count: 6</span><br><span style="color: hsl(120, 100%, 40%);">+ stop_test:</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%);">+ - dial</span><br><span style="color: hsl(120, 100%, 40%);">+ - apps</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</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_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'app_userevent'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'app_originate'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'app_mf'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk: 'pbx_config'</span><br><span>diff --git a/tests/apps/tests.yaml b/tests/apps/tests.yaml</span><br><span>index a00c9d1..4f15191 100644</span><br><span>--- a/tests/apps/tests.yaml</span><br><span>+++ b/tests/apps/tests.yaml</span><br><span>@@ -26,3 +26,4 @@</span><br><span> - dir: 'statsd'</span><br><span> - test: 'waitdigit'</span><br><span> - dir: 'sendtext'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'mf'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/17593">change 17593</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/+/17593"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I95a20b869933afc3fb43b6f31e81811d3a913494 </div>
<div style="display:none"> Gerrit-Change-Number: 17593 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>