<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/19875">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_signal: Add tests for Signal and WaitForSignal<br><br>Adds tests for the Signal and WaitForSignal<br>applications to ensure proper functionality.<br><br>ASTERISK-29810<br><br>Change-Id: I314a7f704def5ecf2e4eac008aebfdc3077d08cd<br>---<br>A tests/apps/signal/configs/ast1/extensions.conf<br>A tests/apps/signal/test-config.yaml<br>M tests/apps/tests.yaml<br>3 files changed, 108 insertions(+), 0 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/apps/signal/configs/ast1/extensions.conf b/tests/apps/signal/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..c152104</span><br><span>--- /dev/null</span><br><span>+++ b/tests/apps/signal/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,32 @@</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,Signal(nothing)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,GotoIf($["${SIGNALSTATUS}"!="FAILURE"]?fail,1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Dial(Local/s@spawn-hangup,5)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,GotoIf($["${DIALSTATUS}"="TIMEOUT"]?fail,1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Originate(Local/1@spawn,app,Wait,5,,4)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Wait(1.${RAND(5,9)})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Signal(testsig1,payload1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,GotoIf($["${SIGNALSTATUS}"!="SUCCESS"]?fail,1)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Originate(Local/2@spawn,app,Wait,5,,4)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Originate(Local/2@spawn,app,Wait,5,,4)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Wait(1.${RAND(5,9)})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Signal(testsig2,payload2)</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%);">+[spawn-hangup]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => s,1,WaitForSignal(mysignal,2)</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%);">+[spawn]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => _[12],1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,WaitForSignal(testsig${EXTEN})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,UserEvent(SignalSuccess,Result: ${IF($["${WAITFORSIGNALSTATUS}"="SIGNALED"]?Pass:Failure)})</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,ExecIf($["${WAITFORSIGNALPAYLOAD}"!="payload${EXTEN}"]?UserEvent(SignalSuccess,Result:Failure))</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(10)</span><br><span style="color: hsl(120, 100%, 40%);">+ same => n,Hangup()</span><br><span>diff --git a/tests/apps/signal/test-config.yaml b/tests/apps/signal/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..675d76b</span><br><span>--- /dev/null</span><br><span>+++ b/tests/apps/signal/test-config.yaml</span><br><span>@@ -0,0 +1,61 @@</span><br><span style="color: hsl(120, 100%, 40%);">+testinfo:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Ensure that app_signal functions correctly.'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ 'This tests the Signal and WaitForSignal applications to make sure</span><br><span style="color: hsl(120, 100%, 40%);">+ that signaling works correctly. This includes sending signals when</span><br><span style="color: hsl(120, 100%, 40%);">+ there are listeners as well as when there aren't any listeners, as</span><br><span style="color: hsl(120, 100%, 40%);">+ well as sending optional payloads.'</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: 'SignalSuccess'</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: 3</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_signal'</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 f74ba8e..8ce8fac 100644</span><br><span>--- a/tests/apps/tests.yaml</span><br><span>+++ b/tests/apps/tests.yaml</span><br><span>@@ -30,3 +30,4 @@</span><br><span> - test: 'sf'</span><br><span> - test: 'read'</span><br><span> - test: 'if'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'signal'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/19875">change 19875</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/+/19875"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 20 </div>
<div style="display:none"> Gerrit-Change-Id: I314a7f704def5ecf2e4eac008aebfdc3077d08cd </div>
<div style="display:none"> Gerrit-Change-Number: 19875 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>