[Asterisk-code-review] app_confbridge: Tests for user answer_channel (testsuite[18])
N A
asteriskteam at digium.com
Tue Jun 1 17:42:22 CDT 2021
N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/16006 )
Change subject: app_confbridge: Tests for user answer_channel
......................................................................
app_confbridge: Tests for user answer_channel
This tests the operation of the new answer_channel
user option and ensures that the default behavior
has not changed.
ASTERISK-29440
Change-Id: Ib150939cd806c842c49dbc4be5b56d0fb5e962d4
---
A tests/apps/confbridge/confbridge_noanswer/configs/ast1/confbridge.conf
A tests/apps/confbridge/confbridge_noanswer/configs/ast1/extensions.conf
A tests/apps/confbridge/confbridge_noanswer/test-config.yaml
M tests/apps/confbridge/tests.yaml
4 files changed, 114 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/06/16006/1
diff --git a/tests/apps/confbridge/confbridge_noanswer/configs/ast1/confbridge.conf b/tests/apps/confbridge/confbridge_noanswer/configs/ast1/confbridge.conf
new file mode 100644
index 0000000..8883ccc
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_noanswer/configs/ast1/confbridge.conf
@@ -0,0 +1,16 @@
+[user_noanswer]
+type=user
+answer_channel=no
+timeout=5
+
+[user_answer]
+type=user
+answer_channel=yes
+timeout=5
+
+[default_user]
+type=user
+timeout=5
+
+[default_bridge]
+type=bridge
diff --git a/tests/apps/confbridge/confbridge_noanswer/configs/ast1/extensions.conf b/tests/apps/confbridge/confbridge_noanswer/configs/ast1/extensions.conf
new file mode 100644
index 0000000..07232ae
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_noanswer/configs/ast1/extensions.conf
@@ -0,0 +1,25 @@
+[default]
+exten => noanswer,1,Answer()
+ same => n,Dial(Local/noanswer at conf/n,4,g)
+ same => n,GotoIf($["${DIALSTATUS}"="NOANSWER"]?pass,1:fail,1)
+exten => answer,1,Answer()
+ same => n,Dial(Local/answer at conf/n,4,g)
+ same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?pass,1:fail,1)
+exten => default,1,Answer()
+ same => n,Dial(Local/default at conf/n,4,g)
+ same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?pass,1:fail,1)
+exten => fail,1,UserEvent(ConfBridgeNoAnswer,Result: Fail,Reason: ${DIALSTATUS})
+ same => n,Hangup()
+exten => pass,1,UserEvent(ConfBridgeNoAnswer,Result: Pass)
+ same => n,Hangup()
+
+[conf]
+exten => noanswer,1,Progress()
+ same => n,ConfBridge(test,,user_noanswer)
+ same => n,Hangup()
+exten => answer,1,Progress()
+ same => n,ConfBridge(test,,user_answer)
+ same => n,Hangup()
+exten => default,1,Progress()
+ same => n,ConfBridge(test)
+ same => n,Hangup()
diff --git a/tests/apps/confbridge/confbridge_noanswer/test-config.yaml b/tests/apps/confbridge/confbridge_noanswer/test-config.yaml
new file mode 100644
index 0000000..7bccdd7
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_noanswer/test-config.yaml
@@ -0,0 +1,72 @@
+testinfo:
+ summary: 'Ensure that Confbridge user no answer option works as expected'
+ description: |
+ 'This test configures ConfBridge user profiles with all combinations of
+ answer_channel options. We expect that a call to noanswer will not
+ be answered and calls to answer and default will be answered. We also
+ test that the default behavior remains unchanged.'
+
+test-modules:
+ test-object:
+ config-section: test-object-config
+ typename: 'test_case.TestCaseModule'
+ modules:
+ -
+ config-section: noanswer-originator
+ typename: 'pluggable_modules.Originator'
+ -
+ config-section: answer-originator
+ typename: 'pluggable_modules.Originator'
+ -
+ config-section: default-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
+
+noanswer-originator:
+ channel: 'Local/noanswer at default'
+ application: 'Echo'
+ trigger: 'ami_connect'
+
+answer-originator:
+ channel: 'Local/answer at default'
+ application: 'Echo'
+ trigger: 'ami_connect'
+
+default-originator:
+ channel: 'Local/default at default'
+ application: 'Echo'
+ trigger: 'ami_connect'
+
+hangup-monitor:
+ ids: '0'
+
+ami-config:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'UserEvent'
+ UserEvent: 'ConfBridgeNoAnswer'
+ requirements:
+ match:
+ Result: 'Pass'
+ count: 3
+
+
+properties:
+ tags:
+ - confbridge
+ - apps
+ dependencies:
+ - python: 'twisted'
+ - python: 'starpy'
+ - asterisk: 'app_confbridge'
+ - asterisk: 'app_userevent'
diff --git a/tests/apps/confbridge/tests.yaml b/tests/apps/confbridge/tests.yaml
index ccf2505..8d65c7a 100644
--- a/tests/apps/confbridge/tests.yaml
+++ b/tests/apps/confbridge/tests.yaml
@@ -4,6 +4,7 @@
- test: 'confbridge_end_marked'
- test: 'confbridge_marked'
- test: 'confbridge_marked_unmarked'
+ - test: 'confbridge_noanswer'
- test: 'confbridge_nominal'
- test: 'confbridge_recording'
- test: 'confbridge_result'
--
To view, visit https://gerrit.asterisk.org/c/testsuite/+/16006
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: 18
Gerrit-Change-Id: Ib150939cd806c842c49dbc4be5b56d0fb5e962d4
Gerrit-Change-Number: 16006
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210601/b847d67c/attachment-0001.html>
More information about the asterisk-code-review
mailing list