Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app_signal: Add tests for Signal and WaitForSignal
Adds tests for the Signal and WaitForSignal applications to ensure proper functionality. ASTERISK-29810 Change-Id: I314a7f704def5ecf2e4eac008aebfdc3077d08cd
- Loading branch information
1 parent
381c701
commit c36b6e0
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
[default] | ||
exten => s,1,Answer() | ||
same => n,Signal(nothing) | ||
same => n,GotoIf($["${SIGNALSTATUS}"!="FAILURE"]?fail,1) | ||
same => n,Dial(Local/s@spawn-hangup,5) | ||
same => n,GotoIf($["${DIALSTATUS}"="TIMEOUT"]?fail,1) | ||
same => n,Originate(Local/1@spawn,app,Wait,5,,4) | ||
same => n,Wait(1.${RAND(5,9)}) | ||
same => n,Signal(testsig1,payload1) | ||
same => n,GotoIf($["${SIGNALSTATUS}"!="SUCCESS"]?fail,1) | ||
same => n,Originate(Local/2@spawn,app,Wait,5,,4) | ||
same => n,Originate(Local/2@spawn,app,Wait,5,,4) | ||
same => n,Wait(1.${RAND(5,9)}) | ||
same => n,Signal(testsig2,payload2) | ||
same => n,Hangup() | ||
|
||
[spawn-hangup] | ||
exten => s,1,WaitForSignal(mysignal,2) | ||
same => n,Hangup() | ||
|
||
[spawn] | ||
exten => _[12],1,Answer() | ||
same => n,WaitForSignal(testsig${EXTEN}) | ||
same => n,UserEvent(SignalSuccess,Result: ${IF($["${WAITFORSIGNALSTATUS}"="SIGNALED"]?Pass:Failure)}) | ||
same => n,ExecIf($["${WAITFORSIGNALPAYLOAD}"!="payload${EXTEN}"]?UserEvent(SignalSuccess,Result:Failure)) | ||
same => n,Hangup() | ||
|
||
[nothing] | ||
exten => 0,1,Answer() | ||
same => n,Wait(10) | ||
same => n,Hangup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
testinfo: | ||
summary: 'Ensure that app_signal functions correctly.' | ||
description: | | ||
'This tests the Signal and WaitForSignal applications to make sure | ||
that signaling works correctly. This includes sending signals when | ||
there are listeners as well as when there aren't any listeners, as | ||
well as sending optional payloads.' | ||
test-modules: | ||
test-object: | ||
config-section: test-object-config | ||
typename: 'test_case.TestCaseModule' | ||
modules: | ||
- | ||
config-section: caller-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: hangup-monitor | ||
typename: 'pluggable_modules.HangupMonitor' | ||
- | ||
config-section: ami-config | ||
typename: 'pluggable_modules.EventActionModule' | ||
|
||
test-object-config: | ||
connect-ami: True | ||
|
||
caller-originator: | ||
channel: 'Local/s@default' | ||
context: 'nothing' | ||
exten: '0' | ||
priority: '1' | ||
trigger: 'ami_connect' | ||
|
||
hangup-monitor: | ||
ids: '0' | ||
|
||
ami-config: | ||
- | ||
ami-events: | ||
conditions: | ||
match: | ||
Event: 'UserEvent' | ||
UserEvent: 'SignalSuccess' | ||
requirements: | ||
match: | ||
Result: 'Pass' | ||
count: 3 | ||
stop_test: | ||
|
||
properties: | ||
tags: | ||
- dial | ||
- apps | ||
dependencies: | ||
- python: 'twisted' | ||
- python: 'starpy' | ||
- asterisk: 'app_dial' | ||
- asterisk: 'app_userevent' | ||
- asterisk: 'app_originate' | ||
- asterisk: 'app_signal' | ||
- asterisk: 'pbx_config' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ tests: | |
- test: 'sf' | ||
- test: 'read' | ||
- test: 'if' | ||
- test: 'signal' |