[asterisk-commits] Change in testsuite[master]: Add test for Local looping.

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 17 15:58:27 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: Add test for Local looping.
......................................................................


Add test for Local looping.

This test's goal is to ensure that calls to the dialplan
that result in a loop of local channels will be detected after
the prescribed number of max forwards and fail.

In this case, the max forwards is set to 10, so after 10 Dials,
the call should fail.

ASTERISK-24958

Change-Id: I1f44649ce16139091701c4c32efc23bd7b2e270e
---
A tests/channels/local/local_loop/configs/ast1/extensions.conf
A tests/channels/local/local_loop/test-config.yaml
M tests/channels/local/tests.yaml
3 files changed, 69 insertions(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Samuel Galarneau: Looks good to me, but someone else must approve
  Matt Jordan: Looks good to me, approved; Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/tests/channels/local/local_loop/configs/ast1/extensions.conf b/tests/channels/local/local_loop/configs/ast1/extensions.conf
new file mode 100644
index 0000000..09016d6
--- /dev/null
+++ b/tests/channels/local/local_loop/configs/ast1/extensions.conf
@@ -0,0 +1,10 @@
+[default]
+
+exten => loop,1,NoOp()
+same => n,Set(CHANNEL(max_forwards)=10)
+same => n,NoOp(max forwards is ${CHANNEL(max_forwards)})
+same => n,Goto(default,loop1,1)
+
+exten => loop1,1,NoOp()
+same => n,NoOp(max forwards is ${CHANNEL(max_forwards)})
+same => n,Dial(Local/loop1 at default)
diff --git a/tests/channels/local/local_loop/test-config.yaml b/tests/channels/local/local_loop/test-config.yaml
new file mode 100644
index 0000000..a26d028
--- /dev/null
+++ b/tests/channels/local/local_loop/test-config.yaml
@@ -0,0 +1,58 @@
+testinfo:
+    summary: 'Ensure that infinite loops of Local channels cannot happen.'
+    description: |
+        'This test originates a call to a Local extension, which sets the max
+        forwards for the call to 10. The extension then goes to an extension which
+        dials itself. The test ensures that after 10 Dials, all of the calls are
+        hung up.'
+
+test-modules:
+    test-object:
+        typename: test_case.TestCaseModule
+        config-section: test-config
+    modules:
+        -
+            config-section: originator-config
+            typename: 'pluggable_modules.Originator'
+        -
+            config-section: ami-config
+            typename: 'ami.AMIEventModule'
+        -
+            config-section: hangup-config
+            typename: 'pluggable_modules.HangupMonitor'
+
+test-config:
+    connect-ami: True
+
+originator-config:
+    channel: 'Local/loop at default'
+    application: 'Echo'
+    ignore-originate-failure: 'yes'
+    trigger: 'ami_connect'
+
+ami-config:
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'DialBegin'
+                DestChannel: 'Local/loop1 at default.*'
+        count: 10
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'DialEnd'
+                DestChannel: 'Local/loop1 at default.*'
+        count: 10
+
+hangup-config:
+    ids: ['0']
+
+properties:
+    minversion: '13.4.0'
+    dependencies:
+        - python: 'twisted'
+        - python: 'starpy'
+    tags:
+        - chan_local
diff --git a/tests/channels/local/tests.yaml b/tests/channels/local/tests.yaml
index 64ac74a..a009b04 100644
--- a/tests/channels/local/tests.yaml
+++ b/tests/channels/local/tests.yaml
@@ -4,3 +4,4 @@
     - test: 'local_call'
     - test: 'local_holding_bridge'
     - test: 'local_optimize_away'
+    - test: 'local_loop'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1f44649ce16139091701c4c32efc23bd7b2e270e
Gerrit-PatchSet: 3
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Jared K. Smith <jaredsmith at jaredsmith.net>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Samuel Galarneau <sgalarneau at digium.com>



More information about the asterisk-commits mailing list