[Asterisk-code-review] app_confbridge: Test for ConfKick application (testsuite[18])

N A asteriskteam at digium.com
Fri Jun 4 15:15:40 CDT 2021


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/16013 )


Change subject: app_confbridge: Test for ConfKick application
......................................................................

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
---
A tests/apps/confbridge/confbridge_confkick/configs/ast1/confbridge.conf
A tests/apps/confbridge/confbridge_confkick/configs/ast1/extensions.conf
A tests/apps/confbridge/confbridge_confkick/test-config.yaml
M tests/apps/confbridge/tests.yaml
4 files changed, 134 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/13/16013/1

diff --git a/tests/apps/confbridge/confbridge_confkick/configs/ast1/confbridge.conf b/tests/apps/confbridge/confbridge_confkick/configs/ast1/confbridge.conf
new file mode 100644
index 0000000..21ce153
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_confkick/configs/ast1/confbridge.conf
@@ -0,0 +1,6 @@
+[default_user]
+type=user
+quiet=yes
+
+[default_bridge]
+type=bridge
diff --git a/tests/apps/confbridge/confbridge_confkick/configs/ast1/extensions.conf b/tests/apps/confbridge/confbridge_confkick/configs/ast1/extensions.conf
new file mode 100644
index 0000000..09d86f1
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_confkick/configs/ast1/extensions.conf
@@ -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()
diff --git a/tests/apps/confbridge/confbridge_confkick/test-config.yaml b/tests/apps/confbridge/confbridge_confkick/test-config.yaml
new file mode 100644
index 0000000..297233e
--- /dev/null
+++ b/tests/apps/confbridge/confbridge_confkick/test-config.yaml
@@ -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 at default'
+    application: 'Echo'
+    trigger: 'ami_connect'
+
+user2-originator:
+    channel: 'Local/user2 at default'
+    application: 'Echo'
+    trigger: 'ami_connect'
+
+user3-originator:
+    channel: 'Local/user3 at default'
+    application: 'Echo'
+    trigger: 'ami_connect'
+
+admin-originator:
+    channel: 'Local/admin at default'
+    application: 'Echo'
+    trigger: 'ami_connect'
+
+kicker-originator:
+    channel: 'Local/kicker at 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'
diff --git a/tests/apps/confbridge/tests.yaml b/tests/apps/confbridge/tests.yaml
index ccf2505..49d3c79 100644
--- a/tests/apps/confbridge/tests.yaml
+++ b/tests/apps/confbridge/tests.yaml
@@ -1,5 +1,6 @@
 # Enter tests here in the order they should be considered for execution:
 tests:
+    - test: 'confbridge_confkick'
     - test: 'confbridge_dynamic_menus'
     - test: 'confbridge_end_marked'
     - test: 'confbridge_marked'

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/16013
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 18
Gerrit-Change-Id: Ia85d6190ab3cf88a7cc4b3071a38dee191bc8898
Gerrit-Change-Number: 16013
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/20210604/fec581a9/attachment.html>


More information about the asterisk-code-review mailing list