[Asterisk-code-review] apps/confbridge: Add test for confbridge regcontext feature. (testsuite[master])

Anonymous Coward asteriskteam at digium.com
Tue May 10 05:29:08 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: apps/confbridge: Add test for confbridge regcontext feature.
......................................................................


apps/confbridge: Add test for confbridge regcontext feature.

This change adds a test that enables the regcontext feature
on a conference bridge and confirms that the context is added
and removed depending on the lifetime of the conference.

ASTERISK-25989

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

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/tests/apps/confbridge/regcontext/configs/ast1/confbridge.conf b/tests/apps/confbridge/regcontext/configs/ast1/confbridge.conf
new file mode 100644
index 0000000..ad28b57
--- /dev/null
+++ b/tests/apps/confbridge/regcontext/configs/ast1/confbridge.conf
@@ -0,0 +1,7 @@
+[bridgeprofile]
+type=bridge
+regcontext=bridges
+
+[userprofile]
+type=user
+quiet=yes
diff --git a/tests/apps/confbridge/regcontext/configs/ast1/extensions.conf b/tests/apps/confbridge/regcontext/configs/ast1/extensions.conf
new file mode 100644
index 0000000..19c53fe
--- /dev/null
+++ b/tests/apps/confbridge/regcontext/configs/ast1/extensions.conf
@@ -0,0 +1,23 @@
+[default]
+exten => enterbridge,1,NoOP()
+same => n,ConfBridge(123,bridgeprofile,userprofile)
+same => n,Hangup()
+
+exten => h,1,NoOP()
+same => n,GotoIf(${DIALPLAN_EXISTS(bridges,123,1)}?exists:nonexist)
+same => n(exists),UserEvent(BridgeStatus,Status: FailedRemove)
+same => n,Hangup()
+same => n(nonexist),UserEvent(BridgeStatus,Status: SucceedRemove)
+same => n,Hangup()
+
+[caller]
+exten => caller,1,NoOP()
+same => n,Answer()
+same => n,Wait(1)
+same => n,GotoIf(${DIALPLAN_EXISTS(bridges,123,1)}?exists:nonexist)
+same => n(exists),UserEvent(BridgeStatus,Status: SucceedAdd)
+same => n,Hangup()
+same => n(nonexist),UserEvent(BridgeStatus,Status: FailedAdd)
+same => n,Hangup()
+
+[bridges]
diff --git a/tests/apps/confbridge/regcontext/test-config.yaml b/tests/apps/confbridge/regcontext/test-config.yaml
new file mode 100644
index 0000000..d540f8b
--- /dev/null
+++ b/tests/apps/confbridge/regcontext/test-config.yaml
@@ -0,0 +1,77 @@
+testinfo:
+    summary: 'Test app_confbridge to ensure that regcontext gets created.'
+    description: |
+        'Test that after creating a bridge with regcontext the extension gets created
+        in the specified context.'
+
+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: 'ami.AMIEventModule'
+
+test-object-config:
+    connect-ami: True
+
+caller-originator:
+    channel: 'Local/enterbridge at default'
+    context: caller
+    exten: caller
+    priority: 1
+    trigger: 'ami_connect'
+
+ami-config:
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'BridgeStatus'
+                Status: 'FailedAdd'
+        count: 0
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'BridgeStatus'
+                Status: 'FailedRemove'
+        count: 0
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'BridgeStatus'
+                Status: 'SucceedAdd'
+        count: 1
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'BridgeStatus'
+                Status: 'SucceedRemove'
+        count: 1
+
+hangup-monitor:
+    ids: '0'
+
+properties:
+    minversion: 13.10.0
+    tags:
+        - confbridge
+        - apps
+    dependencies:
+        - python : 'twisted'
+        - asterisk: 'app_confbridge'
+        - asterisk: 'app_userevent'
diff --git a/tests/apps/confbridge/tests.yaml b/tests/apps/confbridge/tests.yaml
index 7efd5ae..48e7fca 100644
--- a/tests/apps/confbridge/tests.yaml
+++ b/tests/apps/confbridge/tests.yaml
@@ -15,3 +15,4 @@
     - test: 'confbridge_waitmarked_only'
     - test: 'confbridge_waitmarked_single'
     - test: 'muted_conference_start_muted'
+    - test: 'regcontext'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe540fdeb08200d7a8b16d314a0259809d9fc05f
Gerrit-PatchSet: 2
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jaco Kroon <jaco at uls.co.za>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list