Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app_confbridge: Test for ConfKick application
This tests the new ConfKick application to ensure that it correctly manipulates the bridge with different parameters. ASTERISK-29446 Change-Id: Ia85d6190ab3cf88a7cc4b3071a38dee191bc8898
- Loading branch information
1 parent
7cf20a2
commit 6009a93
Showing
4 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
tests/apps/confbridge/confbridge_confkick/configs/ast1/confbridge.conf
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,6 @@ | ||
[default_user] | ||
type=user | ||
quiet=yes | ||
|
||
[default_bridge] | ||
type=bridge |
31 changes: 31 additions & 0 deletions
31
tests/apps/confbridge/confbridge_confkick/configs/ast1/extensions.conf
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,31 @@ | ||
[default] | ||
exten => user1,1,Answer() | ||
same => n,ConfBridge(test123) | ||
same => n,GotoIf($["${CONFBRIDGE_RESULT}"="KICKED"]?pass,1:fail,1) | ||
exten => user2,1,Answer() | ||
same => n,Set(GLOBAL(test123user)=${CHANNEL}) | ||
same => n,ConfBridge(test123) | ||
same => n,GotoIf($["${CONFBRIDGE_RESULT}"="KICKED"]?pass,1:fail,1) | ||
exten => user3,1,Answer() | ||
same => n,ConfBridge(test123) | ||
same => n,GotoIf($["${CONFBRIDGE_RESULT}"="KICKED"]?pass,1:fail,1) | ||
exten => admin,1,Answer() | ||
same => n,Set(CONFBRIDGE(user,admin)=yes) | ||
same => n,ConfBridge(test123) | ||
same => n,GotoIf($["${CONFBRIDGE_RESULT}"="KICKED"]?pass,1:fail,1) | ||
exten => kicker,1,Answer(1) | ||
same => n,ExecIf($[${CONFBRIDGE_INFO(parties,test123)}=4]?UserEvent(ConfKickSuccess,Result: Pass):UserEvent(ConfKickSuccess,Result: Fail,Reason: ${CONFBRIDGE_INFO(parties,test123)})) | ||
same => n,ConfKick(test123,${test123user}) | ||
same => n,Wait(0.1) | ||
same => n,ExecIf($[${CONFBRIDGE_INFO(parties,test123)}=3]?UserEvent(ConfKickSuccess,Result: Pass):UserEvent(ConfKickSuccess,Result: Fail,Reason: ${CONFBRIDGE_INFO(parties,test123)})) | ||
same => n,ConfKick(test123,participants) | ||
same => n,Wait(0.1) | ||
same => n,ExecIf($[${CONFBRIDGE_INFO(parties,test123)}=1]?UserEvent(ConfKickSuccess,Result: Pass):UserEvent(ConfKickSuccess,Result: Fail,Reason: ${CONFBRIDGE_INFO(parties,test123)})) | ||
same => n,ConfKick(test123,all) | ||
same => n,Wait(0.1) | ||
same => n,ExecIf($[${CONFBRIDGE_INFO(parties,test123)}=0]?UserEvent(ConfKickSuccess,Result: Pass):UserEvent(ConfKickSuccess,Result: Fail,Reason: ${CONFBRIDGE_INFO(parties,test123)})) | ||
same => n,Hangup() | ||
exten => fail,1,UserEvent(ConfBridgeKick,Result: Fail,Reason: ${CONFBRIDGE_RESULT}) | ||
same => n,Hangup() | ||
exten => pass,1,UserEvent(ConfBridgeKick,Result: Pass) | ||
same => n,Hangup() |
96 changes: 96 additions & 0 deletions
96
tests/apps/confbridge/confbridge_confkick/test-config.yaml
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,96 @@ | ||
testinfo: | ||
summary: 'Ensure that ConfKick application works as expected' | ||
description: | | ||
'This test ensures that ConfKick functions as expected by | ||
testing that specific, non-admin, and all participants can | ||
be successfully kicked from the bridge.' | ||
test-modules: | ||
test-object: | ||
config-section: test-object-config | ||
typename: 'test_case.TestCaseModule' | ||
modules: | ||
- | ||
config-section: user1-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: user2-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: user3-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: admin-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: kicker-originator | ||
typename: 'pluggable_modules.Originator' | ||
- | ||
config-section: hangup-monitor | ||
typename: 'pluggable_modules.HangupMonitor' | ||
- | ||
config-section: ami-config | ||
typename: 'ami.AMIEventModule' | ||
|
||
test-object-config: | ||
connect-ami: True | ||
|
||
user1-originator: | ||
channel: 'Local/user1@default' | ||
application: 'Echo' | ||
trigger: 'ami_connect' | ||
|
||
user2-originator: | ||
channel: 'Local/user2@default' | ||
application: 'Echo' | ||
trigger: 'ami_connect' | ||
|
||
user3-originator: | ||
channel: 'Local/user3@default' | ||
application: 'Echo' | ||
trigger: 'ami_connect' | ||
|
||
admin-originator: | ||
channel: 'Local/admin@default' | ||
application: 'Echo' | ||
trigger: 'ami_connect' | ||
|
||
kicker-originator: | ||
channel: 'Local/kicker@default' | ||
application: 'Echo' | ||
trigger: 'ami_connect' | ||
|
||
hangup-monitor: | ||
ids: '0' | ||
|
||
ami-config: | ||
- | ||
type: 'headermatch' | ||
conditions: | ||
match: | ||
Event: 'UserEvent' | ||
UserEvent: 'ConfBridgeKick' | ||
requirements: | ||
match: | ||
Result: 'Pass' | ||
count: 4 | ||
- | ||
type: 'headermatch' | ||
conditions: | ||
match: | ||
Event: 'UserEvent' | ||
UserEvent: 'ConfKickSuccess' | ||
requirements: | ||
match: | ||
Result: 'Pass' | ||
count: 4 | ||
|
||
properties: | ||
tags: | ||
- confbridge | ||
- apps | ||
dependencies: | ||
- python: 'twisted' | ||
- python: 'starpy' | ||
- asterisk: 'app_confbridge' | ||
- asterisk: 'app_userevent' |
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