[Asterisk-code-review] Test app confbridge user mute status starting in a muted con... (testsuite[master])

Richard Mudgett asteriskteam at digium.com
Thu Feb 4 20:16:38 CST 2016


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/2202

Change subject: Test app_confbridge user mute status starting in a muted conference.
......................................................................

Test app_confbridge user mute status starting in a muted conference.

Test the mute status of a user entering an app_confbridge conference when
the conference is not muted and when it is muted.

ASTERISK-20987
Reported by: hristo

Change-Id: I5c57f59266bfb17ea7534a35283db48ef479617a
---
A tests/apps/confbridge/muted_conference_start_muted/configs/ast1/confbridge.conf
A tests/apps/confbridge/muted_conference_start_muted/configs/ast1/extensions.conf
A tests/apps/confbridge/muted_conference_start_muted/test-config.yaml
M tests/apps/confbridge/tests.yaml
4 files changed, 273 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/02/2202/1

diff --git a/tests/apps/confbridge/muted_conference_start_muted/configs/ast1/confbridge.conf b/tests/apps/confbridge/muted_conference_start_muted/configs/ast1/confbridge.conf
new file mode 100644
index 0000000..a2ee46a
--- /dev/null
+++ b/tests/apps/confbridge/muted_conference_start_muted/configs/ast1/confbridge.conf
@@ -0,0 +1,13 @@
+[default_bridge]
+type=bridge
+
+[default_user]
+type=user
+
+[admin_user]
+type=user
+admin=yes
+
+[admin_menu]
+type=menu
+5=admin_toggle_mute_participants
diff --git a/tests/apps/confbridge/muted_conference_start_muted/configs/ast1/extensions.conf b/tests/apps/confbridge/muted_conference_start_muted/configs/ast1/extensions.conf
new file mode 100644
index 0000000..9b099ba
--- /dev/null
+++ b/tests/apps/confbridge/muted_conference_start_muted/configs/ast1/extensions.conf
@@ -0,0 +1,27 @@
+[default]
+; Required extensions for apptest.AppTest test object.
+exten => sendDTMF,1,NoOp()
+same => n,Verbose(1,Sending DTMF Signal ${DTMF_TO_SEND})
+same => n,SendDTMF(${DTMF_TO_SEND})
+same => n,Goto(default,wait,1)
+
+exten => hangup,1,NoOp()
+same => n,Verbose(1,Hanging up)
+same => n,Hangup()
+
+exten => wait,1,NoOp()
+same => n,Wait(10000)
+same => n,Hangup()
+
+; Conference users
+exten => alice,1,NoOp()
+same => n,ConfBridge(1,,admin_user,admin_menu)
+same => n,Hangup()
+
+exten => bob,1,NoOp()
+same => n,ConfBridge(1)
+same => n,Hangup()
+
+exten => carol,1,NoOp()
+same => n,ConfBridge(1)
+same => n,Hangup()
diff --git a/tests/apps/confbridge/muted_conference_start_muted/test-config.yaml b/tests/apps/confbridge/muted_conference_start_muted/test-config.yaml
new file mode 100644
index 0000000..f2b9afa
--- /dev/null
+++ b/tests/apps/confbridge/muted_conference_start_muted/test-config.yaml
@@ -0,0 +1,232 @@
+testinfo:
+    summary: 'Test app_confbridge user mute status starting in a muted conference.'
+    description: |
+        Test the mute status of a user entering an app_confbridge conference
+        when the conference is not muted and when it is muted.
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'apptest.AppTest'
+
+test-object-config:
+    app: 'ConfBridge'
+    scenarios:
+        -
+            events:
+                -
+                    type: 'headermatch'
+                    conditions:
+                        match:
+                            Event: 'ConfbridgeStart'
+                            Conference: '1'
+                    actions:
+                        -
+                            action-type: 'set-expected-result'
+                            expected-result: 'Conference Started'
+                -
+                    type: 'headermatch'
+                    conditions:
+                        match:
+                            Event: 'ConfbridgeEnd'
+                            Conference: '1'
+                    actions:
+                        -
+                            action-type: 'set-expected-result'
+                            expected-result: 'Conference Ended'
+            channels:
+                -
+                    # Alice is the conference admin user that mutes the conference
+                    # after Bob joins.
+                    channel-id: 'Alice'
+                    channel-name: 'Local/alice at default'
+                    start-on-create: True
+                    events:
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'ConfbridgeJoin'
+                                    Conference: '1'
+                                    Channel: 'Local/alice at default-.*'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Alice Joined'
+                                -
+                                    action-type: 'start-call'
+                                    channel-id: 'Bob'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    Type: 'StateChange'
+                                    State: 'CONF_MUTE_UPDATE'
+                                    Mode: 'unmuted'
+                                    Channel: 'Local/alice at default-.*'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Alice is unmuted'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    Type: 'StateChange'
+                                    State: 'CONF_MUTE_UPDATE'
+                                    Mode: 'muted'
+                                    Channel: 'Local/alice at default-.*'
+                            actions:
+                                -
+                                    action-type: 'fail-test'
+                                    message: 'Alice became muted'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'ConfbridgeLeave'
+                                    Conference: '1'
+                                    Channel: 'Local/alice at default-.*'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Alice Left'
+                -
+                    # Bob is a normal user that joins when the conference is unmuted
+                    channel-id: 'Bob'
+                    channel-name: 'Local/bob at default'
+                    events:
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'ConfbridgeJoin'
+                                    Conference: '1'
+                                    Channel: 'Local/bob at default-.*'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Bob Joined'
+                                -
+                                    # Bob just joined so have Alice mute the conference.
+                                    action-type: 'send-dtmf'
+                                    dtmf: '5'
+                                    channel-id: 'Alice'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    Type: 'StateChange'
+                                    State: 'CONF_MUTE_UPDATE'
+                                    Mode: 'unmuted'
+                                    Channel: 'Local/bob at default-.*'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Bob is unmuted'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    Type: 'StateChange'
+                                    State: 'CONF_MUTE_UPDATE'
+                                    Mode: 'muted'
+                                    Channel: 'Local/bob at default-.*'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Bob is muted'
+                                -
+                                    action-type: 'start-call'
+                                    channel-id: 'Carol'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'ConfbridgeLeave'
+                                    Conference: '1'
+                                    Channel: 'Local/bob at default-.*'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Bob Left'
+                -
+                    # Carol is a normal user that joins when the conference is muted
+                    channel-id: 'Carol'
+                    channel-name: 'Local/carol at default'
+                    events:
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'ConfbridgeJoin'
+                                    Conference: '1'
+                                    Channel: 'Local/carol at default-.*'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Carol Joined'
+                                -
+                                    action-type: 'hangup'
+                                    channel-id: 'Alice'
+                                -
+                                    action-type: 'hangup'
+                                    channel-id: 'Bob'
+                                -
+                                    action-type: 'hangup'
+                                    channel-id: 'Carol'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    Type: 'StateChange'
+                                    State: 'CONF_MUTE_UPDATE'
+                                    Mode: 'unmuted'
+                                    Channel: 'Local/carol at default-.*'
+                            actions:
+                                -
+                                    action-type: 'fail-test'
+                                    message: 'Carol started unmuted'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'TestEvent'
+                                    Type: 'StateChange'
+                                    State: 'CONF_MUTE_UPDATE'
+                                    Mode: 'muted'
+                                    Channel: 'Local/carol at default-.*'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Carol is muted'
+                        -
+                            type: 'headermatch'
+                            conditions:
+                                match:
+                                    Event: 'ConfbridgeLeave'
+                                    Conference: '1'
+                                    Channel: 'Local/carol at default-.*'
+                            actions:
+                                -
+                                    action-type: 'set-expected-result'
+                                    expected-result: 'Carol Left'
+
+
+properties:
+    minversion: ['11.22.0', '13.8.0']
+    tags:
+        - confbridge
+        - apps
+    dependencies:
+        - buildoption: 'TEST_FRAMEWORK'
+        - python: 'twisted'
+        - python: 'starpy'
+        - asterisk: 'app_confbridge'
+        - asterisk: 'app_senddtmf'
+        - asterisk: 'app_playback'
diff --git a/tests/apps/confbridge/tests.yaml b/tests/apps/confbridge/tests.yaml
index 271cc16..7efd5ae 100644
--- a/tests/apps/confbridge/tests.yaml
+++ b/tests/apps/confbridge/tests.yaml
@@ -14,3 +14,4 @@
     - test: 'confbridge_waitmarked_normal'
     - test: 'confbridge_waitmarked_only'
     - test: 'confbridge_waitmarked_single'
+    - test: 'muted_conference_start_muted'

-- 
To view, visit https://gerrit.asterisk.org/2202
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c57f59266bfb17ea7534a35283db48ef479617a
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list