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

Jaco Kroon asteriskteam at digium.com
Mon May 2 13:22:43 CDT 2016


Jaco Kroon has uploaded a new change for review.

  https://gerrit.asterisk.org/2742

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

apps/confbridge: Add test for confbridge regexten feature.

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(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/42/2742/1

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..748cbff
--- /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: ['11.21.0','13.9.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: newchange
Gerrit-Change-Id: Ibe540fdeb08200d7a8b16d314a0259809d9fc05f
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>



More information about the asterisk-code-review mailing list